changeset 262:b2e353ae7566

Have host-tools populate build/host with 1) toybox, 2) all the remaining busybox commands the build can use, 3) symlinks for the other dozen or so commands the build needs. Then set $PATH to _just_ build/host, yanking the rest of the $PATH so it won't call other things from the host. This way, the environmental dependencies are more explicit. (Note that some commands symlinked from the host could be built by busybox, but the busybox versions of those don't work correctly in the build.)
author Rob Landley <rob@landley.net>
date Fri, 25 Jan 2008 03:26:35 -0600
parents 0f962b5609c3
children 4681b51b609a
files build.sh forkbomb.sh host-tools.sh sources/config-busybox
diffstat 4 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/build.sh	Fri Jan 25 03:10:11 2008 -0600
+++ b/build.sh	Fri Jan 25 03:26:35 2008 -0600
@@ -12,7 +12,13 @@
 # Download source code and build host tools.
 
 ./download.sh || exit 1
+
+# host-tools populates one directory with every command the build needs,
+# so we can ditch the old $PATH afterwards.
+
 time ./host-tools.sh || exit 1
+PATH=`pwd`/build/host
+[ -f "$PATH"/toybox ] || exit 1
 
 # Run the steps in order for each architecture listed on the command line
 for i in "$@"
--- a/forkbomb.sh	Fri Jan 25 03:10:11 2008 -0600
+++ b/forkbomb.sh	Fri Jan 25 03:26:35 2008 -0600
@@ -17,7 +17,10 @@
   if [ $# -ne 0 ]
   then
     (nice -n 20 ./download.sh &&
+     # host-tools populates one directory with every command the build needs,
+     # so we can ditch the old $PATH afterwards.
      nice -n 20 ./host-tools.sh &&
+     PATH=`pwd`/build/host &&
      nice -n 20 ./download.sh --extract ) || exit 1
   fi
   for i in `cd sources/configs; ls`
--- a/host-tools.sh	Fri Jan 25 03:10:11 2008 -0600
+++ b/host-tools.sh	Fri Jan 25 03:26:35 2008 -0600
@@ -12,7 +12,6 @@
 NO_ARCH=1
 source include.sh
 
-#rm -rf "${HOSTTOOLS}"
 mkdir -p "${HOSTTOOLS}" || dienow
 
 # Build busybox
@@ -98,4 +97,9 @@
 #  cd .. &&
 #  $CLEANUP qemu-*
 
+for i in ar as cc cp find gcc ld make nm od sort
+do
+  [ ! -f "${HOSTTOOLS}/$i" ] && (ln -s `which $i` "${HOSTTOOLS}/$i" || dienow)
+done
+
 echo -e "\e[32mHost tools build complete.\e[0m"
--- a/sources/config-busybox	Fri Jan 25 03:10:11 2008 -0600
+++ b/sources/config-busybox	Fri Jan 25 03:26:35 2008 -0600
@@ -170,7 +170,7 @@
 # CONFIG_MKNOD is not set
 CONFIG_MV=y
 CONFIG_FEATURE_MV_LONG_OPTIONS=y
-# CONFIG_NICE is not set
+CONFIG_NICE=y
 # CONFIG_NOHUP is not set
 # CONFIG_OD is not set
 # CONFIG_PRINTENV is not set