1 import ./make-test-python.nix ({ lib, pkgs, ... }: {
2 name = "systemd-initrd-vconsole";
4 nodes.machine = { pkgs, ... }: {
5 boot.kernelParams = lib.mkAfter [ "rd.systemd.unit=rescue.target" "loglevel=3" "udev.log_level=3" "systemd.log_level=warning" ];
7 boot.initrd.systemd = {
9 emergencyAccess = true;
19 # Boot into rescue shell in initrd
21 machine.wait_for_console_text("Press Enter for maintenance")
22 machine.send_console("\n")
24 # Wait for shell to become ready
26 machine.send_console("printf '%s to receive commands:\\n' Ready\n")
28 machine.wait_for_console_text("Ready to receive commands:", timeout=1)
33 raise RuntimeError("Rescue shell never became ready")
36 machine.send_console("(printf '%s to receive text:\\n' Ready && read text && echo \"$text\") </dev/tty1\n")
37 machine.wait_for_console_text("Ready to receive text:")
38 for key in "asdfjkl;\n":
40 machine.wait_for_console_text("arstneio")