[Bug 1923268] Re: grubnet default grub.cfg should try /grub/grub.cfg-${net_default_mac} before /grub/grub.cfg

Lee Trager 1923268 at bugs.launchpad.net
Fri Apr 23 17:35:24 UTC 2021


When MAAS gets the TFTP/HTTP request for grub.cfg it doesn't know what
the client architecture is.  MAAS identifies the machine based on the
requested URL. MAAS comes with a default grub.cfg[1] which tries loading
/grub/grub.cfg-${net_default_mac} and if that fails /grub/grub.cfg-
default-amd64. Machines which have been added to MAAS will match on
grub.cfg-${net_default_mac} which already has the architecture defined
in Postgres. During enlistment the machine is unknown so /grub/grub.cfg-
default-amd64 is used. /grub/grub.cfg-default-amd64 always returns the
kernel and initrd for AMD64.

This wasn't a problem previously on ARM64 because we were building an
unsigned GRUB which embedded a grub.cfg that tried
/grub/grub.cfg-${net_default_mac} then /grub/grub.cfg-default-arm64[2].

MAAS responds to the following:
1. grub/grub.cfg-<MAC> - MAC address in IEEE 802 colon-seperated format. There is a note in MAAS source that GRUB will only send MAC addresses in this format[1]. Due to this dash separated MAC is not supported.
2. grub/grub.cfg-default-<ARCH> - ARCH is a Debian architecture supported by MAAS(amd64, arm64, etc)
3. grub/grub.cfg - This simply tries 1 then 2.

While its possible to add support for other formats GRUB comes from the
MAAS stream. We can't force existing users to upgrade.

[1] https://git.launchpad.net/maas/tree/src/provisioningserver/boot/uefi_amd64.py?h=2.9#n22
[2] https://git.launchpad.net/maas-images/tree/conf/bootloaders.yaml?id=10c44123886a03f828ee19675164ced83928ba27#n46

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2-signed in Ubuntu.
https://bugs.launchpad.net/bugs/1923268

Title:
  grubnet default grub.cfg should try /grub/grub.cfg-${net_default_mac}
  before /grub/grub.cfg

Status in grub2-signed package in Ubuntu:
  Confirmed

Bug description:
  MAAS uses the signed network GRUB bootloader when a machine network
  boots on AMD64 and ARM64. The configuration MAAS produces depends on
  the machine which are identified by MAC address. The default grub.cfg
  in the boot loader downloads /grub/grub.cfg from the remote host. As
  that doesn't provide the MAC address MAAS provides a default
  configuration file:

  configfile /grub/grub.cfg-${net_default_mac}
  configfile /grub/grub.cfg-default-amd64

  There are two issues with this:

  1. This causes an additional unnecessary request.
  2. It is assumed an known machine is amd64.

  Can the default grub.cfg embedded in grubnet<arch>.efi be updated to

  configfile /grub/grub.cfg-${net_default_mac}
  configfile /grub/grub.cfg-default-<ARCH>
  configfile /grub/grub.cfg

  This would be similar to what PXELinux[1] does.

  [1] https://wiki.syslinux.org/wiki/index.php?title=PXELINUX

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2-signed/+bug/1923268/+subscriptions



More information about the foundations-bugs mailing list