mirror of
https://github.com/xcat2/confluent.git
synced 2026-08-03 16:07:00 +00:00
Adjust to EL10 grub stub cfg
The syntax changed, make the code more adaptive to a variety of situations.
This commit is contained in:
@@ -280,8 +280,10 @@ def fixup(rootdir, vols):
|
||||
with open(rgcfg, 'r') as gin:
|
||||
tgrubcfg = gin.read()
|
||||
tgrubcfg = tgrubcfg.split('\n')
|
||||
if 'search --no-floppy --fs-uuid --set=dev' in tgrubcfg[0]:
|
||||
tgrubcfg[0] = 'search --no-floppy --fs-uuid --set=dev ' + bootuuid
|
||||
if tgrubcfg[0].startswith('search') and '--set=dev' in tgrubcfg[0]:
|
||||
searchparts = tgrubcfg[0].split()
|
||||
searchparts[-1] = bootuuid
|
||||
tgrubcfg[0] = ' '.join(searchparts)
|
||||
with open(rgcfg, 'w') as gout:
|
||||
for gcline in tgrubcfg:
|
||||
gout.write(gcline)
|
||||
|
||||
Reference in New Issue
Block a user