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