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/klogd.nix)
(import ../upstart-jobs/lvm.nix) # Makes LVM logical volumes available.
# security # security

View file

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

View file

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