aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2024-05-07 14:22:42 +0300
committernl6720 <nl6720@gmail.com>2024-05-18 11:32:09 +0300
commitead84ee9c0d91bf13385f7e6727e6b95444b5f3f (patch)
tree804e48ad6f76f16738463d86e03d90ef4bf8fac1
parent1ae3ff6ff613ef40f97593bf0ae7c4b1798a2b38 (diff)
downloadarchiso-ead84ee9c0d91bf13385f7e6727e6b95444b5f3f.tar.gz
archiso-ead84ee9c0d91bf13385f7e6727e6b95444b5f3f.tar.bz2
mkarchiso: do not pad the ISO when it is not necessary
If the ISO exceeds the max size of a CD (900 MiB), the 300 KiB padding needed for CDs can be removed.
-rw-r--r--CHANGELOG.rst1
-rwxr-xr-xarchiso/mkarchiso5
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index c6421f7..b1ccb5d 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -17,6 +17,7 @@ Changed
- 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).
+- Remove 300 KiB padding needed for CDs if the ISO exceeds the maximum size of a CD.
Deprecated
----------
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index 63cad81..f55731e 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -1735,6 +1735,11 @@ _build_iso_image() {
typeset -f "_add_xorrisofs_options_${bootmode}" &>/dev/null && "_add_xorrisofs_options_${bootmode}"
done
+ # Remove 300 KiB padding needed for CDs if the ISO exceeds the max size of a CD
+ if (( $(du -s --apparent-size -B1M "${isofs_dir}/" | awk '{ print $1 }') > 900 )); then
+ xorrisofs_options+=('-no-pad')
+ fi
+
rm -f -- "${out_dir}/${image_name}"
_msg_info "Creating ISO image..."
xorriso "${xorriso_options[@]}" -as mkisofs \