Add GPT layout support: ext4 GLIM partition, optional data partition, automated setup#157
Open
codemedic wants to merge 2 commits into
Open
Add GPT layout support: ext4 GLIM partition, optional data partition, automated setup#157codemedic wants to merge 2 commits into
codemedic wants to merge 2 commits into
Conversation
Closes thias#78. Fixes thias#156. glim-partition.sh (new): - Default mode: single FAT32 partition (MBR), universal compatibility - --gpt: GPT layout with BIOS Boot (ef02) + ESP (ef00, FAT32) + ext4 GLIM - --data-size SIZE: optional GLIMDATA partition (implies --gpt) - --data-fs exfat|ext4: GLIMDATA filesystem, defaults to exFAT (cross-platform, no file size limit); ext4 GLIMDATA is chmod 1777 for live-env write access - Zaps corrupted GPT headers in a separate pass before writing new layout - Refuses to run as root or touch the system disk glim.sh: - Detects a separate EFI System Partition via type GUID for EFI install; falls back to the GLIM partition on single-partition layouts - Uses lsblk -no PKNAME for parent device detection (handles NVMe correctly) - Chowns boot/ after grub-install so rsync works without sudo on ext4 mounts - Chowns the GLIM partition root after install so ISOs can be copied without sudo - Fixes thias#156: prompts now only accept y, Y, or Enter as yes; Escape and other non-n input no longer silently proceed with installation README.md: - Documents both partition layouts with automated and manual setup instructions - Secure Boot note: ISOs with unsigned shims (Gentoo, Arch, Artix) require Secure Boot to be disabled; this is not a GLIM bug tests/ (new): - pytest suite running against real loop devices; no mocking - Covers partition layout (MBR/GPT/exFAT/ext4), glim.sh install correctness, and QEMU BIOS/UEFI boot smoke tests - setup-sudo.sh installs a sudoers drop-in for passwordless test commands; --remove flag tears it down
Author
|
Real hardware test results (232 GB USB, GPT layout with 64 GB exFAT GLIMDATA) Booted successfully via UEFI: Not working: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #78. Fixes #156. Alternative approach to #131.
Problem
Two things have been bugging me about GLIM for a while:
the trend is only going in one direction.
transferring files between live environments.
What this PR does
It adds
glim-partition.sh, a new automated partitioning script, and extendsglim.shto support a GPT multi-partition layout, while keeping the existing single-partition
FAT32 setup working exactly as before.
Default mode (simple, universal):
Creates a single FAT32 partition (MBR), identical to what you'd set up manually today.
Works on Windows and macOS, works across BIOS and EFI. Still subject to the 4 GiB limit.
GPT mode (for large ISOs):
GLIMGLIMDATA--data-sizeimplies--gpt. The GLIMDATA partition defaults to exFAT, which has nofile size limit and is readable natively on Windows, macOS, and Linux without drivers.
Use
--data-fs ext4if you only care about Linux. exFAT partitions are accessibleto all users by default when mounted. ext4 GLIMDATA is set world-writable (
chmod 1777)so any live environment can write to it regardless of UID/GID.
Why no grub.cfg changes?
grub-install --boot-directorypointing at the ext4 GLIM partition makes GRUB's$rootthat partition naturally. The existing
probe --set rootuuid --fs-uuid $rootpicks upthe correct UUID, so all
iso-scan/filename=,img_dev=, andfindiso=boot parameterswork without modification. Existing ISO paths are preserved.
Changes
glim-partition.sh(new): automated partitioning script. Destructive; requiresexplicit
yesconfirmation and refuses to run as root or touch the system disk.glim.sh: detects a separate ESP via partition type GUID for EFI install;handles NVMe naming correctly; chowns the GLIM partition after
grub-installsorsync and subsequent ISO copies work without sudo. Also fixes glim.sh: Escape key (and other non-'n' input) accepted as yes at prompts #156: prompts now only
accept
y,Y, or Enter as yes; Escape no longer silently proceeds.README.md: documents both layouts with automated and manual setup instructions.Includes a Secure Boot note: some ISOs (Gentoo, Arch, Artix) ship shims not signed by
a Microsoft-trusted CA and will fail on Secure Boot systems; this is not a GLIM bug.
tests/(new): pytest suite that runs against real loop devices. Covers partitionlayout,
glim.shinstall correctness, and QEMU BIOS/UEFI boot smoke tests. No mocking.Comparison with #131
#131 solves the same problem differently: a small FAT32 anchor partition plus a separate
GLIMISOpartition for ISOs. That approach requires significant grub.cfg changes andmoves ISOs from
boot/iso/toiso/, a breaking change for existing setups. This PRavoids both by using
--boot-directoryto point GRUB at the ext4 partition directly.Tested
Tested on a 232 GB USB stick with a GPT layout and 64 GB GLIMDATA partition. Elementary
OS boots successfully via UEFI. BIOS boot confirmed working.