From owner-svn-src-stable-9@FreeBSD.ORG Fri Jan 13 18:49:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E56ED106564A; Fri, 13 Jan 2012 18:49:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB18B8FC1B; Fri, 13 Jan 2012 18:49:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0DIn4wA074578; Fri, 13 Jan 2012 18:49:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DIn4aT074574; Fri, 13 Jan 2012 18:49:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131849.q0DIn4aT074574@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 18:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230065 - in stable/9: sys/boot/i386/boot0 usr.sbin/boot0cfg X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:49:05 -0000 Author: jhb Date: Fri Jan 13 18:49:04 2012 New Revision: 230065 URL: http://svn.freebsd.org/changeset/base/230065 Log: MFC 228738: Allow boot0cfg to force a PXE boot via boot0 on the next boot. - Fix boot0 to check for PXE when using the pre-set setting for the preferred slice. - Update boot0cfg to use slice 6 to select PXE. Accept a 'pxe' argument instead of a number for the 's' option as a way to select PXE as well. Modified: stable/9/sys/boot/i386/boot0/boot0.S stable/9/usr.sbin/boot0cfg/boot0cfg.8 stable/9/usr.sbin/boot0cfg/boot0cfg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/usr.sbin/boot0cfg/ (props changed) Modified: stable/9/sys/boot/i386/boot0/boot0.S ============================================================================== --- stable/9/sys/boot/i386/boot0/boot0.S Fri Jan 13 18:32:56 2012 (r230064) +++ stable/9/sys/boot/i386/boot0/boot0.S Fri Jan 13 18:49:04 2012 (r230065) @@ -413,6 +413,7 @@ got_key: 3: #endif /* ONLY_F_KEYS */ #endif /* SIO */ +check_selection: cmpb $0x5,%al # F1..F6 or 1..6 ? #ifdef PXE /* enable PXE/INT18 using F6 */ jne 1f; @@ -421,7 +422,6 @@ got_key: #endif /* PXE */ jae beep # Not in F1..F5, beep -check_selection: /* * We have a selection. If it's a bad selection go back to complain. * The bits in MNUOPT were set when the options were printed. Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.8 Fri Jan 13 18:32:56 2012 (r230064) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.8 Fri Jan 13 18:49:04 2012 (r230065) @@ -146,6 +146,9 @@ Set the default boot selection to .Ar slice . Values between 1 and 4 refer to slices; a value of 5 refers to the option of booting from a second disk. +The special string +.Dq PXE +or a value of 6 can be used to boot via PXE. .It Fl t Ar ticks Set the timeout value to .Ar ticks . Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.c Fri Jan 13 18:32:56 2012 (r230064) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.c Fri Jan 13 18:49:04 2012 (r230065) @@ -168,7 +168,10 @@ main(int argc, char *argv[]) o_flag = 1; break; case 's': - s_arg = argtoi(optarg, 1, 5, 's'); + if (strcasecmp(optarg, "pxe") == 0) + s_arg = 6; + else + s_arg = argtoi(optarg, 1, 6, 's'); break; case 't': t_arg = argtoi(optarg, 1, 0xffff, 't'); @@ -441,8 +444,10 @@ display_mbr(u_int8_t *mbr) printf("default_selection=F%d (", mbr[OFF_OPT] + 1); if (mbr[OFF_OPT] < 4) printf("Slice %d", mbr[OFF_OPT] + 1); - else + else if (mbr[OFF_OPT] == 4) printf("Drive 1"); + else + printf("PXE"); printf(")\n"); }