[PATCH rhel 5.4] Make buildinstall error-out on failed loop mount, propagate status (#472552)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I forgot to check mk-images exit status in buildinstall in previous patch.
---
 scripts/buildinstall |    2 ++
 scripts/mk-images    |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/buildinstall b/scripts/buildinstall
index 072f8bf..efb754f 100755
--- a/scripts/buildinstall
+++ b/scripts/buildinstall
@@ -161,6 +161,8 @@ $MK_TREEINFO --family="$PRODUCTSTR" ${VARIANT:+--variant="$VARIANT"} --version=$
 
 echo "Making images..."
 $MK_IMAGES $DEBUGSTR $NOGRSTR $PKGDIR $p $TREEDIR/image-template $TREEDIR/instimage $BUILDARCH "$PRODUCTSTR" $VERSION $PRODUCTPATH "$BUGURL"
+rc=$?
+[ $rc = 0 ] || exit $rc
 
 echo "Writing .discinfo file"
 $MK_STAMP --releasestr="$RELEASESTR" --arch=$BUILDARCH --discNum="$DISCSTR" --baseDir=$PRODUCTPATH/base --packagesDir=$PKGDIR --pixmapsDir=$PRODUCTPATH/pixmaps --outfile=$p/.discinfo
diff --git a/scripts/mk-images b/scripts/mk-images
index 48ba567..8bd4790 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -746,7 +746,8 @@ makemainimage () {
         mke2fs -q -F $mmi_tmpimage > /dev/null 
 	tune2fs -c0 -i0 $mmi_tmpimage >/dev/null
         mount -o loop $mmi_tmpimage $mmi_mntpoint
-        [ $? = 0 ] || return $?
+        rc=$?
+        [ $rc = 0 ] || return $rc
 
         (cd $IMGPATH; find . | fgrep -v "./usr/lib/anaconda-runtime" |
 	        cpio -H crc -o) | (cd $mmi_mntpoint; cpio -iumd)
@@ -783,7 +784,8 @@ makeSecondStage() {
     [ $? = 0 ] || exit 1
     echo "Building stage2.img"
     makemainimage "stage2" "squashfs"
-    [ $? = 0 ] || exit 1
+    rc=$?
+    [ $rc = 0 ] || exit $rc
 }
 
 doPostImages() {
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux