lvm_vg: fix size=100% leading to crash

lvcreate -l does not accept a '100%' parameter which currently leads to a crash. THis change automatically changes `100%` to `100%FREE` leading to the intended behavior.
This commit is contained in:
DavHau authored and mergify[bot] committed 2024-10-26 11:42:42 +00:00
1 parent 09a776702b
commit 58cd832497
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@
type = "lvm_vg";
lvs = {
root = {
size = "100M";
size = "100%";
content = {
type = "filesystem";
format = "ext4";
+1 -1
View File
@@ -95,7 +95,7 @@ in
--yes \
${if (lv.lvm_type == "thinlv") then "-V"
else if lib.hasInfix "%" lv.size then "-l" else "-L"} \
${lv.size} \
${if lib.hasSuffix "%" lv.size then "${lv.size}FREE" else lv.size} \
-n "${lv.name}" \
${lib.optionalString (lv.lvm_type == "thinlv") "--thinpool=${lv.pool}"} \
${lib.optionalString (lv.lvm_type != null && lv.lvm_type != "thinlv") "--type=${lv.lvm_type}"} \