Skip to content

Add support for >4GB ISO by optionally supporting a second partition. Plus other small improvements.#131

Open
cshandley-uk wants to merge 23 commits intothias:masterfrom
cshandley-uk:DualPartitionSupport
Open

Add support for >4GB ISO by optionally supporting a second partition. Plus other small improvements.#131
cshandley-uk wants to merge 23 commits intothias:masterfrom
cshandley-uk:DualPartitionSupport

Conversation

@cshandley-uk
Copy link
Copy Markdown

@cshandley-uk cshandley-uk commented Feb 19, 2025

Like many people, I've been desperately looking for something to replace Ventoy (due to it's huge number of mystery binary blobs, opaque build process & foreign origin), and GLIM came really close - it just didn't support ISOs >4GB. I've been able to solve that major limitation by adding support for a second partition that uses (say) Ext4. I've tried to keep to the style of your source code, made my changes as small as possible, and split the changes into small commits so you easily see what I've done & why.

I have also made some other small improvements which I hope you won't object to:

  • Detect if GPT (rather than MBR) is used, and warn that GRUB requires an extra BIOS Boot Partition for the non-EFI case.
  • Made BIOS installation optional if you pick EFI, in case you don't have a BIOS Boot Partition.
  • When using a single partition, the ISO folder has been moved from boot/iso/ to just iso/, so it's in the same location whether you use one or two partitions (simplifies documentation & code), as well as IMHO being easier for newbies to find.
  • Made "Ready to install GLIM" default to "No", so you can't accidentally proceed if you are just pressing enter without reading the prompts.
  • Made the Y/N prompts case insensitive.
  • Warn rather than error if there are more than 2 partitions on the block device. (My use case is having bootable ISOs on my external backup HD, so I can boot & restore all from one device - Ventoy allows that sort of thing. Plus the BIOS Boot Partition.)
  • Halt if there are multiple GLIM partitions, since it seems asking for trouble if just randomly pick one!
  • Added quoting so it can handle the spaces in $USBMNT, just in case of weird systems.

I've tested all these changes as much as I can, on a real physical machine (no VM).

…g default from Y to N, and putting a blank line before it. Allow all Y/N answers to be case insensitive.
…alling EFI without BIOS in case they don't have a BIOS Boot Partition.
…ther than silently failing). Ensure sensible behaviour if fdisk has unexpected output.
…extra BIOS Boot partition if installing for BIOS.
…not even clear if the pull request will be accepted. Also add two commented-out lines to add LVM & BTRFS support.
Comment on lines 30 to +55
probe --set rootuuid --fs-uuid $root

# Detect which partition the ISOs are stored on
set isopath=/iso
insmod part_msdos
insmod part_gpt
insmod exfat
insmod ext2
insmod ntfs
#insmod btrfs
#insmod lvm
insmod regexp
echo "Boot partition: ${root}"
#set hdnum=0
regexp --set 1:hdnum "^hd([0-9]+),.*" "${root}"
echo "Boot disk: hd${hdnum}"
for pnum in 0 1 2 3 4 5 6 7 8 9; do
if [ -e (hd${hdnum},gpt${pnum})${isopath} ]; then
set root="(hd${hdnum},gpt${pnum})"
break
elif [ -e (hd${hdnum},msdos${pnum})${isopath} ]; then
set root="(hd${hdnum},msdos${pnum})"
break
fi
done
echo "ISO partition: ${root}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I installed this and noticed that you need to run probe --set rootuuid --fs-uuid $root again after updating root so Arch Linux can boot. This is because Arch tries to copy the iso to memory and fails to find the iso if the uuid is not updated. After this patch, it seems to run just fine.

@ngaro
Copy link
Copy Markdown

ngaro commented Apr 5, 2026

I would suggest splitting this PR up into multiple PR's. It's less work to examine them that way and they will get merged easier.

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.

3 participants