mmdebstrap/run_qemu.sh
Johannes 'josch' Schauer 935f5b7a66
Instead of requiring root, use qemu
- unprivileged creation of rootfs using guestfish
 - allows full control over network, installed packages
 - merged test.sh into coverage.sh
2018-11-21 00:21:43 +01:00

17 lines
637 B
Bash
Executable file

#!/bin/sh
cachedir="./shared/cache"
qemu-img create -f qcow2 -b "$cachedir/debian-unstable.qcow" debian-unstable-overlay.qcow
qemu-system-x86_64 -enable-kvm -m 512M -nographic \
-monitor unix:/tmp/monitor,server,nowait \
-serial unix:/tmp/ttyS0,server,nowait \
-serial unix:/tmp/ttyS1,server,nowait \
-virtfs local,id=mmdebstrap,path="$(pwd)/shared",security_model=none,mount_tag=mmdebstrap \
-drive file=debian-unstable-overlay.qcow,cache=unsafe,index=0
head --lines=-1 shared/result.txt
if [ "$(tail --lines=1 shared/result.txt)" -ne 0 ]; then
echo "test.sh failed"
exit 1
fi
rm debian-unstable-overlay.qcow shared/result.txt