Convert "lvm"

svn path=/nixos/branches/fix-style/; revision=14399
This commit is contained in:
Marc Weber 2009-03-06 12:27:28 +00:00
parent bfc722e83d
commit f05cccbc66
3 changed files with 34 additions and 27 deletions

View File

@ -416,6 +416,8 @@ in
(import ../upstart-jobs/klogd.nix)
(import ../upstart-jobs/lvm.nix) # Makes LVM logical volumes available.
# security

View File

@ -71,12 +71,6 @@ let
jobs = map makeJob
([
# Makes LVM logical volumes available.
(import ../upstart-jobs/lvm.nix {
inherit modprobe;
inherit (pkgs) lvm2 devicemapper;
})
# Activate software RAID arrays.
(import ../upstart-jobs/swraid.nix {
inherit modprobe;

View File

@ -1,9 +1,20 @@
{modprobe, lvm2, devicemapper}:
{pkgs, config, ...}:
###### implementation
let
modprobe = config.system.sbin.modprobe;
in
{
services = {
extraJobs = [{
name = "lvm";
job = "
job = ''
start on udev
#start on new-devices
@ -12,19 +23,19 @@ script
# Load the device mapper.
${modprobe}/sbin/modprobe dm_mod || true
${devicemapper}/sbin/dmsetup mknodes
${pkgs.devicemapper}/sbin/dmsetup mknodes
# Scan for block devices that might contain LVM physical volumes
# and volume groups.
${lvm2}/sbin/vgscan --mknodes
${pkgs.lvm2}/sbin/vgscan --mknodes
# Make all logical volumes on all volume groups available, i.e.,
# make them appear in /dev.
${lvm2}/sbin/vgchange --available y
${pkgs.lvm2}/sbin/vgchange --available y
initctl emit new-devices
end script
";
'';
}];
};
}