aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2024-05-07 13:59:30 +0300
committernl6720 <nl6720@gmail.com>2024-05-13 09:30:14 +0300
commit1ae3ff6ff613ef40f97593bf0ae7c4b1798a2b38 (patch)
treebc1e859196cc22d9e6429bcdfe756eaa716ea2bc
parent2febfabd6c9fc2d1915f5cc5c0fb6924e02bce2e (diff)
downloadarchiso-1ae3ff6ff613ef40f97593bf0ae7c4b1798a2b38.tar.gz
archiso-1ae3ff6ff613ef40f97593bf0ae7c4b1798a2b38.tar.bz2
mkarchiso: increase the additional free space added to efiboot.img
Less than 1 MiB (but rounded up to one) is needed to account for file and directory entries, especially when using FAT32. Otherwise the ISO build could stop with: Disk full The rest of the increase is to allow more space for adding custom files after the fact, i.e. when repacking the ISO. E.g. for the purposes of adding a signed boot loader for Secure Boot or similar. See https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot#ISO_repacking
-rw-r--r--CHANGELOG.rst3
-rwxr-xr-xarchiso/mkarchiso10
2 files changed, 6 insertions, 7 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index f3a2d54..c6421f7 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -14,6 +14,9 @@ Changed
- Moved the ``pkglist.x86_64.txt`` file outside the bootstrap tarball's ``root.x86_64`` directly to avoid polluting the
root file system.
- Use 4 MiB OVMF files in ``run_archiso`` instead of the old 2 MiB ones.
+- Increase the additional free space of the EFI partition size from 1 MiB to 8 MiB to account for file system overhead
+ when using FAT32 (needs less than 1 MiB) and to give more space for adding custom files when repacking an ISO (e.g.
+ when preparing it for Secure Boot).
Deprecated
----------
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index cd00c9d..63cad81 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -528,17 +528,13 @@ _make_efibootimg() {
local imgsize_kib="0"
local imgsize_bytes=${1}
- if (( imgsize_bytes < 2*1024*1024 )); then
- _msg_info "Validating '${bootmode}': efiboot.img size is ${imgsize_bytes} bytes is less than 2 MiB! Bumping up to 2 MiB"
- imgsize_bytes=$((2*1024*1024))
- fi
-
- # Convert from bytes to KiB and round up to the next full MiB with an additional MiB for reserved sectors.
+ # Convert from bytes to KiB and round up to the next full MiB with an additional 8 MiB for reserved sectors, file
+ # and directory entries and to allow adding custom files when repacking the ISO.
imgsize_kib="$(
awk 'function ceil(x){return int(x)+(x>int(x))}
function byte_to_kib(x){return x/1024}
function mib_to_kib(x){return x*1024}
- END {print mib_to_kib(ceil((byte_to_kib($1)+1024)/1024))}' <<<"${imgsize_bytes}"
+ END {print mib_to_kib(ceil((byte_to_kib($1)+8192)/1024))}' <<<"${imgsize_bytes}"
)"
# 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