From dd6eb81797c987c5438a04dac7ce0c5b5dea3b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Tue, 13 Mar 2012 13:26:21 +0000 Subject: [PATCH] Adding /etc/mdadm.conf, with the contents supplied at boot.initrd.mdadmConf. This allows setting a fixed device name per array, thus ensuring that at boot, the arrays will always be mounted with the same names. I think this allows solving the problem of grub getting confused about softraid device names (prefix and root), if the devices always get the same naming at initrd. svn path=/nixos/trunk/; revision=33033 --- modules/system/boot/stage-1.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index 1932599193e..9ad86312290 100644 --- a/modules/system/boot/stage-1.nix +++ b/modules/system/boot/stage-1.nix @@ -35,6 +35,14 @@ let ''; }; + boot.initrd.mdadmConf = mkOption { + default = ""; + type = with types; string; + description = '' + Contents of /etc/mdadm.conf at initrd. + ''; + }; + boot.initrd.preLVMCommands = mkOption { default = ""; type = with types; string; @@ -313,6 +321,9 @@ let [ { object = bootStage1; symlink = "/init"; } + { object = pkgs.writeText "mdadm.conf" config.boot.initrd.mdadmConf; + symlink = "/etc/mdadm.conf"; + } ] ++ optionals enableSplashScreen [ { object = extraUtils; suffix = "/bin/splash_helper";