?mode=patch&uid=2006091315235511321
Discarded Patch: 2006091315235511321 (by blindcoder)
+ blindcoder
Votecheck 'core-strong': Missing 1 qualified vote(s) (clifford, fake, teha)
scripts/Build-Pkg
Benjamin Schieder:
fix some tmpfs related trouble
depends on [2006091100524749360]
still needs more fixin
Benjamin Schieder:
fix some tmpfs related trouble
--- scripts/Build-Pkg (Revision 27)
+++ scripts/Build-Pkg (Arbeitskopie)
@@ -187,6 +187,8 @@
export ROCK_PKG=$pkg
export ROCK_XPKG=$xpkg
+mkdir -p "$builddir"; chmod 700 "$builddir"
+
if [ "$chroot" = 1 ] ; then
cd "$xroot" || exit 1
@@ -296,7 +298,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
@@ -335,11 +336,23 @@
returncode=$?
# Only remove $builddir if it is empty.
- rmdir --ignore-fail-on-non-empty "$builddir"
+ if [ `find "$builddir" | grep -c .` -le 1 ] ; then # only the directory itself. any inodes under the directory will increase to at least 2
+ if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+ umount "$builddir"
+ fi
+ rmdir --ignore-fail-on-non-empty "$builddir"
+ fi
exit $returncode
fi
+# This must happen _before_ the FLWRAPPER starts or we get into trouble
+if [ $clear_src = 1 ] ; then
+ if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+ mount | grep -q "$builddir" || mount -t tmpfs -o $ROCKCFG_SRC_TMPFS_OPT tmpfs "$builddir"
+ fi
+fi
+
if [ "$ROCKCFG_FLIST" = "flwrapper" -a -z "$FLWRAPPER" ] ; then
export FLWRAPPER_WLOG="$builddir/fl_wrapper.wlog"
export FLWRAPPER_RLOG="$builddir/fl_wrapper.rlog"
@@ -676,12 +689,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 +1251,16 @@
rm -f $base/build/$ROCKCFG_ID/pseudonative_handler
fi
+if [ "$ROCKCFG_FLIST" = "flwrapper" ] ; then
+ unset 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 [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+ umount "$builddir"
+ fi
+ rmdir "$builddir"
else
cp $root/var/adm/logs/$stagelevel-$xpkg.out "$builddir/BUILD-LOG"
fi
@@ -1258,7 +1272,11 @@
exit 0
else
if [ $clear_src = 1 -a "$ROCKCFG_ALWAYS_CLEAN" = 1 ] ; then
- rm -rf "$builddir"/* "$builddir"
+ rm -rf "$builddir"/*
+ if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+ umount "$builddir"
+ fi
+ rmdir "$builddir"
else
cp $root/var/adm/logs/$stagelevel-$xpkg.out "$builddir/ERROR-LOG"
fi
[Download this patch]