kern/129526: pxeboot fails to load kernel / modules

Hiroharu Tamaru tamaru at myn.rcast.u-tokyo.ac.jp
Sat Mar 7 10:37:47 PST 2009


Thanks, John, for taking your time for this.

At Mon, 2 Mar 2009 13:53:21 -0500, John Baldwin wrote:
> 
> On Saturday 13 December 2008 3:08:51 am Hiroharu Tamaru wrote:
> > At Wed, 10 Dec 2008 14:51:48 -0500,
> > John Baldwin wrote:
> > > 
> > > On Wednesday 10 December 2008 04:20:31 am Hiroharu Tamaru wrote:
> > > > Thank you, John.
> > > > 
> > > > At Tue, 9 Dec 2008 16:21:47 -0500, John Baldwin wrote:
> > > > >
> > > > > On Tuesday 09 December 2008 12:54:06 pm Hiroharu Tamaru wrote:
> > > > (snip)
> > > > > > It turns out that replacing the pxeboot binary served by tftp
> > > > > > to pxeboot in 6.4-RELEASE-i386-bootonly.iso allows the installer
> > > > > > to boot properly, but pxeboot from 7.0-RELEASE also fails.
> > > > > > 
> > > > > > It then turned out that by unzipping the /boot/mfsroot.gz image
> > > > > > on the ftp server, it allows the kernel to boot, for any of the 
> > > pxeboot's
> > > > > > mentioned above.
> > > > > > 
> > > > > > Thus, it seems likely that the unzipping routines in pxeboot,
> > > > > > or more precisely, the loader included in the pxeboot,
> > > > > > is corrupting some part of the device table or such.
> > > > (snip)
> > > > > I think loader has just grown and the stack is growing into the heap.  
> > > There 
> > > > > is a loader option to move the heap up above 1 MB that you should try.
> > > > 
> > > > Indeed, it was.
> > > > 
> > > > (for the record:)
> > > > Enabling the code in sys/boot/i386/loader/main.c
> > > > that is activated by putting either of:
> > > >  LOADER_BZIP2_SUPPORT=yes
> > > >  LOADER_FIREWIRE_SUPPORT=yes
> > > >  LOADER_ZFS_SUPPORT=yes  (8.0-current only ATM)
> > > > into /etc/make.conf has solved the problem.
> > > > 
> > > > 
> > > > Current pxeboot build pulls the loader binary built for
> > > > the (non-pxe-)loader verbatim.
> > > > 
> > > > Is there a possibility that putting the heap above 1MB
> > > > might become the default in the near future? say, whenever
> > > > LOAD_NO_GZIP_SUPPORT is not set.
> > > > 
> > > > Alternatively, do you think it is worth a trouble to modifiy
> > > > the build system so that the default pxeboot has this high
> > > > heap support?
> > > > 
> > > > Or, would you think whoever setting up an pxeboot installer
> > > > should know the corners, and either unzip the mfsroot.gz or
> > > > rebuild his own pxeboot?
> > > 
> > > I think adding GPT support (which I did) probably caused the loader to 
> grow 
> > > enough in size.  Probably I should make the GPT stuff optional and enable 
> the 
> > > higher memory usage if it is enabled (but make it on by default perhaps?)
> > 
> > I agree that's quite reasonable (wrapping around GPT, and default it to on).
> > 
> > I looked into the sources, but to me, wrapping all the bits on GPT with
> > #ifdef LOADER_GPT_SUPPORT was not too trivial.
> > How trivial or non-trivial is it if I asked you for it?
> > I'll look into it again when I get another time slot if 
> > you are too busy until then.
> 
> I finally did this today.  You can try 
> http://www.freebsd.org/~jhb/patches/boot_gpt.patch
> 
> If you can verify it works for you I will commit it.

OK. I tried it, but not very good, unfortunately.

First off, the sources for 7.0 is different from those for 8-current,
and the diff did not apply cleanly for 7.0.

Although the rejected bits were trivial to hand-apply,
I decided to have a try with 8-current pxeboot.

I worked with 8-current sources as of couple of weeks ago,
and this time, the patch applied cleanly.

Now the results:

1) The original pxeboot did not even stop by saying it
   cannot find the root filesystem (as I reported for 7.0RC1
   pxeboot), but it silently blanked the screen out and hung
   the system up.
   --- I suppose the 8-current loader has grown even more?
   By the way, if mfsroot.gz is unzip'ped to mfsroot, the
   boot proceeds, as was so for the original 7.0RC1 pxeboot.

2) The patched pxeboot worked!
   -- this is good, but was quite expected, right?

3) The patched pxeboot with LOADER_NO_GPT_SUPPORT="yes" in
   /etc/make.conf gave the same symptom as the 7.0RC1
   pxeboot: it fails for gzip'ed mfsroot.gz saying the root
   filesystem is not found, but succeeds for unzip'ped
   mfsroot .
   --- so, just removing the GPT parts are not enough, at 
   least for the pxeboot in current.

and finally, FWIW,
4) 7.0RC pxeboot hand-patched, and with
   LOADER_NO_GPT_SUPPORT="yes" also failed, just like 3).


It sure helps the default pxeboot, so for me it is much
better if this is commited, but what would you say?

Hiroharu Tamaru


More information about the freebsd-bugs mailing list