mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 08:00:05 +01:00
more quotes to make shellcheck happy
This commit is contained in:
parent
6d630b8fe4
commit
6da7333a76
6 changed files with 11 additions and 7 deletions
|
|
@ -23,7 +23,7 @@
|
||||||
inherit config options;
|
inherit config options;
|
||||||
default = { dev }: ''
|
default = { dev }: ''
|
||||||
pvcreate ${dev}
|
pvcreate ${dev}
|
||||||
echo "${dev}" >> $disko_devices_dir/lvm_${config.vg}
|
echo "${dev}" >> "$disko_devices_dir"/lvm_${config.vg}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
_mount = diskoLib.mkMountOption {
|
_mount = diskoLib.mkMountOption {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@
|
||||||
_create = diskoLib.mkCreateOption {
|
_create = diskoLib.mkCreateOption {
|
||||||
inherit config options;
|
inherit config options;
|
||||||
default = _: ''
|
default = _: ''
|
||||||
vgcreate ${config.name} $(tr '\n' ' ' < $disko_devices_dir/lvm_${config.name})
|
readarray -t lvm_devices < <(cat "$disko_devices_dir"/lvm_${config.name})
|
||||||
|
vgcreate ${config.name} \
|
||||||
|
"''${lvm_devices[@]}"
|
||||||
${lib.concatMapStrings (lv: lv._create {vg = config.name; }) (lib.attrValues config.lvs)}
|
${lib.concatMapStrings (lv: lv._create {vg = config.name; }) (lib.attrValues config.lvs)}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,14 @@
|
||||||
_create = diskoLib.mkCreateOption {
|
_create = diskoLib.mkCreateOption {
|
||||||
inherit config options;
|
inherit config options;
|
||||||
default = _: ''
|
default = _: ''
|
||||||
|
readarray -t disk_devices < <(cat "$disko_devices_dir"/raid_${config.name})
|
||||||
echo 'y' | mdadm --create /dev/md/${config.name} \
|
echo 'y' | mdadm --create /dev/md/${config.name} \
|
||||||
--level=${toString config.level} \
|
--level=${toString config.level} \
|
||||||
--raid-devices=$(wc -l $disko_devices_dir/raid_${config.name} | cut -f 1 -d " ") \
|
--raid-devices="$(wc -l "$disko_devices_dir"/raid_${config.name} | cut -f 1 -d " ")" \
|
||||||
--metadata=${config.metadata} \
|
--metadata=${config.metadata} \
|
||||||
--force \
|
--force \
|
||||||
--homehost=any \
|
--homehost=any \
|
||||||
$(tr '\n' ' ' < $disko_devices_dir/raid_${config.name})
|
"''${disk_devices[@]}"
|
||||||
udevadm trigger --subsystem-match=block; udevadm settle
|
udevadm trigger --subsystem-match=block; udevadm settle
|
||||||
${lib.optionalString (config.content != null) (config.content._create {dev = "/dev/md/${config.name}";})}
|
${lib.optionalString (config.content != null) (config.content._create {dev = "/dev/md/${config.name}";})}
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
_create = diskoLib.mkCreateOption {
|
_create = diskoLib.mkCreateOption {
|
||||||
inherit config options;
|
inherit config options;
|
||||||
default = { dev }: ''
|
default = { dev }: ''
|
||||||
echo "${dev}" >> $disko_devices_dir/raid_${config.name}
|
echo "${dev}" >> "$disko_devices_dir"/raid_${config.name}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
_mount = diskoLib.mkMountOption {
|
_mount = diskoLib.mkMountOption {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
_create = diskoLib.mkCreateOption {
|
_create = diskoLib.mkCreateOption {
|
||||||
inherit config options;
|
inherit config options;
|
||||||
default = { dev }: ''
|
default = { dev }: ''
|
||||||
echo "${dev}" >> $disko_devices_dir/zfs_${config.pool}
|
echo "${dev}" >> "$disko_devices_dir"/zfs_${config.pool}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
_mount = diskoLib.mkMountOption {
|
_mount = diskoLib.mkMountOption {
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,12 @@
|
||||||
_create = diskoLib.mkCreateOption {
|
_create = diskoLib.mkCreateOption {
|
||||||
inherit config options;
|
inherit config options;
|
||||||
default = _: ''
|
default = _: ''
|
||||||
|
readarray -t zfs_devices < <(cat "$disko_devices_dir"/zfs_${config.name})
|
||||||
zpool create ${config.name} \
|
zpool create ${config.name} \
|
||||||
${config.mode} \
|
${config.mode} \
|
||||||
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
|
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
|
||||||
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-O ${n}=${v}") config.rootFsOptions)} \
|
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-O ${n}=${v}") config.rootFsOptions)} \
|
||||||
$(tr '\n' ' ' < $disko_devices_dir/zfs_${config.name})
|
"''${zfs_devices[@]}"
|
||||||
${lib.concatMapStrings (dataset: dataset._create {zpool = config.name;}) (lib.attrValues config.datasets)}
|
${lib.concatMapStrings (dataset: dataset._create {zpool = config.name;}) (lib.attrValues config.datasets)}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue