# /.bashrc — brintOS fbcon console shell rc for the GLIBC bash-init machine # (HWJS-C-1 glibc console-shell wiring, 2026-07-03). # # WHY: the framebuffer console (fbcon on /dev/tty1, rendered to the browser # canvas) only accepts typed text if SOMETHING is reading /dev/tty1. Pid 1 is # `/init -i` (interactive glibc bash, HOME=/ from the host initEnvp), so bash # reads THIS file at startup. It spawns ONE additional interactive bash with # stdio on /dev/tty1 — the same bash-native wiring as the musl-bash machine # (distros/linux-6.12-musl-bash-coreutils/tools/fbcon-bashrc). # # This staging previously did NOT exist on the glibc machine — DELIBERATE at # the time: the image booted with the `wasm_user_pin` cmdline fallback (glibc # could not decode the -517 coro-park), under which a second idle console # shell would PIN a second pool Worker and wedge fork() at the machine's # cpu=2 spec. That gap is CLOSED: the glibc overlay now routes the blocking # syscall paths through __wasm32_syscall_resched (the -517 park-restart — # sysdeps/unix/sysv/linux/wasm32/Makefile, HWJS-C-1), the machine runs the # cooperative park default, and an idle tty1 shell parks its coroutine # instead of pinning a Worker. # # Limitation carried over from the musl-bash machine (documented, accepted): # bash has no setsid builtin and coreutils ships no setsid, so the tty1 shell # stays in pid 1's session and /dev/tty1 never becomes its controlling # terminal — typing/echo/commands work, but canvas Ctrl-C (VT ISIG -> fg pgrp # of tty1's session) has no target. A first-party setsid package is the # tracked follow-up for bash machines. # # Guards: fire exactly once, in pid 1 only, only when the kernel actually has # a /dev/tty1 (a display-less boot skips silently — the rc is inert). if [ -z "${BRINTOS_FBCON_STARTED-}" ] && [ "$$" = 1 ] && [ -c /dev/tty1 ]; then export BRINTOS_FBCON_STARTED=1 TERM=linux PS1='fb$ ' bash -i 0<>/dev/tty1 1>&0 2>&0 & fi