grub: directly load linked config file

While troubleshooting grub network boot issues,
I did some reading and found out our model of config
was technically wrong to use a menuentry to load config
in another menuentry which may or may not be loaded.

I mean it worked, but it is simpler to just say
"go source this content into our state".

Change-Id: I5e2ec2dc5110fa0a4f9e11478502a199354454f5
This commit is contained in:
Julia Kreger 2024-07-05 21:43:28 -07:00
parent 111466f782
commit 4d46bbf712
3 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,4 @@
set default=initial
set timeout=5
set hidden_timeout_quiet=false
echo Booting from $prefix
source {{ tftp_root }}/$net_default_mac.conf
menuentry "initial" {
configfile {{ tftp_root }}/$net_default_mac.conf
}

View File

@ -1248,7 +1248,7 @@ class TestPXEUtils(db_base.DbTestCase):
def write_to_file(path, contents):
self.assertIn('/grub/grub.cfg', path)
self.assertIn(
'configfile /tftpboot/$net_default_mac.conf',
'source /tftpboot/$net_default_mac.conf',
contents
)

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixes the default grub initial configuration to be simpler and directly
load the generated configuration file. The template also includes output
which also help operators understand the context as to where the node is
booting from, should issues be encountered.