Skip to content

Support GRUB 2 BIOS + replace mbrldr/mbrmgr with syslinux MBR#104

Merged
mika merged 6 commits intomasterfrom
mika/rework
Mar 13, 2026
Merged

Support GRUB 2 BIOS + replace mbrldr/mbrmgr with syslinux MBR#104
mika merged 6 commits intomasterfrom
mika/rework

Conversation

@mika
Copy link
Member

@mika mika commented Mar 13, 2026

Continuing from #98 + #99:

  • grml2usb: replace mbrldr/mbrmgr with syslinux MBR
  • grml2iso: various cleanups
  • grml2iso: drop xorriso version check
  • grml2iso: drop mkisofs/genisoimage support, require xorriso
  • grml2iso: use GRUB for BIOS boot, support ISOs without syslinux
  • grml2usb: use GRUB for BIOS boot, support ISOs without syslinux

@github-actions
Copy link

📦 Built packages are ready! Download here.

@mika mika mentioned this pull request Mar 13, 2026
@mika mika requested a review from zeha March 13, 2026 09:24
@zeha zeha closed this Mar 13, 2026
@zeha zeha reopened this Mar 13, 2026
@zeha
Copy link
Member

zeha commented Mar 13, 2026

close/reopened to rerun tests

@github-actions
Copy link

📦 Built packages are ready! Download here.

@github-actions
Copy link

📦 Built packages are ready! Download here.

mika added 6 commits March 13, 2026 11:43
Modern Grml ISOs no longer ship isolinux/syslinux files and use GRUB
for both BIOS and EFI boot.

Update grml2usb to handle this:

- Auto-detection now prefers GRUB over syslinux (if grub-install is available)
- GRUB installs directly to MBR for simpler + more reliable BIOS boot
- Skip legacy mbrldr chainloader when using GRUB
- Detect arm64 ISOs by flavour name and auto-switch to EFI-only mode
- Gracefully fall back when syslinux files (logo.16) are missing:
  - To GRUB if grub-install is available
  - To EFI-only mode otherwise
- Deprecate --grub-mbr option (GRUB now always uses MBR)

Backwards compatibility:

- ISOs with syslinux files still work (--bootloader=syslinux)
- Explicit --bootloader= options are honored
- All existing command-line options remain functional

Support matrix:

  Host    | ISO   | ISO has syslinux | Result
  --------|-------|------------------|---------------------------
  amd64   | amd64 | yes              | GRUB BIOS+EFI (or syslinux if requested)
  amd64   | amd64 | no               | GRUB BIOS+EFI
  amd64   | arm64 | no               | EFI-only (auto-detected)
  arm64   | amd64 | yes/no           | EFI-only (BIOS N/A on arm64 host)
  arm64   | arm64 | no               | EFI-only

See grml/grml-live#483
Recent Grml ISOs no longer ship isolinux/syslinux, as we switched to
GRUB also for BIOS boot.

Update grml2iso to create hybrid-bootable ISOs using GRUB for BIOS boot
when isolinux is unavailable:

- Detect available boot method after grml2usb populates the work directory
- On arm64 hosts: prefer GRUB over isolinux (isohybrid unavailable)
- Fall back to EFI-only boot with helpful warning if BIOS boot impossible
- Check source ISO for GRUB boot images before attempting generation
- Look for boot.img in ISO first, then system paths for hybrid MBR
- Support three BIOS boot methods:
  1. isolinux (if syslinux files present and not on arm64 host)
  2. GRUB (using existing eltorito.img/cdboot.img from source ISO)
  3. GRUB (generating eltorito.img if i386-pc modules available)

Backwards compatibility:

- ISOs with syslinux files work unchanged on x86 hosts
- Older ISOs with isolinux still produce isolinux-based output ISOs

Support matrix:

  Host   | Source ISO     | syslinux | GRUB BIOS imgs | Output ISO boots via
  -------|----------------|----------|----------------|----------------------
  amd64  | amd64 (old)    | yes      | -              | isolinux BIOS + EFI
  amd64  | amd64 (new)    | no       | yes            | GRUB BIOS + EFI
  amd64  | amd64 (new)    | no       | no             | GRUB BIOS + EFI (generated)
  amd64  | arm64          | no       | no             | EFI-only
  arm64  | amd64 (old)    | yes      | yes            | GRUB BIOS + EFI (from ISO)
  arm64  | amd64 (old)    | yes      | no             | EFI-only (warning)
  arm64  | amd64 (new)    | no       | yes            | GRUB BIOS + EFI (from ISO)
  arm64  | amd64 (new)    | no       | no             | EFI-only (warning)
  arm64  | arm64          | no       | no             | EFI-only

Note: "GRUB BIOS imgs" means eltorito.img or cdboot.img + boot.img in ISO

See grml/grml-live#483
xorriso is required for GRUB-based and UEFI boot support added
recently, making the mkisofs/genisoimage fallback paths largely
non-functional. Simplify by requiring xorriso unconditionally.
xorriso 1.1.6 is ancient (2011), so no need to check for it any longer.
This also allows us to drop the check on UEFI_ENABLE, which is no longer
needed.
- Remove duplicate VERSION in param loop
- Remove extra closing brace in fold marker
- Remove now redundant "Using xorriso" output
- Remove redundant USE_GRUB=false assignment after it's no longer used
- Remove unused ADD_OPTS variable
- Replace $(($OPTIND - 1)) spacing with $(( OPTIND - 1 ))
- Replace [ -e X -a ! -n Y ] and [ ! -z X ] with modern equivalents
- Replace [ ! -n ] with [ -z ]
- Replace `which` with `command -v`
- Update Grml ISO name (having also new file naming schema)
The MirBSD-derived mbrldr/mbrmgr binaries offer no functional
advantage over the syslinux MBR. Replace them with automatic
syslinux MBR discovery (checking the same paths previously used
by --syslinux-mbr), removing the need for a bundled MBR binary.

Note that syslinux-common ships the mbr.bin file as
/usr/lib/syslinux/mbr/mbr.bin nowadays, so added this path to
our mbr_locations where to look for syslinux mbr files.

FTR:

- Remove mbr directory
- Always use syslinux MBR when bootloader is syslinux
- Remove ismirbsdmbr logic from install_mbr, always use the
  standard active partition flag (0x80)
- Deprecate --syslinux-mbr and --mbr-menu as no-ops with warnings
  to preserve backwards compatibility
- Drop now no longer needed dependency on nasm
- Update Makefile, docs, debian/, tarball.sh + github workflow files
  accordingly
@github-actions
Copy link

📦 Built packages are ready! Download here.

@mika mika merged commit 9c60c7f into master Mar 13, 2026
8 checks passed
@mika mika deleted the mika/rework branch March 13, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants