Skip to content

Add macOS / Linux bash port (tiny11maker.sh)#608

Open
zero1zero wants to merge 1 commit into
ntdevlabs:mainfrom
zero1zero:macos-port
Open

Add macOS / Linux bash port (tiny11maker.sh)#608
zero1zero wants to merge 1 commit into
ntdevlabs:mainfrom
zero1zero:macos-port

Conversation

@zero1zero
Copy link
Copy Markdown

@zero1zero zero1zero commented May 26, 2026

Summary

Adds a bash port of tiny11maker.ps1 so 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 calls libhivex directly via ctypes to do surgical per-value registry edits. Homebrew's hivex bottle omits hivexregedit (Perl-bindings tool), and hivexsh setval replaces all values at a key (destructive on Services / ContentDeliveryManager). Pure stdlib — no pip deps.
  • README — adds a macOS / Linux section with brew install wimlib hivex xorriso p7zip and 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 with file, contents listed via 7z l: boot/etfsboot.com, efi/microsoft/boot/efisys.bin, autounattend.xml at root, sources/boot.wim + sources/install.swm/install2.swm.

Verified the ISO actually boots on real hardware.

Differences vs. the PowerShell version

  1. No WinSxS component-store pruning. DISM /Cleanup-Image /StartComponentCleanup /ResetBase runs 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).
  2. install.wim is auto-split into install.swm/install2.swm when it exceeds 4 GiB. Homebrew's xorriso lacks 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.
  3. Compression is non-solid LZMS (PowerShell uses /Compress:recovery = solid LZMS). wimlib-imagex split rejects solid archives, so non-solid is required to stay splittable. ~10-15% larger than solid would be.
  4. Provisioned appx removal is folder-level. Deletes matched dirs under Program Files\WindowsApps; doesn't fully prune the staged-app registry entries the way DISM /Remove-ProvisionedAppxPackage would. Windows handles missing paths gracefully on first boot.

Test plan

  • Run ./tiny11maker.sh -s <Win11.iso> -i <index> -y on macOS with brew install wimlib hivex xorriso p7zip
  • Write the produced ISO to a USB and boot a test machine to confirm setup launches, hardware-requirement bypass works, and OOBE proceeds with the bundled autounattend.xml
  • Confirm the installed system reflects the registry tweaks (telemetry disabled, sponsored apps off, etc.)

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.
@zero1zero
Copy link
Copy Markdown
Author

This was mostly written by Claude Code but I did test it and it works.

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.

1 participant