mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01:00
lib: use lib.escapeShellArg for concatenated paths
This commit is contained in:
1 parent
ca47da60e5
commit
4be2aadf13
6 files changed
+10
-10
No files matched your search
@@ -20,7 +20,7 @@ let
|
||||
disks = lib.attrValues cfg_.disko.devices.disk;
|
||||
rootDisk = {
|
||||
name = "root";
|
||||
file = ''"$tmp/${(builtins.head disks).name}.qcow2"'';
|
||||
file = ''"$tmp"/${lib.escapeShellArg (builtins.head disks).name}.qcow2'';
|
||||
driveExtraOpts.cache = "writeback";
|
||||
driveExtraOpts.werror = "report";
|
||||
deviceExtraOpts.bootindex = "1";
|
||||
@@ -29,7 +29,7 @@ let
|
||||
otherDisks = map
|
||||
(disk: {
|
||||
name = disk.name;
|
||||
file = ''"$tmp/${disk.name}.qcow2"'';
|
||||
file = ''"$tmp"/${lib.escapeShellArg disk.name}.qcow2'';
|
||||
driveExtraOpts.werror = "report";
|
||||
})
|
||||
(builtins.tail disks);
|
||||
@@ -72,8 +72,8 @@ in
|
||||
trap 'rm -rf "$tmp"' EXIT
|
||||
${lib.concatMapStringsSep "\n" (disk: ''
|
||||
${hostPkgs.qemu}/bin/qemu-img create -f qcow2 \
|
||||
-b "${config.system.build.diskoImages}/${disk.name}.qcow2" \
|
||||
-F qcow2 "$tmp/${disk.name}.qcow2"
|
||||
-b ${config.system.build.diskoImages}/${lib.escapeShellArg disk.name}.qcow2 \
|
||||
-F qcow2 "$tmp"/${lib.escapeShellArg disk.name}.qcow2
|
||||
'') disks}
|
||||
set +f
|
||||
${config.system.build.vm}/bin/run-*-vm
|
||||
|
||||
Reference in new issue
Block a user