Loading nixos/modules/services/hardware/udev.nix +1 −1 Original line number Diff line number Diff line Loading @@ -350,7 +350,7 @@ in boot.kernelParams = mkIf (!config.networking.usePredictableInterfaceNames) [ "net.ifnames=0" ]; boot.initrd.extraUdevRulesCommands = optionalString (!config.boot.initrd.systemd.enable && config.boot.initrd.services.udev.rules != "") boot.initrd.extraUdevRulesCommands = mkIf (!config.boot.initrd.systemd.enable && config.boot.initrd.services.udev.rules != "") '' cat <<'EOF' > $out/99-local.rules ${config.boot.initrd.services.udev.rules} Loading nixos/modules/services/networking/multipath.nix +2 −1 Original line number Diff line number Diff line Loading @@ -546,8 +546,9 @@ in { # We do not have systemd in stage-1 boot so must invoke `multipathd` # with the `-1` argument which disables systemd calls. Invoke `multipath` # to display the multipath mappings in the output of `journalctl -b`. # TODO: Implement for systemd stage 1 boot.initrd.kernelModules = [ "dm-multipath" "dm-service-time" ]; boot.initrd.postDeviceCommands = '' boot.initrd.postDeviceCommands = mkIf (!config.boot.initrd.systemd.enable) '' modprobe -a dm-multipath dm-service-time multipathd -s (set -x && sleep 1 && multipath -ll) Loading nixos/modules/system/boot/initrd-network.nix +4 −4 Original line number Diff line number Diff line Loading @@ -116,11 +116,11 @@ in boot.initrd.kernelModules = [ "af_packet" ]; boot.initrd.extraUtilsCommands = '' boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) '' copy_bin_and_libs ${pkgs.klibc}/lib/klibc/bin.static/ipconfig ''; boot.initrd.preLVMCommands = mkBefore ( boot.initrd.preLVMCommands = mkIf (!config.boot.initrd.systemd.enable) (mkBefore ( # Search for interface definitions in command line. '' ifaces="" Loading Loading @@ -148,9 +148,9 @@ in done '' + cfg.postCommands); + cfg.postCommands)); boot.initrd.postMountCommands = mkIf cfg.flushBeforeStage2 '' boot.initrd.postMountCommands = mkIf (cfg.flushBeforeStage2 && !config.boot.initrd.systemd.enable) '' for iface in $ifaces; do ip address flush dev "$iface" ip link set dev "$iface" down Loading nixos/modules/system/boot/systemd/initrd.nix +21 −0 Original line number Diff line number Diff line Loading @@ -348,6 +348,27 @@ in { }; config = mkIf (config.boot.initrd.enable && cfg.enable) { assertions = map (name: { assertion = lib.attrByPath name (throw "impossible") config.boot.initrd == ""; message = '' systemd stage 1 does not support 'boot.initrd.${lib.concatStringsSep "." name}'. Please convert it to analogous systemd units in 'boot.initrd.systemd'. Definitions: ${lib.concatMapStringsSep "\n" ({ file, ... }: " - ${file}") (lib.attrByPath name (throw "impossible") options.boot.initrd).definitionsWithLocations} ''; }) [ [ "preFailCommands" ] [ "preDeviceCommands" ] [ "preLVMCommands" ] [ "postDeviceCommands" ] [ "postMountCommands" ] [ "extraUdevRulesCommands" ] [ "extraUtilsCommands" ] [ "extraUtilsCommandsTest" ] [ "network" "postCommands" ] ]; system.build = { inherit initialRamdisk; }; boot.initrd.availableKernelModules = [ Loading nixos/modules/tasks/encrypted-devices.nix +4 −3 Original line number Diff line number Diff line Loading @@ -110,10 +110,11 @@ in }) earlyEncDevs); forceLuksSupportInInitrd = true; }; postMountCommands = concatMapStrings (dev: # TODO: systemd stage 1 postMountCommands = lib.mkIf (!config.boot.initrd.systemd.enable) (concatMapStrings (dev: "cryptsetup luksOpen --key-file ${dev.encrypted.keyFile} ${dev.encrypted.blkDev} ${dev.encrypted.label};\n" ) lateEncDevs; ) lateEncDevs); }; }; } Loading
nixos/modules/services/hardware/udev.nix +1 −1 Original line number Diff line number Diff line Loading @@ -350,7 +350,7 @@ in boot.kernelParams = mkIf (!config.networking.usePredictableInterfaceNames) [ "net.ifnames=0" ]; boot.initrd.extraUdevRulesCommands = optionalString (!config.boot.initrd.systemd.enable && config.boot.initrd.services.udev.rules != "") boot.initrd.extraUdevRulesCommands = mkIf (!config.boot.initrd.systemd.enable && config.boot.initrd.services.udev.rules != "") '' cat <<'EOF' > $out/99-local.rules ${config.boot.initrd.services.udev.rules} Loading
nixos/modules/services/networking/multipath.nix +2 −1 Original line number Diff line number Diff line Loading @@ -546,8 +546,9 @@ in { # We do not have systemd in stage-1 boot so must invoke `multipathd` # with the `-1` argument which disables systemd calls. Invoke `multipath` # to display the multipath mappings in the output of `journalctl -b`. # TODO: Implement for systemd stage 1 boot.initrd.kernelModules = [ "dm-multipath" "dm-service-time" ]; boot.initrd.postDeviceCommands = '' boot.initrd.postDeviceCommands = mkIf (!config.boot.initrd.systemd.enable) '' modprobe -a dm-multipath dm-service-time multipathd -s (set -x && sleep 1 && multipath -ll) Loading
nixos/modules/system/boot/initrd-network.nix +4 −4 Original line number Diff line number Diff line Loading @@ -116,11 +116,11 @@ in boot.initrd.kernelModules = [ "af_packet" ]; boot.initrd.extraUtilsCommands = '' boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) '' copy_bin_and_libs ${pkgs.klibc}/lib/klibc/bin.static/ipconfig ''; boot.initrd.preLVMCommands = mkBefore ( boot.initrd.preLVMCommands = mkIf (!config.boot.initrd.systemd.enable) (mkBefore ( # Search for interface definitions in command line. '' ifaces="" Loading Loading @@ -148,9 +148,9 @@ in done '' + cfg.postCommands); + cfg.postCommands)); boot.initrd.postMountCommands = mkIf cfg.flushBeforeStage2 '' boot.initrd.postMountCommands = mkIf (cfg.flushBeforeStage2 && !config.boot.initrd.systemd.enable) '' for iface in $ifaces; do ip address flush dev "$iface" ip link set dev "$iface" down Loading
nixos/modules/system/boot/systemd/initrd.nix +21 −0 Original line number Diff line number Diff line Loading @@ -348,6 +348,27 @@ in { }; config = mkIf (config.boot.initrd.enable && cfg.enable) { assertions = map (name: { assertion = lib.attrByPath name (throw "impossible") config.boot.initrd == ""; message = '' systemd stage 1 does not support 'boot.initrd.${lib.concatStringsSep "." name}'. Please convert it to analogous systemd units in 'boot.initrd.systemd'. Definitions: ${lib.concatMapStringsSep "\n" ({ file, ... }: " - ${file}") (lib.attrByPath name (throw "impossible") options.boot.initrd).definitionsWithLocations} ''; }) [ [ "preFailCommands" ] [ "preDeviceCommands" ] [ "preLVMCommands" ] [ "postDeviceCommands" ] [ "postMountCommands" ] [ "extraUdevRulesCommands" ] [ "extraUtilsCommands" ] [ "extraUtilsCommandsTest" ] [ "network" "postCommands" ] ]; system.build = { inherit initialRamdisk; }; boot.initrd.availableKernelModules = [ Loading
nixos/modules/tasks/encrypted-devices.nix +4 −3 Original line number Diff line number Diff line Loading @@ -110,10 +110,11 @@ in }) earlyEncDevs); forceLuksSupportInInitrd = true; }; postMountCommands = concatMapStrings (dev: # TODO: systemd stage 1 postMountCommands = lib.mkIf (!config.boot.initrd.systemd.enable) (concatMapStrings (dev: "cryptsetup luksOpen --key-file ${dev.encrypted.keyFile} ${dev.encrypted.blkDev} ${dev.encrypted.label};\n" ) lateEncDevs; ) lateEncDevs); }; }; }