diff options
author | Holger Levsen <holger@layer-acht.org> | 2012-12-22 11:34:24 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2012-12-22 11:34:24 +0100 |
commit | 268003f88395a34cb741e3b557271979493d4f9c (patch) | |
tree | 10a127227ba7d335d3e388fbadca60c99072f889 /bin | |
parent | 484f100728061ac04ae533975c462dab0913a7c7 (diff) | |
download | jenkins.debian.net-268003f88395a34cb741e3b557271979493d4f9c.tar.xz |
use guestmount to mount installed system and copy the logs away
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/g-i-installation.sh | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh index df5768de..97978f56 100755 --- a/bin/g-i-installation.sh +++ b/bin/g-i-installation.sh @@ -277,7 +277,7 @@ monitor_system() { echo "QEMU was powered down, continuing." break elif [ ! -z "$STACK_LINE" ] ; then - echo "Info: got a stack-trace, probably on power-down." + echo "INFO: got a stack-trace, probably on power-down." break fi fi @@ -318,7 +318,7 @@ monitor_system() { done set -x if [ $NR -eq $MAX_RUNS ] ; then - echo Warning: running for 6h, forceing termination. + echo "Warning: running for 6h, forceing termination." fi if [ -f "$RESULTS/qemu_quit" ] ; then let NR=NR-2 @@ -330,6 +330,24 @@ monitor_system() { cp snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_NR}.ppm.bak } +save_logs() { + # + # get logs from the installed system + # + # remove set +e once the code has proven its good + set +e + SYSTEM_MNT=/media/$NAME + sudo mkdir -p $SYSTEM_MNT + sudo guestmount -o uid=$(id -u) -o gid=$(id -g) -a $NAME.raw -m /dev/debian/root --ro $SYSTEM_MNT || true + if [ -d $SYSTEM_MNT/var/log ] ; then + mkdir -p $RESULTS/log + cp -r $SYSTEM_MNT/var/log/installer $RESULTS/log/ + else + echo "Warning: cannot mount installed system to copy the logs..." + fi + sudo umount -l $SYSTEM_MNT || true +} + trap cleanup_all INT TERM EXIT # @@ -375,6 +393,7 @@ case $JOB_NAME in fi boot_system monitor_system normal + save_logs ;; esac cleanup_all |