|
|
@ -152,53 +152,9 @@ builddir="$base/src.$pkg.$config.$id" |
|
|
|
|
|
|
|
if [ "$chroot" = 1 ] ; then |
|
|
|
|
|
|
|
"$base/bin/sde-prepare-chroot" -b "$base" "$xroot" || exit 1 |
|
|
|
cd "$xroot" || exit 1 |
|
|
|
|
|
|
|
x_mknod() { |
|
|
|
if [ ! -c "$1" -a ! -b "$1" ]; then |
|
|
|
mknod "$@" |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
mkdir -p dev/loop |
|
|
|
x_mknod dev/null c 1 3 |
|
|
|
x_mknod dev/zero c 1 5 |
|
|
|
x_mknod dev/random c 1 8 |
|
|
|
x_mknod dev/urandom c 1 9 |
|
|
|
x_mknod dev/loop/0 b 7 0 |
|
|
|
x_mknod dev/loop/1 b 7 1 |
|
|
|
x_mknod dev/loop/2 b 7 2 |
|
|
|
x_mknod dev/loop/3 b 7 3 |
|
|
|
#_mknod dev/tty c 5 0 |
|
|
|
|
|
|
|
if [ ! -L dev/fd ]; then |
|
|
|
ln -s /proc/self/fd dev/fd |
|
|
|
fi |
|
|
|
|
|
|
|
realconf=$(cd $base/config; pwd -P) |
|
|
|
realdown=$(cd $base/download; pwd -P) |
|
|
|
realbase=$(dirname $(cd $base/scripts; pwd -P)) |
|
|
|
|
|
|
|
if [ ! -e TOOLCHAIN/loop/scripts ]; then |
|
|
|
mkdir -p TOOLCHAIN/{loop,config,download} |
|
|
|
mount --bind $realbase TOOLCHAIN/loop |
|
|
|
mount --bind $realconf TOOLCHAIN/config |
|
|
|
mount --bind $realdown TOOLCHAIN/download |
|
|
|
fi |
|
|
|
|
|
|
|
if [ ! -f proc/mounts ]; then |
|
|
|
mount -nt proc none proc |
|
|
|
fi |
|
|
|
|
|
|
|
for x in $sderootdirs; do |
|
|
|
if [ ! -e TOOLCHAIN/$x ]; then ln -s "loop/$x" "TOOLCHAIN/$x"; fi |
|
|
|
done |
|
|
|
|
|
|
|
if [ ! -e "TOOLCHAIN/build/$SDECFG_ID" ]; then |
|
|
|
mkdir -p "TOOLCHAIN/build" |
|
|
|
ln -snf ../.. "TOOLCHAIN/build/$SDECFG_ID" |
|
|
|
fi |
|
|
|
|
|
|
|
mkdir -p "TOOLCHAIN/src.$pkg.$config.$id" |
|
|
|
ln -s "$PWD/TOOLCHAIN/src.$pkg.$config.$id" "$builddir" |
|
|
|
|
|
|
@ -209,24 +165,10 @@ if [ "$chroot" = 1 ] ; then |
|
|
|
|
|
|
|
cat > $builddir/debug.sh <<- EOT |
|
|
|
#!/bin/bash |
|
|
|
if [ ! -f "$xroot/proc/mounts" ]; then |
|
|
|
mount -nt proc none "$xroot/proc" |
|
|
|
fi |
|
|
|
if [ ! -e "$xroot/TOOLCHAIN/loop/scripts" ]; then |
|
|
|
mkdir -p "$xroot/"TOOLCHAIN/{loop,config,download} |
|
|
|
mount --bind $realbase "$xroot/TOOLCHAIN/loop" |
|
|
|
mount --bind $realconf "$xroot/TOOLCHAIN/config" |
|
|
|
mount --bind $realdown "$xroot/TOOLCHAIN/download" |
|
|
|
fi |
|
|
|
"$base/bin/sde-prepare-chroot" -b "$base" "$xroot" || exit $? |
|
|
|
|
|
|
|
export ROCK_THIS_IS_CHROOT=1 |
|
|
|
/usr/sbin/chroot "$xroot" /bin/bash TOOLCHAIN/src.$pkg.$config.$id/debug_x.sh |
|
|
|
|
|
|
|
if ! fuser -s "$xroot/TOOLCHAIN/" ; then |
|
|
|
echo "Loop mounts appear unused - un-mounting ..." |
|
|
|
umount -l "$xroot/TOOLCHAIN/"{download,config,loop} |
|
|
|
umount -l "$xroot/proc" |
|
|
|
fi |
|
|
|
EOT |
|
|
|
chmod +x $builddir/debug.sh |
|
|
|
|
|
|
@ -968,9 +910,6 @@ fi |
|
|
|
|
|
|
|
cd $base |
|
|
|
|
|
|
|
umount -r -d -f $builddir/* 2> /dev/null |
|
|
|
umount -r -d -f -l $builddir/* 2> /dev/null |
|
|
|
|
|
|
|
if [ "$SDECFG_SRC_TMPFS_LOG" = 1 -a -n "$( type -p df )" ]; then |
|
|
|
mkdir -p $root/var/adm/sde-debug |
|
|
|
if [ ! -f $root/var/adm/sde-debug/tmpfslog.txt ] ; then |
|
|
@ -984,11 +923,9 @@ if [ "$SDECFG_SRC_TMPFS_LOG" = 1 -a -n "$( type -p df )" ]; then |
|
|
|
expand -t20 >> $root/var/adm/sde-debug/tmpfslog.txt |
|
|
|
fi |
|
|
|
|
|
|
|
umount -r -d -f $builddir 2> /dev/null |
|
|
|
umount -r -d -f -l $builddir 2> /dev/null |
|
|
|
|
|
|
|
if [ -f $root/var/adm/logs/$stagelevel-$xpkg.log ] ; then |
|
|
|
if [ $clear_src = 1 ] ; then |
|
|
|
# TODO: umount if TMPFS |
|
|
|
rm -rf $builddir/* $builddir |
|
|
|
else |
|
|
|
cp $root/var/adm/logs/$stagelevel-$xpkg.out $builddir/BUILD-LOG |
|
|
@ -1001,6 +938,7 @@ if [ -f $root/var/adm/logs/$stagelevel-$xpkg.log ] ; then |
|
|
|
exit 0 |
|
|
|
else |
|
|
|
if [ $clear_src = 1 -a "$SDECFG_ALWAYS_CLEAN" = 1 ] ; then |
|
|
|
# TODO: umount if TMPFS |
|
|
|
rm -rf $builddir/* $builddir |
|
|
|
else |
|
|
|
cp $root/var/adm/logs/$stagelevel-$xpkg.out $builddir/ERROR-LOG |
|
|
|