BTX on USB pen drive

Jeremy Chadwick koitsu at freebsd.org
Sun Mar 9 02:44:51 UTC 2008


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 at 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 |



More information about the freebsd-stable mailing list