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.
This commit is contained in:
nl6720 2024-05-07 14:22:42 +03:00
parent 1ae3ff6ff6
commit ead84ee9c0
No known key found for this signature in database
GPG key ID: 6B5387E670A955AD
2 changed files with 6 additions and 0 deletions

View file

@ -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
----------

View file

@ -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 \