summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/g-i-installation.sh58
-rw-r--r--debian/control2
-rwxr-xr-xupdate_jdn.sh2
3 files changed, 50 insertions, 12 deletions
diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh
index f3249c60..5008b639 100755
--- a/bin/g-i-installation.sh
+++ b/bin/g-i-installation.sh
@@ -119,7 +119,7 @@ bootstrap_system() {
QEMU_KERNEL="--kernel $KERNEL --initrd $INITRD"
fi
QEMU_OPTS="$QEMU_OPTS -drive file=$NAME.raw,index=0,media=disk,cache=writeback -m $RAMSIZE"
- QEMU_OPTS="$QEMU_OPTS -display vnc=$DISPLAY -D $RESULTS/qemu.log -no-shutdown"
+ QEMU_OPTS="$QEMU_OPTS -display vnc=$DISPLAY -d -D $RESULTS/qemu.log -no-shutdown"
QEMU_WEBSERVER=http://10.0.2.2/
# preseeding related variables
PRESEED_PATH=d-i-preseed-cfgs
@@ -162,7 +162,7 @@ boot_system() {
echo "Booting system installed with g-i installation test for $NAME."
# qemu related variables (incl kernel+initrd)
QEMU_OPTS="-drive file=$NAME.raw,index=0,media=disk,cache=writeback -m $RAMSIZE"
- QEMU_OPTS="$QEMU_OPTS -display vnc=$DISPLAY -D $RESULTS/qemu.log -no-shutdown"
+ QEMU_OPTS="$QEMU_OPTS -display vnc=$DISPLAY -d -D $RESULTS/qemu.log -no-shutdown"
echo
echo "Starting QEMU_ now:"
(sudo qemu-system-x86_64 \
@@ -170,7 +170,23 @@ boot_system() {
}
+backup_screensho() {
+ cp snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_NR}.ppm.bak
+}
+
+rescue_action() {
+ case $NR in
+ 700) vncdo -s $DISPLAY key tab
+ backup_screenshot
+ ;;
+ 710) vncdo -s $DISPLAY key enter
+ backup_screenshot
+ ;;
+ esac
+}
+
monitor_system() {
+ MODE=$1
cd $RESULTS
sleep 4
echo "Taking screenshots every 2 seconds now, until qemu ends for whatever reasons or 6h have passed or if the test seems to hang."
@@ -200,19 +216,29 @@ monitor_system() {
fi
# take a screenshot for later publishing
if [ $(($NR % 150)) -eq 0 ] ; then
- cp snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_NR}.ppm.bak
+ backup_screenshot
fi
+ # let's drive this further
+ case $TYPE in
+ rescue) ;; rescue_action $NR
+ esac
+ # test if this screenshot is the same as the one 400 screenshots ago, and if so, let stop this
if [ $(($NR % 100)) -eq 0 ] && [ $NR -gt 400 ] ; then
- # test if this screenshot is the same as the one 400 screenshots ago, and if so, let stop this
# from help let: "Exit Status: If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise."
let OLD=NR-400
PRINTF_OLD=$(printf "%06d" $OLD)
set -x
if diff -q snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm ; then
- echo ERROR snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm match, ending installation.
- ls -la snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm
- figlet "Installation hangs."
- break
+ LAST_LINE_=$(gocr results/snapshot_003600.png|tail -1|cut -d "]" -f2- || true)
+ if [ "$LAST_LINE" = " Power down." ] ; then
+ echo "QEMU was powered down, continuing."
+ backup_screenshot
+ else
+ echo ERROR snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm match, ending installation.
+ ls -la snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm
+ figlet "Installation hangs."
+ break
+ fi
fi
set +x
fi
@@ -252,9 +278,21 @@ else
fetch_if_newer "$KERNEL" "$URL/$KERNEL"
fetch_if_newer "$INITRD" "$URL/$INITRD"
fi
+
+#
+# run g-i
+#
NR=0
bootstrap_system
-monitor_system
+case $JOB_NAME in
+ *rescue) monitor_system rescue
+ ;;
+ *) monitor_system install
+ ;;
+esac
+#
+# boot up installed system
+#
case $JOB_NAME in
*rescue) ;;
*) #
@@ -263,7 +301,7 @@ case $JOB_NAME in
sudo kill -9 $(ps fax | grep [q]emu-system | grep ${NAME}_preseed.cfg 2>/dev/null | awk '{print $1}') || true
if [ ! -z $IMAGE ] ; then sudo umount -l $IMAGE ; fi
boot_system
- monitor_system
+ monitor_system normal
;;
esac
diff --git a/debian/control b/debian/control
index 29471743..299f223b 100644
--- a/debian/control
+++ b/debian/control
@@ -23,7 +23,7 @@ Description: Stuff to setup a jenkins.debian.net instance
Package: jenkins.debian.net-bin
Architecture: all
-Depends:, ${misc:Depends},, debootstrap, sudo, figlet, graphviz, apache2, python-yaml, python-pip, mr, subversion, subversion-tools, vnstat, webcheck, poxml, qemu, vncsnapshot, imagemagick, ffmpeg2theora, python-twisted, python-imaging
+Depends:, ${misc:Depends},, debootstrap, sudo, figlet, graphviz, apache2, python-yaml, python-pip, mr, subversion, subversion-tools, vnstat, webcheck, poxml, qemu, vncsnapshot, imagemagick, ffmpeg2theora, python-twisted, python-imaging, gocr
Description: Stuff to make jenkins.debian.net run and debug
Scripts and configuration files for running and debugging jobs run on
jenkins.debian.net.
diff --git a/update_jdn.sh b/update_jdn.sh
index 3d48e5c3..35526e12 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -25,7 +25,7 @@ done
#
sudo apt-get install vim screen less etckeeper moreutils curl mtr-tiny dstat devscripts bash-completion shorewall shorewall6 cron-apt apt-listchanges munin calamaris visitors procmail libjson-rpc-perl libfile-touch-perl zutils ip2host \
build-essential python-setuptools \
- debootstrap sudo figlet graphviz apache2 python-yaml python-pip mr subversion subversion-tools vnstat webcheck poxml qemu vncsnapshot imagemagick ffmpeg2theora python-twisted python-imaging
+ debootstrap sudo figlet graphviz apache2 python-yaml python-pip mr subversion subversion-tools vnstat webcheck poxml qemu vncsnapshot imagemagick ffmpeg2theora python-twisted python-imaging gocr
explain "Packages installed."
#