From 714d7264a620bf7296515a2c2a4ccf852e5b28b2 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 22 Dec 2012 23:12:22 +0100 Subject: for normal boots, start login also if screenshots never match (like in the kdm case which displays a clock) --- bin/g-i-installation.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh index fdad5ec6..d0619b56 100755 --- a/bin/g-i-installation.sh +++ b/bin/g-i-installation.sh @@ -153,7 +153,7 @@ bootstrap_system() { APPEND="auto=true priority=critical $EXTRA_APPEND $INST_LOCALE $INST_KEYMAP $PRESEED_URL $INST_VIDEO -- quiet" show_preseed $(hostname -f)/$PRESEED_PATH/${NAME}_preseed.cfg echo - echo "Starting QEMU_ now:" + echo "Starting QEMU now:" (sudo qemu-system-x86_64 \ $QEMU_OPTS \ $QEMU_KERNEL \ @@ -315,9 +315,8 @@ normal_action() { monitor_system() { MODE=$1 - # FIXME: this is kind of wicked / badly named: - # if called with $2=something, TRIGGER_NR will be 0, thus there will never be any keys pressed.... - TRIGGERED=$2 + # if TRIGGER_MODE is set to a number, triggered mode will be entered in that many steps - else an image match needs to happen + TRIGGER_MODE=$2 TRIGGER_NR=0 cd $RESULTS sleep 4 @@ -381,20 +380,24 @@ monitor_system() { # test if this screenshot is the same as the one 400 screenshots ago if diff -q snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm ; then set -x - # if so and if TRIGGERED != "" - if [ ! -z "$TRIGGERED" ] ; then + # unless TRIGGER_MODE is empty, matching images means its over + if [ ! -z "$TRIGGER_MODE" ] ; then echo "Warning: 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 else # fail next time screenshot matchs - TRIGGERED="true" + TRIGGER_MODE="already_matched" # really kick off trigger: let TRIGGER_NR=NR fi fi fi + # if TRIGGER_MODE matches NR, we are triggered too + if [ ! -z "$TRIGGER_MODE" ] && [ "$TRIGGER_MODE" = "$NR" ] ; then + let TRIGGER_NR=NR + fi let NR=NR+1 sleep 2 done @@ -482,7 +485,7 @@ bootstrap_system case $NAME in *rescue) monitor_system rescue ;; - *) monitor_system install true + *) monitor_system install wait4match ;; esac # @@ -498,7 +501,7 @@ case $NAME in sudo umount -l $IMAGE_MNT || true fi boot_system - monitor_system normal + monitor_system normal 500 save_logs ;; esac -- cgit v1.2.3-70-g09d2