summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorGabriele Giacone <1o5g4r8o@gmail.com>2014-03-16 18:02:48 +0100
committerHolger Levsen <holger@layer-acht.org>2014-04-06 18:21:19 +0200
commit2d5d1845957e807ed1bcdedd6c177e2120d02663 (patch)
tree2748c89ab08c2cfeb3ed336d5fb926ed429960a6 /bin
parent5352cd78afab176bf2b5e428579704d105dfb223 (diff)
downloadjenkins.debian.net-2d5d1845957e807ed1bcdedd6c177e2120d02663.tar.xz
Add serial console to file to hurd VMs.
Hurd lacks ACPI support so it can't poweroff itself. Host polls presence of shutdown string in serial console file to power it off.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/g-i-installation.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh
index cd667d8a..424788eb 100755
--- a/bin/g-i-installation.sh
+++ b/bin/g-i-installation.sh
@@ -239,6 +239,10 @@ boot_system() {
debian-edu*-server)
QEMU_OPTS="$QEMU_OPTS -net nic,vlan=1 -net user,vlan=1"
;;
+ *_hurd*)
+ QEMU_SERIAL_OUT=${WORKSPACE}/serial-out.log
+ QEMU_OPTS="$QEMU_OPTS -serial file:${QEMU_SERIAL_OUT}"
+ ;;
*) ;;
esac
echo
@@ -847,6 +851,15 @@ monitor_system() {
fi
let NR=NR+1
sleep 2
+
+ # Hurd can't poweroff itself
+ if [ -v QEMU_SERIAL_OUT ]; then
+ if grep "In tight loop: hit ctl-alt-del to reboot" $QEMU_SERIAL_OUT >/dev/null; then
+ echo "Powering off Hurd VM ..."
+ sleep 10
+ sudo kill -9 $(ps fax | grep [q]emu-system | grep vnc=$DISPLAY 2>/dev/null | awk '{print $1}')
+ fi
+ fi
done
if [ $NR -eq $MAX_RUNS ] ; then
echo "Warning: running for ${hourlimit}h, forcing termination."