Discussion:
[gPXE] GRUB 1.97 PXE
Paul Geraedts
2009-11-04 00:31:35 UTC
Permalink
Hello,

First of all, thanks for all the effort you all put in Etherboot/GPXE
(I've much enjoyed your Google Tech Talk Video). I recently started
using GPXE and it simply is a great tool! I already used various GPXE
features succesfully.

The one thing I can't seem to get to work though is the combination of
GPXE and the PXE version of GRUB2 (the latest v1.97 to be precise). I
followed the instructions on http://grub.enbug.org/PXEBOOT to build
the GRUB PXE image and used DNSmasq in Ubuntu (Karmic) to serve the
image to the client side (my laptop). It works with the build-in PXE
ROM in my laptop, but it doesn't seem to work with GPXE. (To be
precise: GRUB only wants to start in rescue mode in the latter case).
Am I doing something wrong, or is there some sort of incompatibility
between the two tools?

Any help on this is much appreciated.

Cheers, Paul


BTW, what does the G in GPXE actually stand for?
Marty Connor
2009-11-04 01:04:32 UTC
Permalink
Hi Paul,

I approved your post to the gPXE mailing list. Please join the list if
you would like to continue sending and receiving messages to the list.

At the moment we're in a transition from the old Etherboot-Discuss and
Etherboot-Developer lists to the new gpxe at etherboot.org list. You might
also want to join Etherboot-Discuss for the short term until we do the
official switchover (which should be within a week or two)

Your question is an interesting one, and we are working on better PXE
compatibility right now. We recently been in contact with the author of
DNSMasq about compatibility.

I'm not quite sure I understand how this is supposed to work, and the
difference in behavior between other PXE implementations and gPXE. I'm
sure we can find out with a little debugging, and we're interested in
doing so.

gPXE stands for GPL'ed PXE. When I came up with the name I was mostly
looking for something that emphasized that we were doing a FOSS PXE
implementation, so I followed the pattern of various other things like
gcc, gawk, gnus, etc.

Thanks again for your report, and I would like to see if we can
understand what is causing the difference in behavior you are seeing
between PXE implementations.

Regards,

Marty
Post by Paul Geraedts
Hello,
First of all, thanks for all the effort you all put in Etherboot/GPXE
(I've much enjoyed your Google Tech Talk Video). I recently started
using GPXE and it simply is a great tool! I already used various GPXE
features succesfully.
The one thing I can't seem to get to work though is the combination of
GPXE and the PXE version of GRUB2 (the latest v1.97 to be precise). I
followed the instructions on http://grub.enbug.org/PXEBOOT to build
the GRUB PXE image and used DNSmasq in Ubuntu (Karmic) to serve the
image to the client side (my laptop). It works with the build-in PXE
ROM in my laptop, but it doesn't seem to work with GPXE. (To be
precise: GRUB only wants to start in rescue mode in the latter case).
Am I doing something wrong, or is there some sort of incompatibility
between the two tools?
Any help on this is much appreciated.
Cheers, Paul
BTW, what does the G in GPXE actually stand for?
_______________________________________________
gPXE mailing list
gPXE at etherboot.org
http://etherboot.org/mailman/listinfo/gpxe
Paul Geraedts
2009-11-04 18:46:03 UTC
Permalink
Hi Marty,

Nice to hear that you're interested. Today I subscribed to the
gpxe at etherboot.org list.

AFAIK the PXE version of GRUB2 starts by creating a '(pxe)' device and
sets the root directory to this (pxe) device (basically 'root (pxe)').
Then it searches in /boot/grub/ of this device for its configuration
file ('grub.cfg') and module files ('*.mod'), among others. If it
doesn't find those files, you end up in rescue mode. This rescue mode
is limited in functionality, but does allow for commands like 'ls',
which does not show the (pxe) device when I boot from gPXE. So for
some reason GRUB2 doesn't seem able to create this (PXE) device right
after it gets loaded by gPXE. It does create this (PXE) device when
loaded by my proprietary boot ROM, after which it successfully enters
the normal mode.

What I understand is that GRUB2 will - in the short-term (v2.00?) -
have full-featured support for booting from optical discs and USB
devices even if the BIOS doesn't support those. Sounds to me like a
handy feature in case of certain emergencies regarding older
computers. So GRUB2 seems an interesting candidate to netboot first
off my WRT54GL router.

That is, when I've got some more time I will add an SD card slot on
this router. (AFAIK it can be connected by means of SPI over GPIO,
which seems to be supported by OpenWrt.) Then I only have to add
appropriate EEPROMs to the RTL8139D cards in boths my servers, and my
complete netboot environment should be up-and-running (my laptops can
use their build-in PXE ROM for the moment). I got some remaining
questions on this hardware side of gPXE, but that's something for
another thread.

Looking forward to any developments on GRUB2 compatibility.

Cheers,

Paul
Post by Marty Connor
Hi Paul,
I approved your post to the gPXE mailing list. ?Please join the list if you
would like to continue sending and receiving messages to the list.
At the moment we're in a transition from the old Etherboot-Discuss and
Etherboot-Developer lists to the new gpxe at etherboot.org list. You might also
want to join Etherboot-Discuss for the short term until we do the official
switchover (which should be within a week or two)
Your question is an interesting one, and we are working on better PXE
compatibility right now. ?We recently been in contact with the author of
DNSMasq about compatibility.
I'm not quite sure I understand how this is supposed to work, and the
difference in behavior between other PXE implementations and gPXE. ?I'm sure
we can find out with a little debugging, and we're interested in doing so.
gPXE stands for GPL'ed PXE. ?When I came up with the name I was mostly
looking for something that emphasized that we were doing a FOSS PXE
implementation, so I followed the pattern of various other things like gcc,
gawk, gnus, etc.
Thanks again for your report, and I would like to see if we can understand
what is causing the difference in behavior you are seeing between PXE
implementations.
Regards,
Marty
Post by Paul Geraedts
Hello,
First of all, thanks for all the effort you all put in Etherboot/GPXE
(I've much enjoyed your Google Tech Talk Video). I recently started
using GPXE and it simply is a great tool! I already used various GPXE
features successfully.
The one thing I can't seem to get to work though is the combination of
GPXE and the PXE version of GRUB2 (the latest v1.97 to be precise). I
followed the instructions on http://grub.enbug.org/PXEBOOT to build
the GRUB PXE image and used DNSmasq in Ubuntu (Karmic) to serve the
image to the client side (my laptop). It works with the build-in PXE
ROM in my laptop, but it doesn't seem to work with GPXE. (To be
precise: GRUB only wants to start in rescue mode in the latter case).
Am I doing something wrong, or is there some sort of incompatibility
between the two tools?
Any help on this is much appreciated.
Cheers, Paul
BTW, what does the G in GPXE actually stand for?
_______________________________________________
gPXE mailing list
gPXE at etherboot.org
http://etherboot.org/mailman/listinfo/gpxe
Stefan Hajnoczi
2009-11-04 22:22:25 UTC
Permalink
PXE debugging messages in gPXE can be enabled by building like this:
make DEBUG=pxe_call,pxe_file,pxe_tftp,pxe_preboot,pxe_undi,pxe_udp,pxe_loader
[...your usual build target...]

You should see PXE call debug output (which PXE interface call is
being made). Hopefully this will help us determine how GRUB and gPXE
are interacting.

If you get too many messages, you may wish to enable the serial
console in gPXE so that GRUB has the screen all to itself and you can
log gPXE debug messages from serial. See config/defaults/pcbios.h
#define CONSOLE_SERIAL.

Stefan
Thomas Miletich
2009-11-04 23:17:44 UTC
Permalink
Hi Paul,
I tested your setup and could identify a few problems. There are still
some more problems to solve before GRUB works with gPXE.
First, the resulting file 'grub2pxe' from the tutorial is identified
by gPXE as a Multiboot kernel, instead of a NBP. A NBP is a program a
PXE rom loads, to load the real kernel.
It could be a Multiboot file to make it bootable by other bootloaders,
or it could be wrongly identified as one by gPXE. My Ubuntu's 'file'
command say's it's no Multiboot kernel, but the gPXE Multiboot loader
seems capable of booting it. I don't know if a dual Multiboot-NBP
image is possible and will investigate that part further.
Anyway, there is no way to identify a binary file as a NBP, so gPXE
uses it as a last choice. As long as gPXE is compiled with Multiboot
support, Multiboot will take precedence.
The problem with that is that GRUB wants to use gPXE's PXE functions,
which are only available to NBPs. As only NBPs are supposed to use any
PXE functions, but not Multiboot kernels, gPXE turns itself completely
off before it starts GRUB, and there's no PXE stack left for GRUB to
use.

I disabled Multiboot support by putting a '#undef IMAGE_MULTIBOOT' in
src/config/general.h. Then I started GRUB with the following commands:

dhcp net0
startpxe net0
chain boot/grub/grub2pxe

startpxe shouldn't be necessary, but I used it to be safe. GRUB finds
the PXE stack and tries to download boot/grub/normal.mod but fails.
DEBUG=pxe_tftp shows that gPXE opens the file, and receives several
read requests:

[PXENV_TFTP_GET_FSIZE
tftp://192.168.10.100:69/boot/grub/normal.mod?blksize=512
fsize=34732][PXENV_TFTP_OPEN
tftp://192.168.10.100:69/boot/grub/normal.mod?blksize=512
blksize=1432][PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_READ to
6800:0000][PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_READ to 6800:0000]
/* here are many more READs */
[PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_CLOSE]

Then GRUB enters rescue mode with the message "error: no file name found".
I verified that it works with a vendor PXE rom. I will continue my
investigation tomorrow. Right now, I don't have any idea why GRUB is
unable to find/use the file it requested. If anyone has any thoughts,
please let me know.

Thanks
Thomas
Post by Paul Geraedts
Hello,
First of all, thanks for all the effort you all put in Etherboot/GPXE
(I've much enjoyed your Google Tech Talk Video). I recently started
using GPXE and it simply is a great tool! I already used various GPXE
features succesfully.
The one thing I can't seem to get to work though is the combination of
GPXE and the PXE version of GRUB2 (the latest v1.97 to be precise). I
followed the instructions on http://grub.enbug.org/PXEBOOT to build
the GRUB PXE image and used DNSmasq in Ubuntu (Karmic) to serve the
image to the client side (my laptop). It works with the build-in PXE
ROM in my laptop, but it doesn't seem to work with GPXE. (To be
precise: GRUB only wants to start in rescue mode in the latter case).
Am I doing something wrong, or is there some sort of incompatibility
between the two tools?
Any help on this is much appreciated.
Cheers, Paul
BTW, what does the G in GPXE actually stand for?
_______________________________________________
gPXE mailing list
gPXE at etherboot.org
http://etherboot.org/mailman/listinfo/gpxe
Paul Geraedts
2009-11-05 22:05:01 UTC
Permalink
Hi Thomas,

Interpreted as a multiboot image, I surely didn't expect that. Great
that you figured it out.

The remaining part is definately interesting to say the least. I get
identical behavior over here. Currently I haven't got an idea about it
though, sorry. If so, I'll let you know.

Paul

P.S. I wasn't aware of the serial debugging feature: nice one.
Post by Marty Connor
Hi Paul,
I tested your setup and could identify a few problems. There are still
some more problems to solve before GRUB works with gPXE.
First, the resulting file 'grub2pxe' from the tutorial is identified
by gPXE as a Multiboot kernel, instead of a NBP. A NBP is a program a
PXE rom loads, to load the real kernel.
It could be a Multiboot file to make it bootable by other bootloaders,
or it could be wrongly identified as one by gPXE. My Ubuntu's 'file'
command say's it's no Multiboot kernel, but the gPXE Multiboot loader
seems capable of booting it. I don't know if a dual Multiboot-NBP
image is possible and ?will investigate that part further.
Anyway, there is no way to identify a binary file as a NBP, so gPXE
uses it as a last choice. As long as gPXE is compiled with Multiboot
support, Multiboot will take precedence.
The problem with that is that GRUB wants to use gPXE's PXE functions,
which are only available to NBPs. As only NBPs are supposed to use any
PXE functions, but not Multiboot kernels, gPXE turns itself completely
off before it starts GRUB, and there's no PXE stack left for GRUB to
use.
I disabled Multiboot support by putting a '#undef IMAGE_MULTIBOOT' in
dhcp net0
startpxe net0
chain boot/grub/grub2pxe
startpxe shouldn't be necessary, but I used it to be safe. GRUB finds
the PXE stack and tries to download boot/grub/normal.mod but fails.
DEBUG=pxe_tftp shows that gPXE opens the file, and receives several
[PXENV_TFTP_GET_FSIZE
tftp://192.168.10.100:69/boot/grub/normal.mod?blksize=512
fsize=34732][PXENV_TFTP_OPEN
tftp://192.168.10.100:69/boot/grub/normal.mod?blksize=512
blksize=1432][PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_READ to
6800:0000][PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_READ to 6800:0000]
/* here are many more READs */
[PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_CLOSE]
Then GRUB enters rescue mode with the message "error: no file name found".
I verified that it works with a vendor PXE rom. I will continue my
investigation tomorrow. Right now, I don't have any idea why GRUB is
unable to find/use the file it requested. If anyone has any thoughts,
please let me know.
Thanks
Thomas
Post by Paul Geraedts
Hello,
First of all, thanks for all the effort you all put in Etherboot/GPXE
(I've much enjoyed your Google Tech Talk Video). I recently started
using GPXE and it simply is a great tool! I already used various GPXE
features succesfully.
The one thing I can't seem to get to work though is the combination of
GPXE and the PXE version of GRUB2 (the latest v1.97 to be precise). I
followed the instructions on http://grub.enbug.org/PXEBOOT to build
the GRUB PXE image and used DNSmasq in Ubuntu (Karmic) to serve the
image to the client side (my laptop). It works with the build-in PXE
ROM in my laptop, but it doesn't seem to work with GPXE. (To be
precise: GRUB only wants to start in rescue mode in the latter case).
Am I doing something wrong, or is there some sort of incompatibility
between the two tools?
Any help on this is much appreciated.
Cheers, Paul
BTW, what does the G in GPXE actually stand for?
_______________________________________________
gPXE mailing list
gPXE at etherboot.org
http://etherboot.org/mailman/listinfo/gpxe
Thomas Miletich
2009-11-06 00:52:32 UTC
Permalink
Hi
here's my update for today. Unfortunately GRUB2 still doesn't boot.
I'm still stuck at the same point.
GRUB2 is able to load modules dynamically. The error message we're
seeing results from the dynamic loader being unable to find the
'.modname' section in the module. I actually thought I found out a few
other things too, but before sending this mail I realized I totally
messed up my debugging and that additional information is most likely
invalid.

I hope I'll have more luck tomorrow

Thomas
Post by Paul Geraedts
Hi Thomas,
Interpreted as a multiboot image, I surely didn't expect that. Great
that you figured it out.
The remaining part is definately interesting to say the least. I get
identical behavior over here. Currently I haven't got an idea about it
though, sorry. If so, I'll let you know.
Paul
P.S. I wasn't aware of the serial debugging feature: nice one.
Post by Marty Connor
Hi Paul,
I tested your setup and could identify a few problems. There are still
some more problems to solve before GRUB works with gPXE.
First, the resulting file 'grub2pxe' from the tutorial is identified
by gPXE as a Multiboot kernel, instead of a NBP. A NBP is a program a
PXE rom loads, to load the real kernel.
It could be a Multiboot file to make it bootable by other bootloaders,
or it could be wrongly identified as one by gPXE. My Ubuntu's 'file'
command say's it's no Multiboot kernel, but the gPXE Multiboot loader
seems capable of booting it. I don't know if a dual Multiboot-NBP
image is possible and ?will investigate that part further.
Anyway, there is no way to identify a binary file as a NBP, so gPXE
uses it as a last choice. As long as gPXE is compiled with Multiboot
support, Multiboot will take precedence.
The problem with that is that GRUB wants to use gPXE's PXE functions,
which are only available to NBPs. As only NBPs are supposed to use any
PXE functions, but not Multiboot kernels, gPXE turns itself completely
off before it starts GRUB, and there's no PXE stack left for GRUB to
use.
I disabled Multiboot support by putting a '#undef IMAGE_MULTIBOOT' in
dhcp net0
startpxe net0
chain boot/grub/grub2pxe
startpxe shouldn't be necessary, but I used it to be safe. GRUB finds
the PXE stack and tries to download boot/grub/normal.mod but fails.
DEBUG=pxe_tftp shows that gPXE opens the file, and receives several
[PXENV_TFTP_GET_FSIZE
tftp://192.168.10.100:69/boot/grub/normal.mod?blksize=512
fsize=34732][PXENV_TFTP_OPEN
tftp://192.168.10.100:69/boot/grub/normal.mod?blksize=512
blksize=1432][PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_READ to
6800:0000][PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_READ to 6800:0000]
/* here are many more READs */
[PXENV_TFTP_READ to 6800:0000][PXENV_TFTP_CLOSE]
Then GRUB enters rescue mode with the message "error: no file name found".
I verified that it works with a vendor PXE rom. I will continue my
investigation tomorrow. Right now, I don't have any idea why GRUB is
unable to find/use the file it requested. If anyone has any thoughts,
please let me know.
Thanks
Thomas
Post by Paul Geraedts
Hello,
First of all, thanks for all the effort you all put in Etherboot/GPXE
(I've much enjoyed your Google Tech Talk Video). I recently started
using GPXE and it simply is a great tool! I already used various GPXE
features succesfully.
The one thing I can't seem to get to work though is the combination of
GPXE and the PXE version of GRUB2 (the latest v1.97 to be precise). I
followed the instructions on http://grub.enbug.org/PXEBOOT to build
the GRUB PXE image and used DNSmasq in Ubuntu (Karmic) to serve the
image to the client side (my laptop). It works with the build-in PXE
ROM in my laptop, but it doesn't seem to work with GPXE. (To be
precise: GRUB only wants to start in rescue mode in the latter case).
Am I doing something wrong, or is there some sort of incompatibility
between the two tools?
Any help on this is much appreciated.
Cheers, Paul
BTW, what does the G in GPXE actually stand for?
_______________________________________________
gPXE mailing list
gPXE at etherboot.org
http://etherboot.org/mailman/listinfo/gpxe
_______________________________________________
gPXE mailing list
gPXE at etherboot.org
http://etherboot.org/mailman/listinfo/gpxe
Stefan Hajnoczi
2009-11-06 06:29:42 UTC
Permalink
On Fri, Nov 6, 2009 at 12:52 AM, Thomas Miletich
Post by Thomas Miletich
I hope I'll have more luck tomorrow
Thanks for looking into this. Your updates are interesting.

Stefan
Thomas Miletich
2009-11-17 09:50:24 UTC
Permalink
Hi Paul
One of the GRUB developers, Vladimir 'phcoder' Serbinenko, pushed a
patch for this to the bazaar repository.

You can fetch it with
bzr branch http://bzr.savannah.gnu.org/r/grub/trunk/grub

You still have to disable Multiboot support in gPXE though. You could
also invalidate GRUB's Multiboot signature, by searching for
0x1BADB002 in a hex editor, and change it to something else, like
0x1BADB003, if you want to keep the multiboot support in gPXE.

Thomas
Post by Paul Geraedts
Hi Thomas,
Interpreted as a multiboot image, I surely didn't expect that. Great
that you figured it out.
The remaining part is definately interesting to say the least. I get
identical behavior over here. Currently I haven't got an idea about it
though, sorry. If so, I'll let you know.
Paul
P.S. I wasn't aware of the serial debugging feature: nice one.
Paul Geraedts
2010-01-10 12:02:50 UTC
Permalink
Hi Thomas,

I've tested it last week and I can confirm that it fully works on
OpenWrt 8.09.1 using Dnsmasq.

Thanks again,

Paul
Post by Marty Connor
Hi Paul
One of the GRUB developers, Vladimir 'phcoder' Serbinenko, pushed a
patch for this to the bazaar repository.
You can fetch it with
bzr branch http://bzr.savannah.gnu.org/r/grub/trunk/grub
You still have to disable Multiboot support in gPXE though. You could
also invalidate GRUB's Multiboot signature, by searching for
0x1BADB002 in a hex editor, and change it to something else, like
0x1BADB003, if you want to keep the multiboot support in gPXE.
Thomas
Post by Paul Geraedts
Hi Thomas,
Interpreted as a multiboot image, I surely didn't expect that. Great
that you figured it out.
The remaining part is definately interesting to say the least. I get
identical behavior over here. Currently I haven't got an idea about it
though, sorry. If so, I'll let you know.
Paul
P.S. I wasn't aware of the serial debugging feature: nice one.
Loading...