Rootfs: Restore the bash login shell so demo tab-completion works - #1317
Merged
Conversation
## Why Interactive tab auto-completion in the browser demo shell stopped working. Bash provides that completion through readline; dash does not. PR #1307 ("Boot login from package-backed images") changed the main-shell demo boot from launching bash directly to booting through `login`: before: argv = ["bash", "-l", "-i"] # interactive bash after: argv = ["/usr/bin/login", "-p", "-f", "maker"] `login -f maker` execs the maker account's login shell from images/rootfs/etc/passwd, which was `/bin/sh` -- and `/bin/sh` is a dash alias (see images/rootfs/PACKAGES.toml). So the demo silently went from an interactive bash shell (with completion) to dash (with none). ## What changed Set the maker account's login shell to `/bin/bash` in images/rootfs/etc/passwd. Bash already ships in the image (images/rootfs/PACKAGES.toml maps /usr/bin/bash with a /bin/bash alias, and build-source-rootfs-shell-image.ts requires those aliases), so `login -f maker` now execs an interactive login bash and completion returns. Root keeps `/bin/sh`. Update the two host tests that assert the maker record against the real images/rootfs/etc/passwd -- getpwent.test.ts (the getpwent probe) and demo-login-image.test.ts (the "canonical rootfs data is truthful" guard) -- to expect `/bin/bash` for maker. The demo-login fixture cases that pass an explicit `/bin/sh` to configureDemoLogin are unchanged; they exercise that helper's shell parameter, not the shipped passwd. ## Validation The changed assertions are string-consistent with the edited passwd by construction (getpwent deterministically echoes the passwd shell field). Full browser verification of interactive tab-completion requires booting the rebuilt shell image; the host tests above are the automated guard and run in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Why
Interactive tab auto-completion in the browser demo shell stopped working.
Bash provides that completion through readline; dash does not. PR #1307
("Boot login from package-backed images") changed the main-shell demo boot
from launching bash directly to booting through
login:before: argv = ["bash", "-l", "-i"] # interactive bash
after: argv = ["/usr/bin/login", "-p", "-f", "maker"]
login -f makerexecs the maker account's login shell fromimages/rootfs/etc/passwd, which was
/bin/sh-- and/bin/shis a dashalias (see images/rootfs/PACKAGES.toml). So the demo silently went from an
interactive bash shell (with completion) to dash (with none).
What changed
Set the maker account's login shell to
/bin/bashinimages/rootfs/etc/passwd. Bash already ships in the image
(images/rootfs/PACKAGES.toml maps /usr/bin/bash with a /bin/bash alias, and
build-source-rootfs-shell-image.ts requires those aliases), so
login -f makernow execs an interactive login bash and completionreturns. Root keeps
/bin/sh.Update the two host tests that assert the maker record against the real
images/rootfs/etc/passwd -- getpwent.test.ts (the getpwent probe) and
demo-login-image.test.ts (the "canonical rootfs data is truthful" guard) --
to expect
/bin/bashfor maker. The demo-login fixture cases that pass anexplicit
/bin/shto configureDemoLogin are unchanged; they exercise thathelper's shell parameter, not the shipped passwd.
Validation
The changed assertions are string-consistent with the edited passwd by
construction (getpwent deterministically echoes the passwd shell field).
Full browser verification of interactive tab-completion requires booting
the rebuilt shell image; the host tests above are the automated guard and
run in CI.
🤖 Generated with Claude Code