Skip to content

luks-slots --owner: exit 4 when no owner slot is recorded - #666

Merged
maralcbr merged 1 commit into
quattro-upstreamfrom
mac/luks-slots-owner-exit4
Sep 28, 2026
Merged

maralcbr merged 1 commit into
quattro-upstreamfrom
mac/luks-slots-owner-exit4

Conversation

@maralcbr

Copy link
Copy Markdown
Collaborator

This applies the final luks-slots --owner contract agreed with the upstream runtime work (omacom#13362). It follows #659.

  • Exit 0: prints the owner slot, which is recorded and present in the LUKS header.
  • Exit 4: only when nothing is recorded, meaning encrypt.state is missing or has no owner_slot entry. Stderr starts "No owner key slot is recorded".
  • Exit 1 with the reason on stderr for everything else: an empty or non-numeric record, a slot absent from the header, an unreadable header or encrypt.state, the crypttab device not found, not Apple Silicon, or the Boot partition not mounted.
  • Never exit 2 or 3: the dispatcher uses those.

Release order: this omarchy-mac-boot must publish with or before the runtime that interprets exit 4. Noted on omacom/omarchy-pkgs#673.

Tested in an Arch container: packages/omarchy-mac/boot/test/all passes. The --owner tests now check each exit code:

  • 4 for a missing file and for a missing entry, and that stderr leads with the no-record message
  • 1 for an empty value, a non-numeric value, a value out of range, a slot absent from the header, a token standing in for a slot, an unreadable header, a missing crypttab device, another platform and an unmounted Boot partition
  • no file changed in any case

luks-slots --owner now exits 4 only when nothing is recorded (no encrypt.state,
or no owner_slot entry), so omarchy-drive-password can tell a Mac with no
record from one whose record or header is wrong, which still exits 1. 2 and 3
stay the dispatcher's.
@maralcbr
maralcbr merged commit b2bcc16 into quattro-upstream Sep 28, 2026
5 checks passed
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