Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Mar 2008 18:44:50 -0800
From:      Jeremy Chadwick <koitsu@freebsd.org>
To:        Torfinn Ingolfsen <torfinn.ingolfsen@broadpark.no>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: BTX on USB pen drive
Message-ID:  <20080309024450.GA92566@eos.sc1.parodius.com>
In-Reply-To: <20080308222145.68b284e9.torfinn.ingolfsen@broadpark.no>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 08, 2008 at 10:21:45PM +0100, Torfinn Ingolfsen wrote:
> On Sat, 08 Mar 2008 14:23:30 +0100
> Dimitry Andric <dimitry@andric.com> 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 |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080309024450.GA92566>