One path for qcow2 images

This commit is contained in:
Mikhail Klementev 2018-06-30 19:51:56 +00:00
parent 90a87a0219
commit 9cd51bb13a
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ if [[ "$1" == "build" && "$2" != "" ]]; then
mkdir -p bin mkdir -p bin
sed "s;NIX_SYSTEM_PLACEHOLDER;${NIX_SYSTEM};" qemu/qemu.template > bin/appvm.${2} sed "s;NIX_SYSTEM_PLACEHOLDER;${NIX_SYSTEM};" qemu/qemu.template > bin/appvm.${2}
sed -i "s;NAME_PLACEHOLDER;${2};" bin/appvm.${2} sed -i "s;NAME_PLACEHOLDER;${2};" bin/appvm.${2}
sed -i "s;NIX_DISK_IMAGE_PLACEHOLDER;${APPVM_PATH}/qemu/qcow2/${2}.qcow2;" bin/appvm.${2}
chmod +x bin/appvm.${2} chmod +x bin/appvm.${2}
unlink result unlink result
else else

View File

@ -2,7 +2,7 @@
NAME=NAME_PLACEHOLDER NAME=NAME_PLACEHOLDER
NIX_DISK_IMAGE=$(readlink -f ${NIX_DISK_IMAGE:-./${NAME}.qcow2}) NIX_DISK_IMAGE=NIX_DISK_IMAGE_PLACEHOLDER
if ! test -e "$NIX_DISK_IMAGE"; then if ! test -e "$NIX_DISK_IMAGE"; then
qemu-img create -f qcow2 "$NIX_DISK_IMAGE" 512M || exit 1 qemu-img create -f qcow2 "$NIX_DISK_IMAGE" 512M || exit 1