fedora: improve error handling
Make sure that all partitions got unmounted.
This commit is contained in:
parent
6fcc7ad060
commit
32ed8052bf
@ -48,13 +48,13 @@ export IMG=qubeized_images/$NAME-root.img
|
|||||||
echo "--> Copying $CLEANIMG to $IMG..."
|
echo "--> Copying $CLEANIMG to $IMG..."
|
||||||
cp $CLEANIMG $IMG || exit 1
|
cp $CLEANIMG $IMG || exit 1
|
||||||
|
|
||||||
echo "--> Mouting $IMG"
|
echo "--> Mounting $IMG"
|
||||||
|
|
||||||
mkdir -p mnt
|
mkdir -p mnt
|
||||||
mount -o loop $IMG mnt || exit 1
|
mount -o loop $IMG mnt || exit 1
|
||||||
export INSTALLDIR=mnt
|
export INSTALLDIR=mnt
|
||||||
|
|
||||||
$SCRIPTSDIR/04_install_qubes.sh || exit 1
|
$SCRIPTSDIR/04_install_qubes.sh || { umount $INSTALLDIR; exit 1; }
|
||||||
|
|
||||||
echo "--> Copying the Apps Menu shortcuts..."
|
echo "--> Copying the Apps Menu shortcuts..."
|
||||||
export APPSORIG=qubeized_images/$NAME-apps.orig
|
export APPSORIG=qubeized_images/$NAME-apps.orig
|
||||||
|
@ -2,12 +2,14 @@
|
|||||||
echo "--> Preparing environment..."
|
echo "--> Preparing environment..."
|
||||||
mount -t proc proc $PWD/mnt/proc
|
mount -t proc proc $PWD/mnt/proc
|
||||||
|
|
||||||
|
trap "umount $PWD/mnt/proc" EXIT
|
||||||
|
|
||||||
|
export YUM0=$PWD/yum_repo_qubes
|
||||||
if [ "$TEMPLATE_FLAVOR" == "minimal" ]; then
|
if [ "$TEMPLATE_FLAVOR" == "minimal" ]; then
|
||||||
YUM_OPTS="$YUM_OPTS --group_package_types=mandatory"
|
YUM_OPTS="$YUM_OPTS --group_package_types=mandatory"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "--> Installing RPMs..."
|
echo "--> Installing RPMs..."
|
||||||
export YUM0=$PWD/yum_repo_qubes
|
|
||||||
yum install -c $PWD/yum.conf $YUM_OPTS -y --installroot=$(pwd)/mnt @qubes-vm || RETCODE=1
|
yum install -c $PWD/yum.conf $YUM_OPTS -y --installroot=$(pwd)/mnt @qubes-vm || RETCODE=1
|
||||||
|
|
||||||
rpm --root=$PWD/mnt --import $PWD/mnt/etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-*
|
rpm --root=$PWD/mnt --import $PWD/mnt/etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-*
|
||||||
@ -17,6 +19,4 @@ if [ "$TEMPLATE_FLAVOR" != "minimal" ]; then
|
|||||||
$SCRIPTSDIR/add_3rd_party_software.sh || RETCODE=1
|
$SCRIPTSDIR/add_3rd_party_software.sh || RETCODE=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
umount $PWD/mnt/proc
|
|
||||||
|
|
||||||
exit $RETCODE
|
exit $RETCODE
|
||||||
|
Loading…
Reference in New Issue
Block a user