2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-21 16:39:32 +00:00

arm64 boot assets pick up

This commit is contained in:
Jarrod Johnson
2026-07-13 09:59:15 -04:00
parent 7babc503c3
commit 81cf17360e
+13 -2
View File
@@ -1674,10 +1674,14 @@ async def pack_image(args):
pass
def gather_bootloader(outdir, rootpath='/'):
shimdestfilename = 'BOOTX64.EFI'
grubdestfilename = 'grubx64.efi'
shimlocation = os.path.join(rootpath, 'boot/efi/EFI/BOOT/BOOTX64.EFI')
if not os.path.exists(shimlocation):
shimlocation = os.path.join(rootpath, 'boot/efi/EFI/BOOT/BOOTAA64.EFI')
shimdestfilename = os.path.basename(shimlocation)
if not os.path.exists(shimlocation):
shimdestfilename = 'BOOTX64.EFI'
shimlocation = os.path.join(rootpath, 'usr/lib64/efi/shim.efi')
if not os.path.exists(shimlocation):
shimlocation = os.path.join(rootpath, 'usr/lib/shim/shimx64.efi.signed.latest')
@@ -1686,13 +1690,19 @@ def gather_bootloader(outdir, rootpath='/'):
if not os.path.exists(shimlocation):
shimlocation = os.path.join(rootpath, 'usr/lib/shim/shimaa64.efi.signed.latest')
mkdirp(os.path.join(outdir, 'boot/efi/boot'))
shutil.copyfile(shimlocation, os.path.join(outdir, 'boot/efi/boot/BOOTX64.EFI'))
shutil.copyfile(shimlocation, os.path.join(outdir, 'boot/efi/boot/{0}'.format(shimdestfilename)))
for maybemokmanager in glob.glob(os.path.join(rootpath, 'boot/efi/EFI/*/mmx64.efi')):
shutil.copyfile(maybemokmanager, os.path.join(outdir, 'boot/efi/boot/mmx64.efi'))
break
else:
if os.path.exists(os.path.join(rootpath, 'usr/lib/shim/mmx64.efi')):
shutil.copyfile(os.path.join(rootpath, 'usr/lib/shim/mmx64.efi'), os.path.join(outdir, 'boot/efi/boot/mmx64.efi'))
for maybemokmanager in glob.glob(os.path.join(rootpath, 'boot/efi/EFI/*/mmaa64.efi')):
shutil.copyfile(maybemokmanager, os.path.join(outdir, 'boot/efi/boot/mmaa64.efi'))
break
else:
if os.path.exists(os.path.join(rootpath, 'usr/lib/shim/mmaa64.efi')):
shutil.copyfile(os.path.join(rootpath, 'usr/lib/shim/mmaa64.efi'), os.path.join(outdir, 'boot/efi/boot/mmaa64.efi'))
grubbin = None
for candidate in glob.glob(os.path.join(rootpath, 'boot/efi/EFI/*')):
if 'BOOT' not in candidate:
@@ -1701,6 +1711,7 @@ def gather_bootloader(outdir, rootpath='/'):
break
grubbin = os.path.join(candidate, 'grubaa64.efi')
if os.path.exists(grubbin):
grubdestfilename = os.path.basename(grubbin)
break
if not grubbin:
grubbin = os.path.join(rootpath, 'usr/lib64/efi/grub.efi')
@@ -1717,7 +1728,7 @@ def gather_bootloader(outdir, rootpath='/'):
mkdirp(os.path.join(outdir, 'boot/EFI/ubuntu/'))
with open(os.path.join(outdir, 'boot/EFI/ubuntu/grub.cfg'), 'w') as wo:
wo.write('')
shutil.copyfile(grubbin, os.path.join(outdir, 'boot/efi/boot/grubx64.efi'))
shutil.copyfile(grubbin, os.path.join(outdir, 'boot/efi/boot/{0}'.format(grubdestfilename)))
shutil.copyfile(grubbin, os.path.join(outdir, 'boot/efi/boot/grub.efi'))