From a514d8c148e78d0d222689bdae55d242e0ff454e Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sun, 3 Dec 2023 14:14:32 -0500 Subject: systemd-stage-1: allow non-existent /lib/firmware Since 1557027, makeModulesClosure doesn't create a lib/firmware directory if there is no firmware in the initramfs. If this happens, systemd-stage-1 fails to build. /lib only contains /lib/modules and /lib/firmware, both of while are from modulesClosure. Therefore, we can just add the entirety of ${modulesClosure}/lib to the initramfs to allow for the possibility that lib/firmware doesn't exist. This also brings systemd-stage-1 in line with the traditional stage-1. --- nixos/modules/system/boot/systemd/initrd.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index 0e7d59b32075b..7e67eb4244482 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -398,8 +398,7 @@ in { ManagerEnvironment=${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") cfg.managerEnvironment)} ''; - "/lib/modules".source = "${modulesClosure}/lib/modules"; - "/lib/firmware".source = "${modulesClosure}/lib/firmware"; + "/lib".source = "${modulesClosure}/lib"; "/etc/modules-load.d/nixos.conf".text = concatStringsSep "\n" config.boot.initrd.kernelModules; -- cgit 1.4.1