A failed run (a script that exits non-zero, no prompt for --trace, a
--get that does not match) now prints the end of the console, and on a
guest booted with systemd (/run/systemd/system) also systemctl --failed,
its jobs and the boot's journal; the other images print nothing more.
The traced boot's prompt detector also strips OSC sequences ended by ST
(ESC \), as systemd sends them, and CSI with a ! intermediate.
Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: Vineel Sai <mail@vineelsai.com>
Sessions and the console run as user in /home/user on Debian and Alpine (doas with a sudo shim there); the host asks for another user with SpawnOptions.user, the CLI's --user or kw.user=. The shims, the command-not-found installers, poweroff and the page's launcher and demos reach root through sudo, and apt, apt-get and apk typed by the user are aliases to it. /usr/lib/kw/shrc gives nested shells, sudo -s and sudo -i the prompt, the command-not-found handler and PATH that only login shells had. The framebuffer, input and sound devices are group-accessible, and host mounts show as the user's.
The bundle (unkernel.wasm) carries a small busybox initramfs that mounts a
distro image labelled kwroot under an overlay root, or starts the base shell
without one. guest/ replaces kernel/guest/: base/, distro/NAME/, shared lib/
and tools/. Images are laid out for their boot by a patched mkfs.erofs and a
recorded boot file list, with a prefetch hint in the image header. Debian
bakes its apt lists and cache, a set of everyday packages and a
command-not-found installer.