forked from M-Labs/nix-scripts
wfvm: wait for VM to terminate instead of killing it
This commit is contained in:
parent
10bb7df7ed
commit
aa0e0517c2
|
@ -186,6 +186,7 @@ let
|
||||||
# Create an image referencing the previous image in the chain
|
# Create an image referencing the previous image in the chain
|
||||||
qemu-img create -f qcow2 -b ${acc} c.img
|
qemu-img create -f qcow2 -b ${acc} c.img
|
||||||
|
|
||||||
|
set -m
|
||||||
qemu-system-x86_64 ${lib.concatStringsSep " " qemuParams} &
|
qemu-system-x86_64 ${lib.concatStringsSep " " qemuParams} &
|
||||||
|
|
||||||
# If the machine is not up within 10 minutes it's likely never coming up
|
# If the machine is not up within 10 minutes it's likely never coming up
|
||||||
|
@ -212,14 +213,18 @@ let
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Executing user script to build layer"
|
echo "Executing user script..."
|
||||||
|
|
||||||
${script}
|
${script}
|
||||||
|
echo "Done"
|
||||||
|
|
||||||
# Allow install to "settle"
|
# Allow install to "settle"
|
||||||
sleep 20
|
sleep 20
|
||||||
|
|
||||||
|
echo "Shutting down..."
|
||||||
win-exec 'shutdown /s'
|
win-exec 'shutdown /s'
|
||||||
|
echo "Waiting for VM to terminate..."
|
||||||
|
fg
|
||||||
|
echo "Done"
|
||||||
|
|
||||||
mv c.img $out
|
mv c.img $out
|
||||||
'')) baseImage installCommands;
|
'')) baseImage installCommands;
|
||||||
|
|
Loading…
Reference in New Issue