FAT image (efiboot.img) size should be precalculated not hardcoded
mkarchiso creates efiboot.img
with the exact size of 64 MiB (65536 KiB).
This causes issues if one wants to compress initramfs with something other than xz, or have more than one kernel installed, as there is not enough space; see https://aur.archlinux.org/packages/archiso-git#comment-762790 . And in case the included files are smaller than the FAT image size, the additional space is wasted and just bloats the ISO.
I would be better to sum up the file sizes of all files that will be included in the FAT image and create the FAT image from the size rounded up to the next MiB. The included directories and files are:
${profile}/efiboot/loader/
${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi
${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi
${airootfs_dir}/boot/vmlinuz-*
-
${airootfs_dir}/boot/archiso.img
or (${airootfs_dir}/boot/initramfs-*.img
with !74 (merged)) ${airootfs_dir}/boot/intel-ucode.img
${airootfs_dir}/boot/amd-ucode.img