Skip to content

Support LUKS root partitions and ship an Apple Silicon repartition/encryption runbook - #5

Open
mgbilby wants to merge 2 commits into
GravityLinux:mainfrom
mgbilby:partition-encryption
Open

mgbilby wants to merge 2 commits into
GravityLinux:mainfrom
mgbilby:partition-encryption

Conversation

@mgbilby

@mgbilby mgbilby commented Nov 21, 2026

Copy link
Copy Markdown

Summary

Two changes toward first-class disk encryption on Apple Silicon:

  • LUKS partition type support in the installer. OS templates can now
    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 creating
    the 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 partition
    cannot be uniquely identified, preserving the safety property of the
    existing alias normalization.
  • docs/apple-silicon-repartition-encryption.md: a reference
    runbook 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: luks and a prebuilt root image containing the
LUKS container plus bootloader entries carrying the image's
rd.luks.uuid; the installer side accepts the alias and types the
partition 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 LUKS content match, and fail-closed behavior when the created
    partition is missing or mistyped.
  • Reference runbook validated end-to-end on a release 44 install
    (macOS reclaim from Linux, GPT partition relocation with preserved
    numbers/UUIDs, LUKS root migration without reinstall, discard
    handling through the encrypted mapping).

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.
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