Merge pull request #246082 from ElvishJerricco/exitrd-fix-shutdown-loop

systemd shutdownRamfs: Fix infinite shutdown loop

Changed files
+6 -2
nixos
modules
system
boot
systemd
tests
+5 -1
nixos/modules/system/boot/systemd/shutdown.nix
···
};
config = lib.mkIf cfg.enable {
-
systemd.shutdownRamfs.contents."/shutdown".source = "${config.systemd.package}/lib/systemd/systemd-shutdown";
+
systemd.shutdownRamfs.contents = {
+
"/shutdown".source = "${config.systemd.package}/lib/systemd/systemd-shutdown";
+
"/etc/initrd-release".source = config.environment.etc.os-release.source;
+
"/etc/os-release".source = config.environment.etc.os-release.source;
+
};
systemd.shutdownRamfs.storePaths = [pkgs.runtimeShell "${pkgs.coreutils}/bin"];
systemd.mounts = [{
+1 -1
nixos/tests/systemd-shutdown.nix
···
machine.wait_for_console_text("Unmounting '/oldroot'")
machine.wait_for_console_text("${msg}")
# Don't try to sync filesystems
-
machine.booted = False
+
machine.wait_for_shutdown()
'';
})