diff options
-rwxr-xr-x | parabolaiso/mkparabolaiso | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index 0eb1831..719d703 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -555,7 +555,8 @@ _make_boot_uefi-x64.systemd-boot.esp() { _msg_info "Setting up systemd-boot for UEFI booting..." install -d -m 0755 -- "${isofs_dir}/EFI/parabolaiso" - efiboot_imgsize="$(( (( (( $(du --apparent-size -bc \ + # the required image size in KiB (rounded up to the next full MiB with an additional MiB for reserved sectors) + efiboot_imgsize="$(du -bc \ "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" \ "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" \ "${profile}/efiboot/" \ @@ -564,6 +565,7 @@ _make_boot_uefi-x64.systemd-boot.esp() { 2>/dev/null | awk 'END {print $1}') / 1048576 )) +1 )) * 1024 ))" # The FAT image must be created with mkfs.fat not mformat, as some systems have issues with mformat made images: # https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00099.html + _msg_info "Creating FAT image of size: ${efiboot_imgsize} KiB..." mkfs.fat -C -n PARABOLAISO_EFI "${isofs_dir}/EFI/parabolaiso/efiboot.img" "$efiboot_imgsize" mmd -i "${isofs_dir}/EFI/parabolaiso/efiboot.img" ::/EFI ::/EFI/BOOT @@ -596,7 +598,8 @@ _make_boot_uefi-x64.refind.esp() { _msg_info "Setting up rEFInd for UEFI booting..." install -d -m 0755 -- "${isofs_dir}/EFI/parabolaiso" - efiboot_imgsize="$(( (( (( $(du --apparent-size -bc \ + # the required image size in KiB (rounded up to the next full MiB with an additional MiB for reserved sectors) + efiboot_imgsize="$(du -bc \ "${airootfs_dir}/usr/share/refind/refind_x64.efi" \ "${airootfs_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" \ "${profile}/efiboot/" \ @@ -605,6 +608,7 @@ _make_boot_uefi-x64.refind.esp() { 2>/dev/null | awk 'END {print $1}') / 1048576 )) +1 )) * 1024 ))" # The FAT image must be created with mkfs.fat not mformat, as some systems have issues with mformat made images: # https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00099.html + _msg_info "Creating FAT image of size: ${efiboot_imgsize} KiB..." mkfs.fat -C -n PARABOLAISO_EFI "${isofs_dir}/EFI/parabolaiso/efiboot.img" "$efiboot_imgsize" mmd -i "${isofs_dir}/EFI/parabolaiso/efiboot.img" ::/EFI ::/EFI/BOOT |