From owner-svn-src-all@FreeBSD.ORG Sun Nov 22 15:57:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B414106568D; Sun, 22 Nov 2009 15:57:08 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3C38FC0A; Sun, 22 Nov 2009 15:57:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMFv8R2022536; Sun, 22 Nov 2009 15:57:08 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAMFv8Mg022533; Sun, 22 Nov 2009 15:57:08 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911221557.nAMFv8Mg022533@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 Nov 2009 15:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199650 - stable/8/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 15:57:08 -0000 Author: attilio Date: Sun Nov 22 15:57:08 2009 New Revision: 199650 URL: http://svn.freebsd.org/changeset/base/199650 Log: MFC r199210: Introduce the new loader compile-time option BOOT_PROMPT_123 which allows to enter the loader prompt just after entering the sequence "123". Sponsored by: Sandvine Incorporated Modified: stable/8/sys/boot/common/Makefile.inc stable/8/sys/boot/common/boot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/common/Makefile.inc ============================================================================== --- stable/8/sys/boot/common/Makefile.inc Sun Nov 22 15:53:39 2009 (r199649) +++ stable/8/sys/boot/common/Makefile.inc Sun Nov 22 15:57:08 2009 (r199650) @@ -38,4 +38,8 @@ MAN+= ../forth/loader.conf.5 MAN+= ../forth/loader.4th.8 .endif +.if defined(BOOT_PROMPT_123) +CFLAGS+= -DBOOT_PROMPT_123 +.endif + MAN+= loader.8 Modified: stable/8/sys/boot/common/boot.c ============================================================================== --- stable/8/sys/boot/common/boot.c Sun Nov 22 15:53:39 2009 (r199649) +++ stable/8/sys/boot/common/boot.c Sun Nov 22 15:57:08 2009 (r199650) @@ -162,6 +162,9 @@ autoboot(int timeout, char *prompt) int c, yes; char *argv[2], *cp, *ep; char *kernelname; +#ifdef BOOT_PROMPT_123 + const char *seq = "123", *p = seq; +#endif autoboot_tried = 1; @@ -192,14 +195,29 @@ autoboot(int timeout, char *prompt) yes = 0; +#ifdef BOOT_PROMPT_123 + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or " + "1 2 3 sequence for command prompt." : prompt); +#else printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); +#endif for (;;) { if (ischar()) { c = getchar(); +#ifdef BOOT_PROMPT_123 + if ((c == '\r') || (c == '\n')) { + yes = 1; + break; + } else if (c != *p++) + p = seq; + if (*p == 0) + break; +#else if ((c == '\r') || (c == '\n')) yes = 1; break; +#endif } ntime = time(NULL); if (ntime >= when) {