liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a0bd250963347c2a655fd7710f5c92cc92358117
parent c8b2d58dd35f378afa99586988e91cfa45c0d19e
Author: Daniel Barlow <dan@telent.net>
Date:   Tue, 21 Nov 2023 23:02:51 +0000

switch from getty to root shell on console

this just makes things marginally simpler

Diffstat:
Mdoc/tutorial.rst | 9+++++----
Mexamples/hello-from-mt300.nix | 2+-
Mmodules/s6/default.nix | 9++++++++-
Mtests/ext4/script.expect | 1-
Mtests/jffs2/script.expect | 1-
Mtests/min-copy-closure/wait-until-ready.expect | 2--
Mtests/pppoe/getaddress.expect | 1-
Mtests/wlan/wait-for-wlan.expect | 1-
8 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/doc/tutorial.rst b/doc/tutorial.rst @@ -69,10 +69,11 @@ device's serial console and the `QEMU monitor stdin/stdout. You should now see Linux boot messages and after a few seconds be -presented with a login prompt. You can login on the console as -``root`` (password is "secret") and poke around to see what processes are -running. To kill the emulator, press ^P (Control P) then c to enter the -"QEMU Monitor", then type ``quit`` at the ``(qemu)`` prompt. +presented with a root shell prompt. You can run commands to look at +the filesystem, see what processes are running, view log messages (in +:file:/run/uncaught-logs.current), etc. To kill the emulator, press ^P +(Control P) then c to enter the "QEMU Monitor", then type ``quit`` at +the ``(qemu)`` prompt. To see that it's running network services we need to connect to its emulated network. Start the machine again, if you had stopped it, and diff --git a/examples/hello-from-mt300.nix b/examples/hello-from-mt300.nix @@ -8,7 +8,7 @@ in rec { ../modules/network ../modules/ssh ../modules/vlan - ../modules/flashimage.nix + ../modules/outputs/flashimage.nix ]; boot.tftp = { diff --git a/modules/s6/default.nix b/modules/s6/default.nix @@ -80,10 +80,17 @@ let run = { file = '' #!${execline}/bin/execlineb -P - /bin/getty -l /bin/login 115200 /dev/console + ${execline}/bin/redirfd -w 2 /dev/console + ${execline}/bin/fdmove -c 1 2 + ${execline}/bin/redirfd -r 0 /dev/console + ${execline}/bin/cd / + /bin/ash -l ''; mode = "0755"; }; + down-signal = { + file = "HUP\n"; + }; }; ".s6-svscan" = let diff --git a/tests/ext4/script.expect b/tests/ext4/script.expect @@ -2,7 +2,6 @@ set timeout 10 spawn socat unix-connect:vm/console - send "\r\n" -expect "login:" { send "root\r\n" } expect "#" send "echo HELLO WORLD > /hello\r\n" expect "#" diff --git a/tests/jffs2/script.expect b/tests/jffs2/script.expect @@ -2,7 +2,6 @@ set timeout 10 spawn socat unix-connect:vm/console - send "\r\n" -expect "login:" { send "root\r\n" } expect "#" send "echo HELLO WORLD > /hello\r\n" expect "#" diff --git a/tests/min-copy-closure/wait-until-ready.expect b/tests/min-copy-closure/wait-until-ready.expect @@ -2,4 +2,3 @@ set timeout 60 spawn socat unix-connect:vm/console - send "\r\n" -expect "login:" -\ No newline at end of file diff --git a/tests/pppoe/getaddress.expect b/tests/pppoe/getaddress.expect @@ -2,7 +2,6 @@ set timeout 60 spawn socat unix-connect:vm/console - send "\r\n" -expect "login:" { send "root\r\n" } expect "#" set FINISHED 0 set EXIT "1" diff --git a/tests/wlan/wait-for-wlan.expect b/tests/wlan/wait-for-wlan.expect @@ -2,7 +2,6 @@ set timeout 60 spawn socat unix-connect:vm/console - send "\r\n" -expect "login:" { send "root\r\n" } expect "#" set FINISHED 0 set EXIT "1"