grub does not fill in various variables pxe_default_* and net_default_*

Bug #1291900 reported by Thomas Schweikle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Booting grub over the network sets various variables (default server 172.18.1.1, gw 172.18.1.2):

pxe_default_server
net_default_ip
net_default_mac
net_default_server

After successfully booting grub over PXE (with grub upstream):
net_default_interface=efinet1
net_default_ip=172.18.1.209
net_default_mac=11:22:33:44:55:66
net_default_server=172.18.1.1
net_efinet1_boot_file=pxeboot.img
net_efinet1_ip=172.18.1.209
net_efinet1_mac=11:22:33:44:55:66
prefix=(tftp,172.18.1.1)/tftp
pxe_default_server=172.18.1.1
root=tftp,172.18.1.1

After successfully booting grub over PXE (with an older grub):
net_default_ip=172.18.1.209
net_default_mac=11:22:33:44:55:66
net_default_server=172.18.1.1
prefix=(tftp,172.18.1.1)/tftp
pxe_default_server=172.18.1.1
root=tftp,172.18.1.1

But using grub provided by Ubuntu 14.04:
net_default_ip=172.18.1.209
net_default_mac=
net_default_server=
pxe_default_server=
prefix=(tftp,172.18.1.1)/tftp
root=tftp,172.18.1.1

In turn booting from nfs with grub script:
 menuentry "Rescue 64-Bit" {
      recordfail
      set gfxpayload=$linux_gfx_mode
      set root='(pxe)'
      echo "loading kernel ..."
      linux (pxe)/rcd/isolinux/rescue64 vga=788 nfsboot=$net_default_server:/data/tftp/rcd
      echo "loading initrd ..."
      initrd (pxe)/rcd/isolinux/initram.igz
    }

Fails because the kernel tries to mount :/data/tftp/rcd

The same is for booting FreeBSD:
  menuentry "FreeBSD 10 ..." {
    echo "Loading kernel ..."
    recordfail
    set gfxpayload=$linux_gfx_mode
    set root='(pxe)'
    kfreebsd /freebsd/10/boot/kernel/kernel
    #
    echo "Loading device hints ..."
    kfreebsd_loadenv /freebsd/9/boot/device.hints
    #
    echo "Loading initrd ..."
    kfreebsd_module /freebsd/10/mfsroot.gz type=mfs_root
    #
    set kFreeBSD.vfs.root.mountfrom=nfs:$pxe_default_server:/data/tftp/freebsd/10
    set kFreeBSD.vfs.root.mountfrom.options=ro
    #
    set kFreeBSD.boot.nfsroot.server=$pxe_default_server
    set kFreeBSD.boot.netif.hwaddr=$net_pxe_mac
    set kFreeBSD.boot.netif.ip=$net_pxe_ip
    set kFreeBSD.boot.netif.netmask=255.255.255.0
    set kFreeBSD.boot.netif.gateway=$pxe_default_gateway
    set kFreeBSD.dhcp.host-name=$net_pxe_hostname
    set kFreeBSD.dhcp.routers=$pxe_default_gateway
    set kFreeBSD.boot.kspath=$ks_path
  }

Because all those unset variables lead to unset kernel-Variables. In tune FreeBSD loads the kernel, but can't continue, because it doesn't find the system to load.

Grub shall set these variables accordingly to what dhcp provides.
This seems fixed in upstream grub from gnu.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: grub2 (not installed)
ProcVersionSignature: Ubuntu 3.13.0-17.37-generic 3.13.6
Uname: Linux 3.13.0-17-generic x86_64
ApportVersion: 2.13.3-0ubuntu1
Architecture: amd64
Date: Thu Mar 13 10:56:30 2014
InstallationDate: Installed on 2014-01-31 (40 days ago)
InstallationMedia: Ubuntu-Server 13.10 "Saucy Salamander" - Release amd64 (20131016)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: Upgraded to trusty on 2014-01-31 (40 days ago)

Anders (eddiedog988)
Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Thomas Schweikle (tps) wrote :

The latest version of grub2 in Trusty (2.02~beta2-7) now does. Looks
like all is as expected after installing to my netboot directory:

grub-mknetdir --net-directory=/data/tftp

But an other error now: the directory isn't cleaned before it is
filled with stuff -- if you had an old grub version old files are
keppt. Maybe leading to crashes if you are loading modules not
available in the newer version, but in the older.

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

It renders essential functionality of the package (or a dependent one) broken.

Changed in grub2 (Ubuntu):
importance: Undecided → High
status: Confirmed → Triaged
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Thomas,

Please file a separate bug for cleaning the directory when running grub-mknetdir. This bug was about the variables when booting from the network.

I'm closing this bug as Fix Released since it was reportedly fixed by the version of grub2 in Trusty.

Changed in grub2 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.