From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 9 06:56:13 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D8481065670; Sun, 9 Jan 2011 06:56:13 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk [80.68.91.100]) by mx1.freebsd.org (Postfix) with ESMTP id C89A18FC0A; Sun, 9 Jan 2011 06:56:12 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 175F711C03B; Sun, 9 Jan 2011 06:39:38 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1]) by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NCY3BR9tGCOV; Sun, 9 Jan 2011 06:39:35 +0000 (GMT) Received: from 192-168-200-57.lan.tj.home.tomjudge.com (unknown [192.168.200.57]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 9F24A11C03A; Sun, 9 Jan 2011 06:39:34 +0000 (GMT) Message-ID: <4D295820.20807@tomjudge.com> Date: Sun, 09 Jan 2011 00:39:28 -0600 From: Tom Judge User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org, luigi@freebsd.org, imp@bsdimp.com X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig51B4786EC9D39188BAE04052" Cc: Subject: sys/boot/boot0/boot0.S - r186598 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 06:56:13 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig51B4786EC9D39188BAE04052 Content-Type: multipart/mixed; boundary="------------070003060308030201090207" This is a multi-part message in MIME format. --------------070003060308030201090207 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Today I ran into an issue where setting the default slice with boot0cfg -s is broken. This is related to a section of this revision: + commit Warner's patch "orb $NOUPDATE,_FLAGS(%bp)" to avoid writing to disk in case of a timeout/default choice; This issue is quite well documented in bin/134907 which has been open since May 2009. Reproduced with a fresh nanobsd build: Boot 1 - Slice 1 active as set by nanobsd image builder: =3D=3D=3D # boot0cfg -v ad0 # flag start chs type end chs offset size 1 0x80 0: 1: 1 0xa5 494: 15:63 63 498897 2 0x00 495: 1: 1 0xa5 989: 15:63 499023 498897 3 0x00 990: 0: 1 0xa5 992: 15:63 997920 3024 version=3D2.0 drive=3D0x80 mask=3D0x3 ticks=3D182 bell=3D# (0x23) options=3Dpacket,update,nosetdrv volume serial ID 9090-9090 default_selection=3DF1 (Slice 1) =3D=3D=3D Update the active slice to 2: =3D=3D=3D # boot0cfg -s 2 -v ad0 # flag start chs type end chs offset size 1 0x80 0: 1: 1 0xa5 494: 15:63 63 498897 2 0x00 495: 1: 1 0xa5 989: 15:63 499023 498897 3 0x00 990: 0: 1 0xa5 992: 15:63 997920 3024 version=3D2.0 drive=3D0x80 mask=3D0x3 ticks=3D182 bell=3D# (0x23) options=3Dpacket,update,nosetdrv volume serial ID 9090-9090 default_selection=3DF2 (Slice 2) =3D=3D=3D Reboot and let boot0 time out and boot default slice 2: =3D=3D=3D # boot0cfg -v ad0 # flag start chs type end chs offset size 1 0x80 0: 1: 1 0xa5 494: 15:63 63 498897 2 0x00 495: 1: 1 0xa5 989: 15:63 499023 498897 3 0x00 990: 0: 1 0xa5 992: 15:63 997920 3024 version=3D2.0 drive=3D0x80 mask=3D0x3 ticks=3D182 bell=3D# (0x23) options=3Dpacket,update,nosetdrv volume serial ID 9090-9090 default_selection=3DF2 (Slice 2) =3D=3D=3D The system actually booted into slice 1 here. This was verified by dropping to the loader prompt and using show to grab= : loaddev=3Ddisk0s1a: Reboot and hit 2 at the boot0 prompt: =3D=3D=3D # boot0cfg -v ad0 # flag start chs type end chs offset size 1 0x00 0: 1: 1 0xa5 494: 15:63 63 498897 2 0x80 495: 1: 1 0xa5 989: 15:63 499023 498897 3 0x00 990: 0: 1 0xa5 992: 15:63 997920 3024 version=3D2.0 drive=3D0x80 mask=3D0x3 ticks=3D182 bell=3D# (0x23) options=3Dpacket,update,nosetdrv volume serial ID 9090-9090 default_selection=3DF2 (Slice 2) =3D=3D=3D This time we really boot into slice 2. The attached patch backs out the relevant part of r186598. There was a post on the embedded list that suggested this work around: echo 'a 2' | fdisk -f /dev/stdin ad0 boot0cfg -s 2 ad0 There are 2 issues with this: 1) It can't be done without setting kern.geom.debugflags to 0x10. 2) It resulted in most/all commands resulting in the error message "Device not configured" including the second command and 'shutdown -r now= '. Both of which leave this really work around fairly broken. Tom --------------070003060308030201090207 Content-Type: text/plain; name="boot0.s.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="boot0.s.txt" Index: boot0.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- boot0.S (revision 213760) +++ boot0.S (working copy) @@ -373,7 +373,6 @@ * Timed out or default selection */ use_default: movb _OPT(%bp),%al # Load default - orb $NOUPDATE,_FLAGS(%bp) # Disable updates jmp check_selection # Join common code =20 /* --------------070003060308030201090207-- --------------enig51B4786EC9D39188BAE04052 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNKVglAAoJEMSwVS7lr0Odc1IIAJlq8MmwSzEWr6Q6DHUUYUQ8 r/WUFK73KUKTMeGR9SJQEAhG49GomzZqbVl5Tu6QNZFz6lzY6uksXLkG8BLw6AQ/ 0oovTCLCoQR/CSDEVcv6f+twR9t8/MZl/nlduHdsCpmQr9RZKvOISILNSwtxR/i0 3b69iwraiXABJFlazIeuNxW77gauvslvnqCgQqQBUsI/tjLFOteuQPnk9mlEkDiJ 1wdHQGVE/l5mntHQCstKHU1KVbeqQhsgDKsvhiiPDRbeESyTKpRfPIANUoPnzY3o n+dF45ql69QfOjKjxC5465B6nlpJBYDWxlbCsgWVczxur/6e/8420+KEORphrFQ= =+O2j -----END PGP SIGNATURE----- --------------enig51B4786EC9D39188BAE04052--