From fd06c8fc9f497975bac50a8f3188fcb9a3a40477 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Fri, 13 Jan 2023 00:10:14 -0700 Subject: [PATCH] nixos/systemd-initrd: allow symlink into when checking for `/prepare-root` --- nixos/modules/system/boot/systemd/initrd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index d30f61146e18..6ecb46b52f1c 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -493,7 +493,7 @@ in { # If we are not booting a NixOS closure (e.g. init=/bin/sh), # we don't know what root to prepare so we don't do anything - if ! [ -x "/sysroot$closure/prepare-root" ]; then + if ! [ -x "/sysroot$(readlink "/sysroot$closure/prepare-root" || echo "$closure/prepare-root")" ]; then echo "NEW_INIT=''${initParam[1]}" > /etc/switch-root.conf echo "$closure does not look like a NixOS installation - not activating" exit 0