Repository navigation
Conversation
OS templates can now request a LUKS root partition with "type": "luks". diskutil has no friendly LUKS content name, so the alias is translated to the Linux LUKS type GUID when the partition is created, and the post-creation selection check normalizes LUKS roots however diskutil reports them (raw GUID or Linux LUKS). Selection still fails closed if the new partition cannot be uniquely identified.
Reference walkthrough covering the fixed Apple firmware partitions, reclaiming macOS containers from Linux, physical partition relocation with preserved GPT slot numbers and UUIDs, LUKS2+btrfs encryption for data volumes and for migrating an existing install without reinstall, keyfile-based second devices, discard handling, verification and rollback patterns, and the installer integration approach for OS templates with LUKS roots.
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
Two changes toward first-class disk encryption on Apple Silicon:
request a LUKS root with
"type": "luks".DiskUtil.addPartition()translates the alias to the Linux LUKS type GUID
(
CA7D7CCB-63ED-4C53-861C-1742536059CC, gdisk code 8309) when creatingthe partition, and the post-creation selection check normalizes LUKS
roots however diskutil reports their content (raw GUID or
Linux LUKS). Selection still fails closed when the new partitioncannot be uniquely identified, preserving the safety property of the
existing alias normalization.
docs/apple-silicon-repartition-encryption.md: a referencerunbook distilled from an end-to-end validated migration on Apple
Silicon covering the fixed Apple firmware partitions and their rules,
reclaiming macOS containers from Linux, physical partition relocation
with preserved GPT slot numbers and UUIDs, LUKS2+btrfs encryption for
data volumes and for migrating an existing install without reinstall,
keyfile-based second devices, discard handling, verification and
rollback patterns, and integration notes for OS templates with LUKS
roots.
Rationale
The CLI installer runs on macOS and writes prebuilt partition images
onto raw partitions, so it cannot run cryptsetup at install time. The
clean division of labor this PR enables: the build side ships an OS
template with
type: luksand a prebuilt root image containing theLUKS container plus bootloader entries carrying the image's
rd.luks.uuid; the installer side accepts the alias and types thepartition table correctly. Systems already installed without encryption
are covered by the runbook's post-install migration procedure.
Fedora 44's own installer is used as the reference for defaults and
scope: a single high-level encrypt choice, unencrypted ESP and /boot
wrapped-plaintext boot chain, LUKS2 with aes-xts-plain64,
512-bit keys, and Argon2id KDF.
Testing
PYTHONPATH=src python3 -m unittest tests.test_partition_selection:six tests pass. Three new tests cover the LUKS alias: command
translation to the GUID with a diskutil-reported GUID match, a
Linux LUKScontent match, and fail-closed behavior when the createdpartition is missing or mistyped.
(macOS reclaim from Linux, GPT partition relocation with preserved
numbers/UUIDs, LUKS root migration without reinstall, discard
handling through the encrypted mapping).