From c714c3b1fee2e2d87d4770ac3ef1e033780da29f Mon Sep 17 00:00:00 2001 From: Yoann Congal Date: Fri, 27 Dec 2024 14:17:06 +0100 Subject: [PATCH] fai-cd: arm64 iso build support Leverage existing work in progress arm64 support to build a working ISO. NB: This work comes from the SEAPATH project: https://github.com/seapath/build_debian_iso/pull/121 Co-authored-by: Florent CARLI Signed-off-by: Yoann Congal --- bin/fai-cd | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/bin/fai-cd b/bin/fai-cd index 1d20394a8..136949232 100755 --- a/bin/fai-cd +++ b/bin/fai-cd @@ -222,11 +222,11 @@ create_grub2_image_arm64() { --output=/tmp/grubaa64.efi \ --locales="" \ "boot/grub/grub.cfg=/tmp/grub.cfg" - mv $NFSROOT/tmp/grubaa64.efi $scratch + mv $NFSROOT/tmp/grubaa64.efi $scratch/BOOTAA64.EFI mkfs.vfat -C $scratch/efiboot.img 6000 >/dev/null - mmd -i $scratch/efiboot.img efi efi/boot - mcopy -i $scratch/efiboot.img $scratch/grubaa64.efi ::efi/boot/ + mmd -i $scratch/efiboot.img EFI EFI/boot + mcopy -i $scratch/efiboot.img $scratch/BOOTAA64.EFI ::EFI/boot/ else die 11 "No grub-efi-arm64-bin installation found in NFSROOT. Aborting." fi @@ -405,6 +405,25 @@ mkiso_x86() { unhide_dirs } # - - - - - - - - - - - - - - - - - - - - - - - - - - +mkiso_arm64() { + + echo "Writing FAI CD-ROM image to $isoname. This may need some time." + cp $scratch/efiboot.img $tmp/boot/grub/efi.img + xorriso -as mkisofs -r \ + -volid "$vname" -appid "$aname" \ + -J -joliet-long \ + -e boot/grub/efi.img -no-emul-boot \ + -append_partition 2 0xef $scratch/efiboot.img \ + -partition_cyl_align all \ + "$tmp" \ + -o $isoname \ + || die 12 "xorriso failed." + + echo -n "ISO image size and filename: "; du -h $isoname + + unhide_dirs +} +# - - - - - - - - - - - - - - - - - - - - - - - - - - addmirror() { [ $nomirror -eq 1 ] && return