Skip to content

Add Windows To Go support#1

Open
Advnirr wants to merge 1 commit into
mainfrom
feature/windows-to-go
Open

Add Windows To Go support#1
Advnirr wants to merge 1 commit into
mainfrom
feature/windows-to-go

Conversation

@Advnirr

@Advnirr Advnirr commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a Windows To Go mode: instead of building Windows installer media, Lufux can now deploy a runnable, portable Windows onto the USB drive that boots and runs directly from the stick.

How it works

  • Partitioning: GPT with a FAT32 ESP (~1 GiB) + an NTFS Windows partition.
  • Deployment: the selected install.wim / install.esd edition is expanded straight onto the NTFS partition with wimlib-imagex apply (no FAT32 4 GiB split needed — NTFS holds the expanded image).
  • Boot: the UEFI bootloader (bootmgfw.efi) is copied from the deployed image to the ESP (/EFI/Boot/bootx64.efi + /EFI/Microsoft/Boot/), boot resources are copied, and a BCD store is seeded from the image's BCD-Template.

No new dependencies — it reuses the existing toolset (wimlib, parted, dosfstools, ntfs-3g).

UI / UX

  • A "Windows To Go" checkbox appears on the ISO step, only when OS type = Windows.
  • Enabling it forces GPT/UEFI and hides the partition-scheme selector.
  • The summary step and the flashing worker honour the new mode.
  • Fully localized (EN/RU), both the UI strings and the script status messages, matching the existing localization pattern.

Security

The new deploy script follows the same hardening as the rest of the project: ISO/device paths are passed as positional parameters ($1/$2, never interpolated/shell-evaluated), and mount points use mktemp -d (no predictable /tmp paths).

Testing

  • bash -n on the generated script (EN + RU) — OK.
  • App launches cleanly; functional GUI test verifies the checkbox visibility, scheme hiding, summary text, and that the worker selects the correct script (WTG vs installer) with the right arguments.
  • ⚠️ Not yet validated on real hardware — actually booting a produced Windows To Go drive (especially the BCD setup) should be tested on a physical UEFI machine before release. The boot config is seeded from the image's BCD template; on Linux there is no bcdboot, so this is the area most likely to need refinement.

🤖 Generated with Claude Code

Deploy a runnable Windows onto the USB drive (not installer media):
GPT layout with a FAT32 ESP + NTFS Windows partition, the selected WIM
edition is expanded with wimlib and the UEFI bootloader is taken from
the deployed image.

- New windows_togo_logic.py generating the deploy script (iso/dev passed
  as $1/$2, mktemp -d mount points — same hardening as the other scripts).
- "Windows To Go" checkbox on the ISO page, shown only for Windows; it
  forces GPT/UEFI and hides the partition-scheme selector.
- Summary and worker honour the new mode; fully localized (EN/RU).
- Ship windows_togo_logic.py in PKGBUILD.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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