Merge pull request #132786 from helsinki-systems/feat/initrd-dm-cache
tasks/lvm: add all tools from thin-provisioning-tools
This commit is contained in:
@@ -46,22 +46,32 @@ in {
|
|||||||
kernelModules = [ "dm-snapshot" "dm-thin-pool" ];
|
kernelModules = [ "dm-snapshot" "dm-thin-pool" ];
|
||||||
|
|
||||||
extraUtilsCommands = ''
|
extraUtilsCommands = ''
|
||||||
copy_bin_and_libs ${pkgs.thin-provisioning-tools}/bin/pdata_tools
|
for BIN in ${pkgs.thin-provisioning-tools}/bin/*; do
|
||||||
copy_bin_and_libs ${pkgs.thin-provisioning-tools}/bin/thin_check
|
copy_bin_and_libs $BIN
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
extraUtilsCommandsTest = ''
|
||||||
|
ls ${pkgs.thin-provisioning-tools}/bin/ | grep -v pdata_tools | while read BIN; do
|
||||||
|
$out/bin/$(basename $BIN) --help > /dev/null
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."lvm/lvm.conf".text = ''
|
environment.etc."lvm/lvm.conf".text = concatMapStringsSep "\n"
|
||||||
global/thin_check_executable = "${pkgs.thin-provisioning-tools}/bin/thin_check"
|
(bin: "global/${bin}_executable = ${pkgs.thin-provisioning-tools}/bin/${bin}")
|
||||||
'';
|
[ "thin_check" "thin_dump" "thin_repair" "cache_check" "cache_dump" "cache_repair" ];
|
||||||
})
|
})
|
||||||
(mkIf (cfg.dmeventd.enable || cfg.boot.thin.enable) {
|
(mkIf (cfg.dmeventd.enable || cfg.boot.thin.enable) {
|
||||||
boot.initrd.preLVMCommands = ''
|
boot.initrd.preLVMCommands = ''
|
||||||
mkdir -p /etc/lvm
|
mkdir -p /etc/lvm
|
||||||
cat << EOF >> /etc/lvm/lvm.conf
|
cat << EOF >> /etc/lvm/lvm.conf
|
||||||
${optionalString cfg.boot.thin.enable ''
|
${optionalString cfg.boot.thin.enable (
|
||||||
global/thin_check_executable = "$(command -v thin_check)"
|
concatMapStringsSep "\n"
|
||||||
''}
|
(bin: "global/${bin}_executable = $(command -v ${bin})")
|
||||||
|
[ "thin_check" "thin_dump" "thin_repair" "cache_check" "cache_dump" "cache_repair" ]
|
||||||
|
)
|
||||||
|
}
|
||||||
${optionalString cfg.dmeventd.enable ''
|
${optionalString cfg.dmeventd.enable ''
|
||||||
dmeventd/executable = "$(command -v false)"
|
dmeventd/executable = "$(command -v false)"
|
||||||
activation/monitoring = 0
|
activation/monitoring = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user