switch from getty to root shell on console

this just makes things marginally simpler
This commit is contained in:
Daniel Barlow 2023-11-21 23:02:51 +00:00
parent c8b2d58dd3
commit a0bd250963
8 changed files with 14 additions and 11 deletions

View file

@ -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

View file

@ -8,7 +8,7 @@ in rec {
../modules/network
../modules/ssh
../modules/vlan
../modules/flashimage.nix
../modules/outputs/flashimage.nix
];
boot.tftp = {

View file

@ -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

View file

@ -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 "#"

View file

@ -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 "#"

View file

@ -2,4 +2,3 @@ set timeout 60
spawn socat unix-connect:vm/console -
send "\r\n"
expect "login:"

View file

@ -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"

View file

@ -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"