Discussion:
GRUB netboot with HTTP download
Daniel Dehennin
2013-08-28 17:38:16 UTC
Permalink
Hello,

I try to setup a DHCP/TFTP/HTTP netboot but always get the rescue shell.

I start with grub-mknetdir:

/usr/sbin/grub-mknetdir --net-directory=tftp --subdir=grub --modules=http

I would like to make grub use HTTP to download files, so I modify the
grub image to include http and set the prefix:

grub-mkimage -d /usr/lib/grub/x86_64-efi -O x86_64-efi \
--output=tftp/grub/x86_64-efi/core.efi \
--prefix='(http,10.0.0.1)/grub' \
tftp http efinet

This result in the following:

error: no server is specified.
grub rescue> set
net_default_server=
prefix=(http,10.0.0.1)/grub
pxe_default_server=
root=http,10.0.0.1
grub rescue> ls
(hd0) (hd1)

The error message seems to come from grub-core/net/net.c[1] resulting of
a miss-match[2] of my “prefix”.

I looked for documentation on how to use grub modules but only found
explanation on PXE[3] and device syntax[4].

I should have done something wrong but I do not see what, any hints?

Regards.

Footnotes:
[1] http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/grub-core/net/net.c#L1279

[2] http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/grub-core/net/net.c#L1262

[3] https://www.gnu.org/software/grub/manual/grub.html#Network

[4] https://www.gnu.org/software/grub/manual/grub.html#Device-syntax
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF
Andrey Borzenkov
2013-08-31 05:11:32 UTC
Permalink
В Wed, 28 Aug 2013 19:38:16 +0200
Post by Daniel Dehennin
Hello,
I try to setup a DHCP/TFTP/HTTP netboot but always get the rescue shell.
Are you using current trunk?
Post by Daniel Dehennin
/usr/sbin/grub-mknetdir --net-directory=tftp --subdir=grub --modules=http
I would like to make grub use HTTP to download files, so I modify the
grub-mkimage -d /usr/lib/grub/x86_64-efi -O x86_64-efi \
--output=tftp/grub/x86_64-efi/core.efi \
--prefix='(http,10.0.0.1)/grub' \
tftp http efinet
error: no server is specified.
grub rescue> set
net_default_server=
prefix=(http,10.0.0.1)/grub
pxe_default_server=
root=http,10.0.0.1
grub rescue> ls
(hd0) (hd1)
The error message seems to come from grub-core/net/net.c[1] resulting of
a miss-match[2] of my “prefix”.
I looked for documentation on how to use grub modules but only found
explanation on PXE[3] and device syntax[4].
I should have done something wrong but I do not see what, any hints?
Regards.
[1] http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/grub-core/net/net.c#L1279
[2] http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/grub-core/net/net.c#L1262
[3] https://www.gnu.org/software/grub/manual/grub.html#Network
[4] https://www.gnu.org/software/grub/manual/grub.html#Device-syntax
Daniel Dehennin
2013-08-31 08:46:58 UTC
Permalink
Post by Andrey Borzenkov
В Wed, 28 Aug 2013 19:38:16 +0200
Post by Daniel Dehennin
Hello,
I try to setup a DHCP/TFTP/HTTP netboot but always get the rescue shell.
Are you using current trunk?
No, I'm using Debian sid 2.00-18.

I'll try to build the trunk and see if there is any difference.

Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF
Daniel Dehennin
2013-08-31 12:10:49 UTC
Permalink
Daniel Dehennin <***@baby-gnu.org> writes:


[...]
Post by Daniel Dehennin
Post by Andrey Borzenkov
Are you using current trunk?
No, I'm using Debian sid 2.00-18.
I'll try to build the trunk and see if there is any difference.
Hello,

I just build the trunk[1] and got the rescue too:

errror: destination unreachable.
Entering rescue mode...
grub rescue> set
net_default_ip=(null)
net_default_mac=(null)
net_default_server=
prefix=(http,10.0.0.1/grub
pxe_default_server=
root=http,10.0.0.1
grub rescue> ls
(hd0) (hd1)

NB: “make check” failed on 41 tests, tests suite log file attached.

Regards.


Footnotes:
[1] configure --enable-grub-mkfont --enable-mm-debug --with-platform=efi
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF
Andrey Borzenkov
2013-09-01 04:47:47 UTC
Permalink
В Sat, 31 Aug 2013 14:10:49 +0200
Post by Daniel Dehennin
[...]
Post by Daniel Dehennin
Post by Andrey Borzenkov
Are you using current trunk?
No, I'm using Debian sid 2.00-18.
I'll try to build the trunk and see if there is any difference.
Hello,
errror: destination unreachable.
Well, that looks "better". Now the problem is ...
Post by Daniel Dehennin
Entering rescue mode...
grub rescue> set
net_default_ip=(null)
net_default_mac=(null)
grub does not have any configured interface. Did you try to configure
it?

net_ls_cards will give you list of known NIC

net_add_addr ALIAS NIC ADDR

will configure address ADDR on card NIC. You can later refer to it
using ALIAS (e.g. to unconfigure it)

net_add_route ALIAS IP/MASK gw GATEWAY

will add route entry with name ALIAS to IP/MASK via GATEWAY
Post by Daniel Dehennin
net_default_server=
prefix=(http,10.0.0.1/grub
pxe_default_server=
root=http,10.0.0.1
grub rescue> ls
(hd0) (hd1)
NB: “make check” failed on 41 tests, tests suite log file attached.
Regards.
[1] configure --enable-grub-mkfont --enable-mm-debug --with-platform=efi
Andrey Borzenkov
2013-09-01 05:39:16 UTC
Permalink
В Sun, 1 Sep 2013 08:47:47 +0400
Post by Andrey Borzenkov
В Sat, 31 Aug 2013 14:10:49 +0200
Post by Daniel Dehennin
[...]
Post by Daniel Dehennin
Post by Andrey Borzenkov
Are you using current trunk?
No, I'm using Debian sid 2.00-18.
I'll try to build the trunk and see if there is any difference.
Hello,
errror: destination unreachable.
Well, that looks "better". Now the problem is ...
Post by Daniel Dehennin
Entering rescue mode...
grub rescue> set
net_default_ip=(null)
net_default_mac=(null)
grub does not have any configured interface. Did you try to configure
it?
net_ls_cards will give you list of known NIC
net_add_addr ALIAS NIC ADDR
will configure address ADDR on card NIC. You can later refer to it
using ALIAS (e.g. to unconfigure it)
net_add_route ALIAS IP/MASK gw GATEWAY
will add route entry with name ALIAS to IP/MASK via GATEWAY
You can also skip all of this and simply use

net_bootp NIC

to configure NIC using DHCP. You can also omit NIC to configure all
cards.
Post by Andrey Borzenkov
Post by Daniel Dehennin
net_default_server=
prefix=(http,10.0.0.1/grub
pxe_default_server=
root=http,10.0.0.1
grub rescue> ls
(hd0) (hd1)
NB: “make check” failed on 41 tests, tests suite log file attached.
Regards.
[1] configure --enable-grub-mkfont --enable-mm-debug --with-platform=efi
Loading...