diff --git a/nixos/modules/synit/boot/stage-1-init.sh b/nixos/modules/synit/boot/stage-1-init.sh index 2a83b38..97dcfcc 100644 --- a/nixos/modules/synit/boot/stage-1-init.sh +++ b/nixos/modules/synit/boot/stage-1-init.sh @@ -247,6 +247,7 @@ ln -sfn /proc/self/fd/2 /dev/stderr mkdir -p /dev/.mdadm info "running mdevd..." +echo '.* 0:0 660' >/etc/mdev.conf mdevd -O4 -v 3 & mdevd_pid=$! mdevd-coldplug -O4 -v 3 diff --git a/nixos/modules/synit/boot/stage-1.nix b/nixos/modules/synit/boot/stage-1.nix index ba9d61d..5f42c9e 100644 --- a/nixos/modules/synit/boot/stage-1.nix +++ b/nixos/modules/synit/boot/stage-1.nix @@ -350,9 +350,6 @@ let { object = pkgs.kmod-debian-aliases; symlink = "/etc/modprobe.d/debian.conf"; } - { object = config.system.build.mdevConf; - symlink = "/etc/mdev.conf"; - } ] ++ lib.optionals config.services.multipath.enable [ { object = pkgs.runCommand "multipath.conf" { src = config.environment.etc."multipath.conf".text; @@ -423,16 +420,12 @@ let (cd "$tmp" && find . -print0 | sort -z | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @-) | \ ${compressorExe} ${lib.escapeShellArgs initialRamdisk.compressorArgs} >> "$1" ''; - - mdevConf = builtins.toFile "mdev.conf" '' - .* 0:0 777 - ''; in { config = mkIf config.boot.initrd.enable { - system.build = lib.mapAttrs (_: lib.mkForce) { inherit bootStage1 initialRamdisk initialRamdiskSecretAppender extraUtils mdevConf; }; + system.build = lib.mapAttrs (_: lib.mkForce) { inherit bootStage1 initialRamdisk initialRamdiskSecretAppender extraUtils; }; }; } diff --git a/nixos/modules/synit/etc/core/mdevd.pr b/nixos/modules/synit/etc/core/mdevd.pr index a055ef3..532b4d0 100644 --- a/nixos/modules/synit/etc/core/mdevd.pr +++ b/nixos/modules/synit/etc/core/mdevd.pr @@ -1,6 +1,9 @@ > - + > up>> -> +> diff --git a/nixos/modules/synit/etc/default.nix b/nixos/modules/synit/etc/default.nix index 495a67a..04d66da 100644 --- a/nixos/modules/synit/etc/default.nix +++ b/nixos/modules/synit/etc/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: let substituteDirectory = args: @@ -11,10 +11,6 @@ let in { environment.etc = { - "mdev.conf".text = '' - .* 0:0 660 - ''; - "syndicate/boot".source = substituteDirectory { src = ./boot; getty = "${pkgs.busybox}/bin/busybox getty"; @@ -23,10 +19,14 @@ in { "syndicate/core".source = substituteDirectory { src = ./core; - inherit (pkgs) mdevd; hostnameOneShot = "${pkgs.busybox}/bin/busybox hostname ${config.networking.hostName}"; - }; + inherit (pkgs) mdevd; + mdevdConf = pkgs.writeText "mdevd.conf" '' + -$MODALIAS=.* 0:0 660 +importas -iu MODALIAS MODALIAS ${pkgs.kmod}/bin/modprobe -q $MODALIAS + ''; + mdevdPath = lib.strings.makeBinPath [ pkgs.execline pkgs.busybox ]; + }; }; } diff --git a/nixos/modules/synit/etc/substitute-dir.sh b/nixos/modules/synit/etc/substitute-dir.sh index f2053d9..6361a83 100644 --- a/nixos/modules/synit/etc/substitute-dir.sh +++ b/nixos/modules/synit/etc/substitute-dir.sh @@ -5,7 +5,6 @@ eval "$preInstall" pushd $src || exit find ./* -type f | while read filepath do - echo "find file $filepath" fileout=$out/$filepath dirout=$(dirname "$fileout") mkdir -p "$dirout"