Skip to content

release: omit builder SSH keys from signed initramfs - #75

Merged
derekross merged 3 commits into
derekross:mainfrom
h4rkl:release-initramfs-keys
Nov 1, 2026
Merged

derekross merged 3 commits into
derekross:mainfrom
h4rkl:release-initramfs-keys

Conversation

@h4rkl

@h4rkl h4rkl commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Why

bin/omamobile initramfs currently packs the builder's SSH public keys into every boot image. That is useful during device development but would grant the builder root access to every distributed installation. This is a release blocker for tegu and any later device.

Change

  • bin/omamobile initramfs --release omits root SSH keys and any staged Dropbear host keys. The existing development invocation keeps USB recovery access.
  • tools/make-bundle refuses to sign a bundle if the packed initramfs contains SSH credentials or is corrupt. An explicitly unsigned development bundle retains its current behavior.
  • A synthetic archive test covers keyed, keyless and corrupt cases.

Verification

  • Built a real tegu release-mode initramfs on Linux. Its extracted contents differed from the development archive only by the removed root SSH directory.
  • Confirmed the signed bundle guard rejects the development archive and accepts the release archive.
  • tests/all and tools/pr-check pass on Linux.

This is kept separate from the tegu device PR #74 because the release guard applies to every device.

A development initramfs includes the build host public keys so the maintainer can recover over USB. Those keys would give the builder root access in every distributed image. Add an explicit release build mode that leaves them out, and reject any signed bundle whose packed initramfs still contains SSH credentials.

A real tegu release-mode initramfs differed from the development archive only by the removed root SSH directory. The signed bundle guard rejected the development archive and a corrupt archive, and the Linux integration and full repository tests passed.
@derekross

Copy link
Copy Markdown
Owner

Thanks, @h4rkl. This is the right shape: the development build keeps the builder's keys, --release leaves them out, and make-bundle refuses to sign a bundle whose initramfs still has them, with a message that says what to run. I read the two paths and ran tests/make-bundle-keys; it passes, and the development path is unchanged (the rm -rf runs on a stage the function has just recreated). The existing "images newer than the initramfs" check means the loose archive it inspects is the one inside the images, so the two guards fit together.

One thing before I merge, and two notes:

  • The release docs need the new step. docs/RELEASES.md §11 step 4 should say bin/omamobile initramfs --release comes before bin/omamobile images, §5.2's "No developer keys" bullet can say the flag exists now, and the §2 table row for bin/omamobile initramfs (the ~/.ssh/*.pub line, step 2) can move to done. Three lines.
  • On what this closes: the initramfs keys never reach the Arch root (install-phone writes the owner's key there), and the initramfs already gives anyone with the cable a root shell on the USB console, so the keys weren't root on every installation; they were a remotely usable credential in a signed image, which is reason enough. I'll word the squash body that way. The second cpio with the owner's key (§5.2) is still to come, so a release initramfs has SSH with no keys and the console stays the rescue path.
  • The dropbear host-key removal is a no-op today (the init generates them at boot), which is fine; the guard covers it if that ever changes.

I'll give the squash an area prefix (omamobile initramfs --release, make-bundle: …). Thanks for keeping it separate from the tegu PR.

h4rkl and others added 2 commits November 1, 2026 14:26
Keep both guards in tools/make-bundle: main's root image checks (derekross#192),
then the initramfs key check. tests/make-bundle-keys gives its fixture
root image the MANIFEST that main now requires, and tests/all keeps
main's list with tests/make-bundle-keys added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Section 11 builds the initramfs with --release before the images, 5.2
says the flag and the make-bundle refusal exist now, and the section 2
row for the builder's keys moves to done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@h4rkl

h4rkl commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Merged main in (242dc91): tools/make-bundle keeps both checks, main's root image checks from #192 first, then the initramfs key check. tests/make-bundle-keys gives its fixture root image the MANIFEST that main now requires, and still passes. The three RELEASES.md lines are in 7248386: §11 step 4 runs initramfs --release before images, §5.2 says the flag and the refusal exist, and the §2 row is marked done.

@derekross
derekross merged commit fb5ec0b into derekross:main Nov 1, 2026
2 checks passed
@derekross

Copy link
Copy Markdown
Owner

Thanks, h4rkl. The merge of main keeps both guards in the right order, the fixture has the MANIFEST #192 requires, and the three RELEASES lines say what I hoped. Rechecked against today's main: clean, both CI jobs passed, and images packs the same archive make-bundle inspects, so the refusal really covers what ships. Merged as a squash ("omamobile initramfs --release, make-bundle: no builder SSH keys in a signed initramfs") with a body I wrote, since the default would have carried the merge commit's message. Thanks for keeping this separate and seeing it through.

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…signed initramfs (derekross#75)

A development initramfs packs the builder's ~/.ssh/*.pub as root's
authorized_keys for USB recovery. In a distributed, signed image that is a
remotely usable credential for the builder (the Arch root never had them,
and the USB console is root for anyone with the cable either way).

bin/omamobile initramfs --release leaves root's .ssh (and any staged
dropbear host keys) out; the development build is unchanged.
tools/make-bundle refuses to sign a bundle whose initramfs still holds SSH
credentials or doesn't unpack; --unsigned bundles are unchanged.
RELEASES §11 builds the initramfs with --release before the images, and
§2 and §5.2 say so. tests/make-bundle-keys covers keyed, keyless and
corrupt archives.
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.

2 participants