WebHosting Paid by #1Payday.Loans


   The ROCK Linux project has been discontinued in 2010. Here are the old data for the historical record!

?mode=patch&uid=2006091412142817004
Applied Patch: 2006091412142817004 (by blindcoder)
+ blindcoder
Votecheck 'core-strong': Missing 1 qualified vote(s) (clifford, fake, teha)
scripts/Build-Pkg
Benjamin Schieder:
        fix some tmpfs related problems

by blindcoder
fixes problems introduced with [2006091100524749360]
Benjamin Schieder:
        fix some tmpfs related problems
--- scripts/Build-Pkg   (Revision 27)
+++ scripts/Build-Pkg   (Revision 31)
@@ -187,6 +187,16 @@
 export ROCK_PKG=$pkg
 export ROCK_XPKG=$xpkg
 
+mkdir -p "$builddir"; chmod 700 "$builddir"
+
+# This must happen _before_ the FLWRAPPER starts or we get into trouble
+# also before $chroot does anything
+if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+       if ! grep -q "src.$xpkg.$id" /proc/mounts ; then
+               mount -t tmpfs -o $ROCKCFG_SRC_TMPFS_OPT tmpfs "$builddir"
+       fi
+fi
+
 if [ "$chroot" = 1 ] ; then
 
        cd "$xroot" || exit 1
@@ -278,6 +288,9 @@
                mount --bind $realbase $PWD/ROCK/loop
                mount --bind $realconf $PWD/ROCK/config
                mount --bind $realdown $PWD/ROCK/download
+               if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+                       mount --bind $builddir $PWD/ROCK/loop/src.$xpkg.$id
+               fi
        fi
 
        if [ ! -f proc/mounts ]; then
@@ -296,7 +309,6 @@
        # If build is a symlink to somewhere else (NFS share for clusterbuild
        # usually) we do _not_ want to extract our stuff there.
        # Network latency!
-       mkdir -p "$builddir"; chmod 700 "$builddir"
        ln -s loop/src.$xpkg.$id ROCK/src.$xpkg.$id
 
        cat > "$builddir/chroot.sh" <<- EOT
@@ -312,6 +324,9 @@
                        mount --bind $realbase $PWD/ROCK/loop
                        mount --bind $realconf $PWD/ROCK/config
                        mount --bind $realdown $PWD/ROCK/download
+                       if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+                               mount --bind $builddir $PWD/ROCK/loop/src.$xpkg.$id
+                       fi
                fi
                chroot "$xroot" /bin/bash ROCK/src.$xpkg.$id/debug_x.sh
        EOT
@@ -334,8 +349,17 @@
        TZ="/ROCK/localtime" chroot . bin/bash ROCK/src.$xpkg.$id/chroot.sh
        returncode=$?
 
+       if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+               umount $PWD/ROCK/loop/src.$xpkg.$id
+               umount $realbase/src.$xpkg.$id
+       fi
+       umount $PWD/ROCK/loop
+       umount $PWD/ROCK/config
+       umount $PWD/ROCK/download
+       umount $PWD/proc
        # Only remove $builddir if it is empty.
-       rmdir --ignore-fail-on-non-empty "$builddir"
+       rm ROCK/src.$xpkg.$id
+       rmdir --ignore-fail-on-non-empty "$realbase/src.$xpkg.$id"
 
        exit $returncode
 fi
@@ -676,12 +700,6 @@
 
 echo_status "Preparing build in src.$xpkg.$id"
 
-if [ $clear_src = 1 ] ; then
-       if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
-               mount -t tmpfs -o $ROCKCFG_SRC_TMPFS_OPT tmpfs "$builddir"
-       fi
-fi
-
 if [ "$xroot" != "$root" ] ; then
        for x in $flistroot ; do
                [ -d $xroot/$x ] || mkdir -p $xroot/$x
@@ -1244,9 +1262,20 @@
        rm -f $base/build/$ROCKCFG_ID/pseudonative_handler
 fi
 
+if [ "$ROCKCFG_FLIST" = "flwrapper" ] ; then
+       export LD_PRELOAD="${LD_PRELOAD//${FLWRAPPER}/}"
+       export LD_PRELOAD="${LD_PRELOAD//::/:}"
+fi
 if [ -f $root/var/adm/logs/$stagelevel-$xpkg.log ] ; then
        if [ $clear_src = 1 ] ; then
-               rm -rf "$builddir"/* "$builddir"
+               rm -rf "$builddir"/*
+               if [ $stagelevel -lt 2 ] ; then
+# in stages 2-9 the outer Build-Pkg has a fd open in $builddir
+                       if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+                               umount "$builddir"
+                       fi
+                       rmdir "$builddir"
+               fi
        else
                cp $root/var/adm/logs/$stagelevel-$xpkg.out "$builddir/BUILD-LOG"
        fi
@@ -1258,7 +1287,14 @@
        exit 0
 else
        if [ $clear_src = 1 -a "$ROCKCFG_ALWAYS_CLEAN" = 1 ] ; then
-               rm -rf "$builddir"/* "$builddir"
+               rm -rf "$builddir"/*
+               if [ $stagelevel -lt 2 ] ; then
+# in stages 2-9 the outer Build-Pkg has a fd open in $builddir
+                       if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+                               umount "$builddir"
+                       fi
+                       rmdir "$builddir"
+               fi
        else
                cp $root/var/adm/logs/$stagelevel-$xpkg.out "$builddir/ERROR-LOG"
        fi

[Download this patch]