From owner-freebsd-stable@FreeBSD.ORG Sun Mar 9 02:44:51 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06A0F1065671 for ; Sun, 9 Mar 2008 02:44:51 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id E7FCA8FC13 for ; Sun, 9 Mar 2008 02:44:50 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id A22F11CC033; Sat, 8 Mar 2008 18:44:50 -0800 (PST) Date: Sat, 8 Mar 2008 18:44:50 -0800 From: Jeremy Chadwick To: Torfinn Ingolfsen Message-ID: <20080309024450.GA92566@eos.sc1.parodius.com> References: <200803061742.34291.vincent@netaktiv.com> <200803071059.48837.doconnor@gsoft.com.au> <200803070913.12978.jhb@freebsd.org> <20080308131610.43b57ee6.torfinn.ingolfsen@broadpark.no> <47D29352.5050503@andric.com> <20080308222145.68b284e9.torfinn.ingolfsen@broadpark.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080308222145.68b284e9.torfinn.ingolfsen@broadpark.no> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-stable@freebsd.org Subject: Re: BTX on USB pen drive X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2008 02:44:51 -0000 On Sat, Mar 08, 2008 at 10:21:45PM +0100, Torfinn Ingolfsen wrote: > On Sat, 08 Mar 2008 14:23:30 +0100 > Dimitry Andric wrote: > > > No, update it to 1.45 (=HEAD) and then apply the patch, that's much > > easier. > > Yes, that worked better - the patch applied cleanly, amd I could > rebuild the loader. > > Here is how I did the rebuilding (all this done on another machine, > which have no troubles booting from usb): > I booted the machine from usb (da0), replaced btx.S with revision 1.45 > and did: > cd /usr/src > patch -p6 < .../btx_real.patch > cd sys/boot/i386 > make > Then I copied the files to the hard drive: > boot0cfg -B -b /usr/obj/usr/src/sys/boot/i386/boot0/boot0 da0 > cp -v /usr/obj/usr/src/sys/boot/i386/loader/loader /boot > > Is this the correct way to do build and update the files? To quote lolcats: "yr doin it wrong". The Handbook goes over how to rebuild the bootblocks. See Section 24.6.5.2, which is for Serial Console. You can skip the obvious steps (items 1-3, and item 5). Patch the source *before* doing item 4, obviously: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setup.html There's a lot of pieces involved when it comes to BTX; all stages (boot0, boot1, boot2/loader) appear to use the BTX library in src/sys/boot/i386/btx/lib. Thus, following the procedure above is the right way to do things. Your boot0cfg line to reinstall the boot0 MBR looks fine, but I don't use boot0 myself (I prefer to go right into boot2/loader). -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |