changeset 276:b3054103cdd7

Have busybox clean up after itself, and zap old host tool symlinks when rerun.
author Rob Landley <rob@landley.net>
date Wed, 30 Jan 2008 21:37:21 -0600
parents 29372ecebca8
children ffef8c1fe240
files host-tools.sh
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/host-tools.sh	Tue Jan 29 08:21:54 2008 -0600
+++ b/host-tools.sh	Wed Jan 30 21:37:21 2008 -0600
@@ -21,12 +21,18 @@
   cp "${SOURCES}/config-busybox" .config &&
   yes "" | make oldconfig &&
   make &&
-  cp busybox "${HOSTTOOLS}" &&
+  cp busybox "${HOSTTOOLS}"
+
+  [ $? -ne 0 ] && dienow
+
   for i in $(sed 's@.*/@@' busybox.links)
   do
-    ln -s busybox "${HOSTTOOLS}"/$i
+    ln -s busybox "${HOSTTOOLS}"/$i || dienow
   done
-  rm "${HOSTTOOLS}"/{ar,find}
+  cd .. &&
+  $CLEANUP busybox
+
+  [ $? -ne 0 ] && dienow
 fi
 
 # Build toybox
@@ -60,7 +66,7 @@
 CONFIG_EXT2_FS=y
 EOF
   make ARCH=um allnoconfig KCONFIG_ALLCONFIG=mini.conf &&
-  make -j $CPUS ARCH=um &&
+  make -j "$CPUS" ARCH=um &&
   cp linux "${HOSTTOOLS}" &&
   cd .. &&
   $CLEANUP linux
@@ -99,7 +105,8 @@
 
 for i in ar as bzip2 cc cp find gcc install ld make nm od sort
 do
-  [ ! -f "${HOSTTOOLS}/$i" ] && (ln -s `which $i` "${HOSTTOOLS}/$i" || dienow)
+  rm -f "${HOSTTOOLS}/$i"
+  ln -sf `which $i` "${HOSTTOOLS}/$i" || dienow
 done
 
 echo -e "\e[32mHost tools build complete.\e[0m"