From 90756a787c4be987a61c314144a36bc02ffa1d02 Mon Sep 17 00:00:00 2001 From: Florian Friesdorf Date: Wed, 28 Dec 2011 21:46:45 +0000 Subject: [PATCH] add preLVMCommands hook svn path=/nixos/trunk/; revision=31130 --- modules/system/boot/stage-1-init.sh | 5 +++++ modules/system/boot/stage-1.nix | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/system/boot/stage-1-init.sh b/modules/system/boot/stage-1-init.sh index 68e0f7feec1..d47ce1caffd 100644 --- a/modules/system/boot/stage-1-init.sh +++ b/modules/system/boot/stage-1-init.sh @@ -123,6 +123,11 @@ udevadm trigger --action=add udevadm settle udevadm control --env=STARTUP= + +# XXX: Use case usb->lvm will still fail, usb->luks->lvm is covered +@preLVMCommands@ + + echo "starting device mapper and LVM..." lvm vgscan lvm vgchange -ay diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index 185ca1cb516..e178f2c04c9 100644 --- a/modules/system/boot/stage-1.nix +++ b/modules/system/boot/stage-1.nix @@ -35,6 +35,14 @@ let ''; }; + boot.initrd.preLVMCommands = mkOption { + default = ""; + merge = mergeStringOption; + description = '' + Shell commands to be executed immediately before lvm discovery. + ''; + }; + boot.initrd.postDeviceCommands = mkOption { default = ""; merge = mergeStringOption; @@ -304,7 +312,7 @@ let inherit (config.boot) resumeDevice devSize runSize; inherit (config.boot.initrd) checkJournalingFS - postDeviceCommands postMountCommands kernelModules; + preLVMCommands postDeviceCommands postMountCommands kernelModules; # !!! copy&pasted from upstart-jobs/filesystems.nix. mountPoints =