From 097fbbc82a041b136c0acd3f0afa3bae9e238b25 Mon Sep 17 00:00:00 2001 From: Elmar Pruesse Date: Wed, 3 Jul 2024 15:22:14 -0600 Subject: [PATCH 1/2] Fix grub asset key handling Signed-off-by: Elmar Pruesse --- etc/grub/chainload.ww | 5 +++-- etc/grub/grub.cfg.ww | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/etc/grub/chainload.ww b/etc/grub/chainload.ww index dc3c51d8..7622a1b7 100644 --- a/etc/grub/chainload.ww +++ b/etc/grub/chainload.ww @@ -5,14 +5,15 @@ echo "================================================================================" echo "Warewulf v4 now iXPE booting with grub" echo "================================================================================" +smbios --type 3 --get-string 8 --set assetkey set timeout=2 # Must chainload in order to get kernel args for specific node menuentry "Load specific configfile" { - conf="(http,{{.Ipaddr}}:{{.Warewulf.Port}})/efiboot/grub.cfg" + conf="(http,{{.Ipaddr}}:{{.Warewulf.Port}})/efiboot/grub.cfg?assetkey=${assetkey}" configfile $conf } menuentry "Chainload shim of container" { - shim="(http,{{.Ipaddr}}:{{.Warewulf.Port}})/efiboot/shim.efi" + shim="(http,{{.Ipaddr}}:{{.Warewulf.Port}})/efiboot/shim.efi?assetkey=${assetkey}" chainloader ${shim} } menuentry "UEFI Firmware Settings" --id "uefi-firmware" { diff --git a/etc/grub/grub.cfg.ww b/etc/grub/grub.cfg.ww index aff280a9..2a38c87e 100644 --- a/etc/grub/grub.cfg.ww +++ b/etc/grub/grub.cfg.ww @@ -6,7 +6,7 @@ echo echo "Warewulf Controller: {{.Ipaddr}}" echo sleep 1 -smbios --type1 --get-string 8 --set assetkey +smbios --type 3 --get-string 8 --set assetkey uri="(http,{{.Ipaddr}}:{{.Port}})/provision/${net_default_mac}?assetkey=${assetkey}" kernel="${uri}&stage=kernel" @@ -70,7 +70,7 @@ menuentry "Network boot node with dracut: {{.Id}}" --id dracut { } menuentry "Chainload specific configfile" { - conf="(http,{{.Ipaddr}}:{{.Port}})/efiboot/grub.cfg" + conf="(http,{{.Ipaddr}}:{{.Port}})/efiboot/grub.cfg?assetkey=${assetkey}" configfile $conf } From 3576b1d061586906b29f54a4249d580d667d50ae Mon Sep 17 00:00:00 2001 From: Elmar Pruesse Date: Wed, 3 Jul 2024 15:40:16 -0600 Subject: [PATCH 2/2] Update contributors and changelog Signed-off-by: Elmar Pruesse --- CHANGELOG.md | 2 ++ CONTRIBUTORS.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a28e1b7..c39f315e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). on unused/unmanaged network interfaces. - Systems with no SMBIOS (Raspberry Pi) will create a UUID from `/sys/firmware/devicetree/base/serial-number` +- Grub chainload and main configs correctly extract smbios asset key + for node authentication - Replace slice in templates with sprig substr. #1093 - Fix an invalid format issue for the GitHub nightly build action. #1258 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index cfa9774f..b804d818 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -37,4 +37,4 @@ * Tobias Ribizel * Tobias Poschwatta * Josh Burks -* Elmar Pruessee +* Elmar Pruesse @epruesse