From 81cf17360e4b3acf3dcc272e561d3dad84b1892f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 13 Jul 2026 09:59:15 -0400 Subject: [PATCH] arm64 boot assets pick up --- imgutil/imgutil | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/imgutil/imgutil b/imgutil/imgutil index 284ba700..28f9e4c5 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -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'))