diff options
author | Florian Klink <flokli@flokli.de> | 2023-07-30 00:11:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-30 00:11:55 +0200 |
commit | a2a7096157fa74d68bb11f866450aa1da1a8012f (patch) | |
tree | e0122fde969b43117587b2447d34c9a3e18c3d7d | |
parent | 0546c70849185664031cd6bb3f6b57e477fe1487 (diff) | |
parent | 4ecd0c119a391bd53035bcec79fb6902066d3f95 (diff) |
Merge pull request #246082 from ElvishJerricco/exitrd-fix-shutdown-loop
systemd shutdownRamfs: Fix infinite shutdown loop
-rw-r--r-- | nixos/modules/system/boot/systemd/shutdown.nix | 6 | ||||
-rw-r--r-- | nixos/tests/systemd-shutdown.nix | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/systemd/shutdown.nix b/nixos/modules/system/boot/systemd/shutdown.nix index b4b750fa9aafe..d7300e940af20 100644 --- a/nixos/modules/system/boot/systemd/shutdown.nix +++ b/nixos/modules/system/boot/systemd/shutdown.nix @@ -30,7 +30,11 @@ in { }; 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 = [{ diff --git a/nixos/tests/systemd-shutdown.nix b/nixos/tests/systemd-shutdown.nix index dad8167f198fc..ca6754046f57a 100644 --- a/nixos/tests/systemd-shutdown.nix +++ b/nixos/tests/systemd-shutdown.nix @@ -22,6 +22,6 @@ in { 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() ''; }) |