diff --git a/docs/guide.md b/docs/guide.md index e3d863c..47ea4b0 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -78,10 +78,9 @@ default target is reached, and the text login on `tty1` comes forward. ### Without a systemd initrd -The same boot with NixOS's scripted initrd: the kernel and initrd lines scroll past before bootvine starts in stage 2 - -The `scripted-initrd` machine uses NixOS's older scripted initrd, which has no -systemd. The initrd's lines scroll past as usual, and bootvine starts in +An initrd without systemd, such as one built by initramfs-tools, has no units +for bootvine to follow. The initrd's lines scroll past as usual, and bootvine +starts in stage 2, from `sysinit.target` on. ## Resuming from hibernation @@ -214,7 +213,6 @@ shows the shutdown. | --- | --- | --- | | `nix run .#sample-vm-slow-services` | slow units in the initrd and stage 2, one failing unit, and the handover to a tuigreet login | [booting through the initrd](#booting-through-the-initrd) | | `nix run .#sample-vm-text-console` | the same units without a display manager, handing over at the default target | [without a display manager](#without-a-display-manager) | -| `nix run .#sample-vm-scripted-initrd` | the same units with NixOS's scripted initrd, so bootvine starts in stage 2 only | [without a systemd initrd](#without-a-systemd-initrd) | | `nix run .#sample-vm-encrypted-volume` | a LUKS volume unlocked in the initrd; the passphrase is `sample passphrase` | [passphrase prompts](#passphrase-prompts) | | `nix run .#sample-vm-hibernate-resume` | a swap disk to hibernate to; run `systemctl hibernate`, then start the machine again | [resuming from hibernation](#resuming-from-hibernation) | | `nix run .#sample-vm-failures` | a firmware failure in the initrd, then units that exit with an error, crash, time out, cannot be run, restart too often, report a status, die after starting, and one that fails only through its dependency | [failures](#failures) | diff --git a/vm-tests/default.nix b/vm-tests/default.nix index 97cc3c9..15e0bbe 100644 --- a/vm-tests/default.nix +++ b/vm-tests/default.nix @@ -12,7 +12,6 @@ let machineDescriptions = { slow-services = "slow and failing units, a held initrd probe and a tuigreet login"; text-console = "the slow units without a display manager, handing over at the default target"; - scripted-initrd = "the slow units with the scripted initrd, so bootvine starts in stage 2"; encrypted-volume = "a LUKS volume unlocked in the initrd with the passphrase 'sample passphrase'"; failures = "units that fail in every way systemd reports, each with journal messages"; hibernate-resume = "a swap disk to hibernate to, showing the kernel's image loading progress on resume"; diff --git a/vm-tests/hibernate-resume/check.nix b/vm-tests/hibernate-resume/check.nix index 72b28ce..79b6106 100644 --- a/vm-tests/hibernate-resume/check.nix +++ b/vm-tests/hibernate-resume/check.nix @@ -5,10 +5,7 @@ nodes.machine = { lib, ... }: { - imports = [ - machine - (pkgs.path + "/nixos/tests/common/auto-format-root-device.nix") - ]; + imports = [ machine ]; boot.resumeDevice = "/dev/vdc"; swapDevices = lib.mkOverride 0 [ diff --git a/vm-tests/scripted-initrd/check.nix b/vm-tests/scripted-initrd/check.nix deleted file mode 100644 index 53ad7da..0000000 --- a/vm-tests/scripted-initrd/check.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ machine, ... }: -{ - name = "bootvine-scripted-initrd"; - - nodes.machine = - { lib, ... }: - let - waitFor = flag: "/bin/sh -c 'until [ -e /run/${flag} ]; do sleep 0.1; done'"; - in - { - imports = [ - machine - ../shared/recorded-display.nix - ]; - systemd = { - settings.Manager.ShowStatus = lib.mkForce true; - services = { - sample-database.serviceConfig.ExecStop = lib.mkForce (waitFor "release-sample-database"); - backdoor.before = [ "sample-database.service" ]; - late-sensor-probe = { - wantedBy = [ "graphical.target" ]; - after = [ "greetd.service" ]; - serviceConfig = { - Type = "oneshot"; - ExecStart = waitFor "release-late-sensor-probe"; - }; - }; - }; - }; - }; - - testScript = - builtins.readFile ../shared/console.py - + builtins.readFile ../shared/screen_recording.py - + builtins.readFile ./check.py; -} diff --git a/vm-tests/scripted-initrd/check.py b/vm-tests/scripted-initrd/check.py deleted file mode 100644 index 6dda5bc..0000000 --- a/vm-tests/scripted-initrd/check.py +++ /dev/null @@ -1,50 +0,0 @@ -def unit_state(unit): - return machine.succeed(f"systemctl is-active {unit} || true").strip() - - -recording = ScreenRecording(machine) -machine.start() -recording.start() - -wait_for_screen("Stage 2", "sample-database") -assert_bootvine_in_front() -assert_text_visible(font_has_512_glyphs=True) - -machine.succeed("timeout 10 systemctl stop bootvine") -machine.succeed("systemctl start --no-block bootvine") -retry(lambda _: foreground_terminal() == f"tty{BOOTVINE_TERMINAL}", timeout_seconds=30) -wait_for_screen("Stage 2") - -machine.send_chars("q") -retry(lambda _: unit_state("bootvine") == "inactive", timeout_seconds=10) -assert foreground_terminal() != f"tty{BOOTVINE_TERMINAL}", "the quit key left bootvine in front" -show_status = machine.succeed("systemctl show -p ShowStatus --value").strip() -assert show_status == "yes", f"the quit key did not restore the status output: {show_status}" - -machine.succeed("systemctl start --no-block bootvine") -retry(lambda _: foreground_terminal() == f"tty{BOOTVINE_TERMINAL}", timeout_seconds=30) - -machine.wait_for_unit("greetd.service") -retry(lambda _: "another program took the console" in bootvine_journal(), timeout_seconds=60) -assert unit_state("late-sensor-probe") == "activating", "the boot finished before the display manager took over" -assert unit_state("bootvine") == "active", "bootvine left before the boot finished" -machine.succeed("timeout 10 systemctl stop bootvine") -assert unit_state("bootvine") == "inactive", "stopping bootvine during the boot did not end it" -show_status = machine.succeed("systemctl show -p ShowStatus --value").strip() -assert show_status == "yes", f"stopping bootvine did not restore the status output: {show_status}" -machine.succeed("touch /run/release-late-sensor-probe") -machine.wait_for_unit("graphical.target") -journal = bootvine_journal() -print(journal) -watched = [line for line in journal.splitlines() if line.startswith("bootvine: watching")] -assert watched, "bootvine never started" -assert not any(" in Initrd " in line for line in watched), "bootvine ran in a scripted initrd" -assert "handing the console over" in journal, "never handed the console over" - -machine.succeed("systemctl poweroff --no-block") -retry(lambda _: unit_state("sample-database") == "deactivating", timeout_seconds=60) -wait_for_screen("Shutdown", "sample-database") -assert_bootvine_in_front() -machine.succeed("touch /run/release-sample-database") -machine.wait_for_shutdown() -recording.stop() diff --git a/vm-tests/scripted-initrd/machine.nix b/vm-tests/scripted-initrd/machine.nix deleted file mode 100644 index d3c53d5..0000000 --- a/vm-tests/scripted-initrd/machine.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ lib, ... }: -{ - imports = [ ../slow-services/machine.nix ]; - - boot.initrd.systemd.enable = lib.mkForce false; -}