From 26663e2a5812a2d87f8992636d587b02fe4ce68d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 13 May 2014 04:30:01 +0200 Subject: [PATCH] fedora: Improve error handling --- prepare_image | 4 ++++ qubeize_image | 2 +- scripts_fedora/02_install_groups.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/prepare_image b/prepare_image index facf2e5..d5e747f 100755 --- a/prepare_image +++ b/prepare_image @@ -26,6 +26,7 @@ if [ -f $IMG ]; then echo "-> Image file already exists, assuming *update*..." mount -o loop $IMG mnt || exit 1 export INSTALLDIR=`pwd`/mnt/ + trap "umount $INSTALLDIR" EXIT else echo "-> Initializing empty image..." @@ -39,12 +40,15 @@ else export INSTALLDIR=`pwd`/mnt/ + trap "umount $INSTALLDIR" EXIT + $SCRIPTSDIR/01_install_core.sh fi echo "-> Installing package groups..." $SCRIPTSDIR/02_install_groups.sh +trap - EXIT echo "-> Unmounting prepared_image..." sudo umount $INSTALLDIR diff --git a/qubeize_image b/qubeize_image index 3002c73..6f30e13 100755 --- a/qubeize_image +++ b/qubeize_image @@ -54,7 +54,7 @@ mkdir -p mnt mount -o loop $IMG mnt || exit 1 export INSTALLDIR=mnt -$SCRIPTSDIR/04_install_qubes.sh +$SCRIPTSDIR/04_install_qubes.sh || exit 1 echo "--> Copying the Apps Menu shortcuts..." export APPSORIG=qubeized_images/$NAME-apps.orig diff --git a/scripts_fedora/02_install_groups.sh b/scripts_fedora/02_install_groups.sh index 87734da..0b7a931 100755 --- a/scripts_fedora/02_install_groups.sh +++ b/scripts_fedora/02_install_groups.sh @@ -10,7 +10,7 @@ fi export PKGGROUPS=$(cat $PKGLISTFILE) export YUM0=$PWD/yum_repo_qubes -yum clean all -c $PWD/yum.conf $YUM_OPTS -y --installroot=$PWD/mnt +yum clean all -c $PWD/yum.conf $YUM_OPTS -y --installroot=$INSTALLDIR yum install -c $PWD/yum.conf $YUM_OPTS -y --installroot=$INSTALLDIR $PKGGROUPS || RETCODE=1 yum update -c $PWD/yum.conf $YUM_OPTS -y --installroot=$INSTALLDIR || RETCODE=1