mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
Convert "lvm"
svn path=/nixos/branches/fix-style/; revision=14399
This commit is contained in:
parent
bfc722e83d
commit
f05cccbc66
@ -416,6 +416,8 @@ in
|
||||
|
||||
(import ../upstart-jobs/klogd.nix)
|
||||
|
||||
(import ../upstart-jobs/lvm.nix) # Makes LVM logical volumes available.
|
||||
|
||||
|
||||
|
||||
# security
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
${modprobe}/sbin/modprobe dm_mod || true
|
||||
script
|
||||
|
||||
${devicemapper}/sbin/dmsetup mknodes
|
||||
# Scan for block devices that might contain LVM physical volumes
|
||||
# and volume groups.
|
||||
${lvm2}/sbin/vgscan --mknodes
|
||||
# Load the device mapper.
|
||||
${modprobe}/sbin/modprobe dm_mod || true
|
||||
|
||||
# Make all logical volumes on all volume groups available, i.e.,
|
||||
# make them appear in /dev.
|
||||
${lvm2}/sbin/vgchange --available y
|
||||
${pkgs.devicemapper}/sbin/dmsetup mknodes
|
||||
# Scan for block devices that might contain LVM physical volumes
|
||||
# and volume groups.
|
||||
${pkgs.lvm2}/sbin/vgscan --mknodes
|
||||
|
||||
initctl emit new-devices
|
||||
|
||||
end script
|
||||
|
||||
";
|
||||
# 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
|
||||
'';
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user