2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Write multiple grub.cfg paths

Some have different requirements on how to find grub.cfg
This commit is contained in:
Jarrod Johnson 2024-07-12 15:52:49 -04:00
parent 8c193fe33f
commit 08a5bffa90

View File

@ -158,7 +158,7 @@ def find_glob(loc, fileglob):
for cdir, _, fs in os.walk(loc):
for f in fs:
if fnmatch(f, fileglob):
return os.path.join(cdir, f)
return [os.path.join(cdir, f)]
return None
@ -182,9 +182,13 @@ def update_boot_linux(profiledir, profile, label):
# well need to honor grubprefix path if different
grubcfgpath = find_glob(profiledir + '/boot', 'grub.cfg')
if not grubcfgpath:
grubcfgpath = profiledir + '/boot/efi/boot/grub.cfg'
with open(grubcfgpath, 'w') as grubout:
grubout.write(grubcfg)
grubcfgpath = [
profiledir + '/boot/efi/boot/grub.cfg'
profiledir + '/boot/boot/grub.cfg'
]
for grubcfgpth in grubcfgpath:
with open(grubcfgpth, 'w') as grubout:
grubout.write(grubcfg)
ipxeargs = kernelargs
for initramfs in initrds:
ipxeargs += " initrd=" + initramfs