Add macOS / Linux bash port (tiny11maker.sh)#608
Open
zero1zero wants to merge 1 commit into
Open
Conversation
macOS/Linux users can't run tiny11maker.ps1 because it depends on Windows-only tooling (DISM, reg.exe, takeown, oscdimg.exe). This adds a bash equivalent that performs the same image trimming using cross-platform tools: wimlib for WIM operations, libhivex (via a small Python ctypes helper) for offline registry edits, and xorriso for ISO repacking. Tested against Windows 11 25H2 x64: produces a 6.7 GiB bootable ISO from a 7.9 GiB source. One step is intentionally skipped: DISM /Cleanup-Image /StartComponentCleanup /ResetBase runs inside Windows' servicing stack and has no cross-platform equivalent. The bash port documents this limitation -- output is somewhat larger than what the Windows version produces because the WinSxS component store isn't pruned.
Author
|
This was mostly written by Claude Code but I did test it and it works. |
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.
Summary
Adds a bash port of
tiny11maker.ps1so macOS and Linux users can build a trimmed-down Windows 11 ISO without a Windows host. Same removals and tweaks as the PowerShell version, implemented using cross-platform tooling.tiny11maker.sh— bash entry point. Same flow as the .ps1: extract source ISO → apply install.wim → strip appx/Edge/OneDrive/tasks → offline registry edits → recapture with LZMS → patch boot.wim → repack ISO.tiny11_hive.py— small Python helper that callslibhivexdirectly via ctypes to do surgical per-value registry edits. Homebrew'shivexbottle omitshivexregedit(Perl-bindings tool), andhivexsh setvalreplaces all values at a key (destructive on Services / ContentDeliveryManager). Pure stdlib — no pip deps.brew install wimlib hivex xorriso p7zipand documents the differences vs. the PowerShell version.Tested
Ran end-to-end against a Windows 11 25H2 x64 ISO (
Win11_25H2_English_x64_v2.iso, 7.88 GiB). Output: bootable 6.74 GiB ISO. Verified withfile, contents listed via7z l:boot/etfsboot.com,efi/microsoft/boot/efisys.bin,autounattend.xmlat root,sources/boot.wim+sources/install.swm/install2.swm.Verified the ISO actually boots on real hardware.
Differences vs. the PowerShell version
DISM /Cleanup-Image /StartComponentCleanup /ResetBaseruns inside Windows servicing and has no cross-platform equivalent. Output is larger than the .ps1 produces (1.14 GiB savings vs. the source, vs. roughly half-the-source savings on Windows).install.wimis auto-split intoinstall.swm/install2.swmwhen it exceeds 4 GiB. Homebrew'sxorrisolacks UDF support, so the ISO uses plain ISO 9660 Level 3 (4 GiB per-file ceiling). Same workaround Microsoft uses for FAT32 boot USBs; Windows installer reads it natively./Compress:recovery= solid LZMS).wimlib-imagex splitrejects solid archives, so non-solid is required to stay splittable. ~10-15% larger than solid would be.Program Files\WindowsApps; doesn't fully prune the staged-app registry entries the wayDISM /Remove-ProvisionedAppxPackagewould. Windows handles missing paths gracefully on first boot.Test plan
./tiny11maker.sh -s <Win11.iso> -i <index> -yon macOS withbrew install wimlib hivex xorriso p7zipautounattend.xml