Repository navigation
Make the hybrid ISO in one native xorriso run (MX/Debian) - #55
Conversation
src/work.cpp, createIso(), MX/Debian paths (isolinux and --grub-mbr): the xorriso call is a list of native xorriso commands (commented, same as build-iso's make_xorriso_iso), passed via bash "$@" - no shell parsing of paths, umask 022 kept. One run makes the hybrid ISO: - isolinux: isohdpfx.bin MBR (package isolinux) + efi.img as GPT/MBR EFI partition (before: separate "isohybrid --uefi" run) - --grub-mbr: GRUB's boot_hybrid.img from the template (same GRUB build as its eltorito.img) + efi.img appended as EFI partition. Before there was no GRUB MBR at all (BIOS from USB could not work) and isohybrid ran on a GRUB image it does not know. - partition 1 starts at 32 KiB (partition_offset 16), MBR type 0x00 - as Debian's ISOs; fdisk/parted show a clean table - Intel Macs (HFS+, APM, blessed boot.efi) automatically when the template carries System/Library/CoreServices/boot.efi The isohybrid step only runs as fallback when isohdpfx.bin is missing. "Make isohybrid" off: plain ISO as before. Arch path unchanged. debian/control: + isolinux (Depends). Tested: the same xorriso argument list on a split tree like mx-snapshot uses (iso-template + iso-2/antiX/linuxfs), November 2026 ISO + new boot set: QEMU BIOS, UEFI, UEFI Secure Boot, 32-bit UEFI; DVD and USB; menus everywhere; desktop reached. A real snapshot run needs root (to do).
AdrianTM
left a comment
There was a problem hiding this comment.
Note: This review was written and posted by Claude (Claude Code, an AI assistant) for the account owner. It covers c0f7f40 compared with 43d70b0.
Thanks for moving the hybrid step into a single xorriso run. It fixes GRUB mode with make_isohybrid on: the old path always failed in isohybrid ("boot loader does not have an isolinux.bin hybrid signature"). I tested with xorriso 1.5.6 and the mx-iso-template 26.11.2mx25+1 template. A few issues:
1. A Mac template without .disk_label makes xorriso abort.
The Mac block checks only for boot.efi, then always runs -find /System/Library/CoreServices/.disk_label -exec set_hfs_crtp .... If boot.efi exists and .disk_label doesn't, xorriso exits with code 5:
xorriso : FAILURE : Cannot find path '/System/Library/CoreServices/.disk_label' in loaded ISO image
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
The current MX templates have no System/ directory, so this can't happen today. It only affects custom or other-distro templates. Suggested fix: add the .disk_label -find/-exec pair only when QFileInfo::exists(templateDir + "/System/Library/CoreServices/.disk_label").
2. With make_isohybrid=no, Mac files still add HFS+ and an Apple Partition Map.
The Mac block ignores makeIsohybrid. With Mac files and hybrid off, both the ISOLINUX and the GRUB image get a system area holding an APM with an HFSPLUS_Hybrid / Apple_HFS partition. The old commands produced no system area in that configuration on either path. Since an APM is a partition table, I'd put the Mac block under if (settings->makeIsohybrid), unless HFS+ on a plain ISO is intended. If it is intended, a comment saying so would help.
3. The xorriso dependency floor is too low.
-boot_image any iso_mbr_part_type= arrived in libisoburn 1.4.8 (upstream ChangeLog: "New -boot_image bootspec iso_mbr_part_type="). Both binary stanzas in debian/control still say xorriso (>= 1.4.6). Please change both to xorriso (>= 1.4.8). I checked this against the changelog, not a 1.4.6 binary. In practice only stretch-era systems are affected.
4. In the ISOLINUX hybrid image, the backup GPT header is not at the end of the file.
I compared the GPT header's alternate LBA with the file size:
| Image | Backup GPT header |
|---|---|
old (mkisofs + isohybrid --uefi) |
last sector |
| this PR | 640 sectors before EOF |
-padding included only |
40 before EOF |
no_emul_toc only |
600 before EOF |
| both | last sector |
This shouldn't stop the image from booting. Once the image is written to a USB stick larger than itself, the backup header isn't at the end of the device in either version. It does make partitioning tools warn when they inspect the .iso itself. Suggested fix: add -padding included and change the compliance rule to -compliance iso_9660_level=3:no_emul_toc. no_emul_toc also matches what the old -as mkisofs command did.
Nit: when boot_hybrid.img is missing in GRUB mode, the warning says "no BIOS boot from USB", but hybridDone stays false. The code then falls back to isohybrid, which fails on a GRUB image and stops the build with the "Could not make the ISO hybrid" dialog. The old code did the same, so this isn't a regression. Either make the warning say so, or skip isohybrid in GRUB mode.
🤖 Generated with Claude Code
- Mac files: add the .disk_label -find/-exec only when the file exists (xorriso aborted with "Cannot find path" when a template had boot.efi but no .disk_label). - Mac files only with "make isohybrid": HFS+ brings an Apple Partition Map, so a plain ISO (make_isohybrid=no) stays without a system area, as before. - -compliance iso_9660_level=3:no_emul_toc and -padding included: the backup GPT header is now in the last sector of the ISO file (as with isohybrid before); no_emul_toc as the old -as mkisofs command did. - debian/control: xorriso (>= 1.4.8) - iso_mbr_part_type= is new in libisoburn 1.4.8. - GRUB mode without boot_hybrid.img: skip isohybrid (it only knows isolinux.bin and stopped the build); the warning says the ISO then boots from DVD only.
|
Thanks for the careful review - all points confirmed and fixed in the new commit.
Nit: in GRUB mode without Tested without root: the exact xorriso argument list for isolinux/GRUB, hybrid on/off, with/without Mac files and |
src/work.cpp, createIso(), MX/Debian paths (isolinux and --grub-mbr): the xorriso call is a list of native xorriso commands (commented, same as build-iso's make_xorriso_iso), passed via bash "$@" - no shell parsing of paths, umask 022 kept. One run makes the hybrid ISO:
Tested: the same xorriso argument list on a split tree like mx-snapshot uses (iso-template + iso-2/antiX/linuxfs), November 2026 ISO + new boot set: QEMU BIOS, UEFI, UEFI Secure Boot, 32-bit UEFI; DVD and USB; menus everywhere; desktop reached. A real snapshot run needs root (to do).