Skip to content

An install medium gets its root shell, on the display and the serial console - #215

Merged
DevomB merged 2 commits into
mainfrom
medium-root-shell
Oct 5, 2026
Merged

DevomB merged 2 commits into
mainfrom
medium-root-shell

Conversation

@DevomB

@DevomB DevomB commented Oct 2, 2026

Copy link
Copy Markdown
Owner

An install medium asks for a login instead of giving the root shell the user guide describes, on the display and on the serial console. The medium's root is locked and it has no account, so nobody who boots it can type kryptik-install: the only installs that work are the suites' own, armed by a control disk.

Is v0.1.0 affected? Yes. The fault has been in the tree since a718604 (2026-09-13), before v0.1.0 was tagged, so the v0.1.0 medium cannot be installed from by hand. Its release notes should say so, and the first release with this fix is the first one a person can install.

The cause. Three places decide "this is an install medium" by grep -qw 'kryptik\.media=[a-z]' /proc/cmdline: the console wrapper (build/recipes/console.sh), the tty1 getty (build/services/getty-tty1/run) and the control-disk reader (build/service-scripts/testctl.sh). With -w the match must end at a word boundary, and the match is kryptik.media=u inside kryptik.media=usb (or =iso), so it never matches. Both gettys fall through to the installed system's login prompt. The control-disk reader was unharmed because it reads /run/kryptik/boot-identity first, which is why every unattended install kept passing.

The fix. The three tests become grep -qE '(^| )kryptik\.media=[a-z]+( |$)': the whole word, whatever its value.

Why nothing caught it, and what does now.

  • Every install in the suites goes through a control disk, so no test ever typed at a medium. tools/image/medium-shell-test.sh, a new boot item of acceptance (medium-shell), boots the USB medium and the ISO and types at the serial console: a command runs as root, kryptik-install and kryptik-recover are found by name, kryptik-install --help answers, and poweroff ends the session; the transcript must hold no login prompt, and the console's process must be the shell. It is also the first run of the shell agetty starts there, so it tells whether that shell has /usr/sbin on its path.
  • tools/tests/medium-shell.sh takes the test out of each of the three files and holds it to the four command lines stage 06 signs: the USB medium and the ISO are media, slots a and b are not, and the three files make the same test. On main it fails six of its fifteen checks.

Found by the first test that types at a medium's shell (the hardware report's, in #180): the first serial transcript read kryptik login:, and so does every medium boot of every earlier run (early_getty_pid=… comm=agetty … wchan=do_select in the boot report).

Other open changes touch build/services/getty-tty1/run and build/recipes/console.sh (#206, comments) and build/service-scripts/testctl.sh (#177); the change here is one line in each.

DevomB added 2 commits October 2, 2026 02:46
…one letter as a whole word, which usb and iso are not, so the display and the serial console asked for a login nobody on a medium can give. The three places that make the test take the whole word now, and a check holds each to the four signed command lines
… installer and the recovery tool are found by name, and poweroff ends the session, on the USB medium and the ISO
@DevomB
DevomB merged commit 4575171 into main Oct 5, 2026
20 checks passed
@DevomB
DevomB deleted the medium-root-shell branch October 5, 2026 19:02
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