changeset 482:3e9d715e4a11

Rename CROSS_BUILD_STATIC, NATIVE_NOTOOLSDIR, NATIVE_NOTOOLCHAIN and make them work properly.
author Rob Landley <rob@landley.net>
date Thu, 13 Nov 2008 21:13:15 -0600
parents cf6d49937be1
children 95307c3db92e
files config cross-compiler.sh mini-native.sh package-mini-native.sh sources/cronjob.sh sources/native/bin/qemu-setup.sh sources/trimconfig-busybox www/design.html
diffstat 8 files changed, 39 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/config	Wed Nov 12 23:23:03 2008 -0600
+++ b/config	Thu Nov 13 21:13:15 2008 -0600
@@ -4,7 +4,13 @@
 # and busybox.  (Set it to "headers" to include kernel headers if you'd like
 # to add your own toolchain, such as tinycc.)
 
-# export BUILD_SHORT=1
+# export NATIVE_NOTOOLCHAIN=1
+# export NATIVE_NOTOOLCHAIN=headers
+
+# If this is set, mini-native will built a more conventional filesystem layout
+# instead of a Linux From Scratch style /tools directory.
+
+# export NATIVE_NOTOOLSDIR=1
 
 # If this is set, the build records the command lines run by each build into
 # log files in the build directory, ala "build/cmdlines.$PACKAGENAME"
--- a/cross-compiler.sh	Wed Nov 12 23:23:03 2008 -0600
+++ b/cross-compiler.sh	Thu Nov 13 21:13:15 2008 -0600
@@ -10,7 +10,7 @@
 # Orange
 echo -e "\e[33m"
 
-[ -z "$BUILD_STATIC" ] || STATIC_FLAGS='--static'
+[ -z "$CROSS_BUILD_STATIC" ] || STATIC_FLAGS='--static'
 
 # Build and install binutils
 
--- a/mini-native.sh	Wed Nov 12 23:23:03 2008 -0600
+++ b/mini-native.sh	Thu Nov 13 21:13:15 2008 -0600
@@ -9,7 +9,7 @@
 
 rm -rf "${NATIVE}"
 
-if [ -z "${BUILD_NOTOOLS}" ]
+if [ -z "${NATIVE_NOTOOLSDIR}" ]
 then
   TOOLS="${NATIVE}/tools"
   mkdir -p "${TOOLS}/bin" || dienow
@@ -18,7 +18,7 @@
   export UCLIBC_DYNAMIC_LINKER=/tools/lib/ld-uClibc.so.0
   export UCLIBC_RPATH=/tools/lib
 else
-  mkdir "${NATIVE}"/{tmp,proc,sys,dev,etc} || dienow
+  mkdir -p "${NATIVE}"/{tmp,proc,sys,dev,etc} || dienow
   TOOLS="${NATIVE}/usr"
   for i in bin sbin lib
   do
@@ -106,18 +106,16 @@
 
 cleanup busybox
 
-if [ ! -z "${BUILD_NOTOOLS}" ]
+if [ ! -z "${NATIVE_NOTOOLSDIR}" ]
 then
-
-  sed -i -e 's@/tools/@/usr/@g' -e 's@/bin/bash@/bin/ash@' \
-	"${TOOLS}/bin/qemu-setup.sh" || dienow
+  sed -i -e 's@/tools/@/usr/@g' "${TOOLS}/bin/qemu-setup.sh" || dienow
 fi
 
 # If you want to use tinycc, you need to keep the headers but don't need gcc.
-if [ ! -z "$BUILD_SHORT" ]
+if [ ! -z "$NATIVE_NOTOOLCHAIN" ]
 then
 
-  if [ "$BUILD_SHORT" != "headers" ]
+  if [ "$NATIVE_NOTOOLCHAIN" != "headers" ]
   then
     rm -rf "${TOOLS}"/include &&
     rm -rf "${TOOLS}/src" || dienow
@@ -232,6 +230,10 @@
 
 cleanup make
 
+# Remove the busybox /bin/sh link so the bash install doesn't get upset.
+
+rm "$TOOLS"/bin/sh
+
 # Build and install bash.  (Yes, this is an old version.  I prefer it.)
 # I plan to replace it with toysh anyway.
 
@@ -274,7 +276,7 @@
 
 [ $? -ne 0 ] && dienow
 
-# End of BUILD_SHORT
+# End of NATIVE_NOTOOLCHAIN
 
 fi
 
@@ -282,12 +284,8 @@
 
 "${ARCH}-strip" "${TOOLS}"/{bin/*,sbin/*,libexec/gcc/*/*/*}
 
-cd "${BUILD}"
-#echo -n "Creating tools.sqf"
-#("${WORK}/mksquashfs" "${NATIVE}/tools" "tools-${ARCH}.sqf" \
-#  -noappend -all-root -info || dienow) | dotprogress
-
 echo -n creating mini-native-"${ARCH}".tar.bz2 &&
+cd "${BUILD}" &&
 { tar cjvf "mini-native-${ARCH}.tar.bz2" "mini-native-${ARCH}" || dienow
 } | dotprogress
 
--- a/package-mini-native.sh	Wed Nov 12 23:23:03 2008 -0600
+++ b/package-mini-native.sh	Thu Nov 13 21:13:15 2008 -0600
@@ -129,8 +129,7 @@
        "-hda \"$1\" -kernel \"$2\"" \
        "-append \"root=/dev/$ROOT console=$CONSOLE" \
        "rw init=/tools/bin/qemu-setup.sh panic=1" \
-       'PATH=$DISTCC_PATH_PREFIX/tools/bin $KERNEL_EXTRA"' \
-
+       'PATH=$DISTCC_PATH_PREFIX/tools/bin $KERNEL_EXTRA"'
 }
 
 # Call the appropriate emulator.  We split out the filesystem, kernel, and
@@ -153,7 +152,7 @@
 
   [ $? -ne 0 ] && dienow
 
-  if [ ! -z "$BUILD_SHORT" ]
+  if [ ! -z "$NATIVE_NOTOOLSDIR" ]
   then
     sed -i 's@/tools/@/usr/@g' "system-image-$ARCH"/*.sh || dienow
   fi
--- a/sources/cronjob.sh	Wed Nov 12 23:23:03 2008 -0600
+++ b/sources/cronjob.sh	Thu Nov 13 21:13:15 2008 -0600
@@ -37,7 +37,7 @@
 ./download.sh --extract || exit 1
 for i in \$(cd sources/targets; ls)
 do
-  BUILD_STATIC=1 ./cross-compiler.sh \$i 2>&1 | tee out-toolchain-\$i.txt
+  CROSS_BUILD_STATIC=1 ./cross-compiler.sh \$i 2>&1 | tee out-toolchain-\$i.txt
 done
 EOF
 
--- a/sources/native/bin/qemu-setup.sh	Wed Nov 12 23:23:03 2008 -0600
+++ b/sources/native/bin/qemu-setup.sh	Thu Nov 13 21:13:15 2008 -0600
@@ -1,4 +1,4 @@
-#!/tools/bin/bash
+#!/tools/bin/sh
 
 # If you're doing a Linux From Scratch build, the /tools directory is
 # sufficient.  (Start by installing kernel headers and building a C library.)
--- a/sources/trimconfig-busybox	Wed Nov 12 23:23:03 2008 -0600
+++ b/sources/trimconfig-busybox	Thu Nov 13 21:13:15 2008 -0600
@@ -1,3 +1,9 @@
+# Differences between "allyesconfig" and the config we want.
+
+# Switch on one extra feature
+
+CONFIG_FEATURE_SH_IS_ASH=y
+
 # Switch off inadvisable features and build options.
 
 CONFIG_FEATURE_ASSUME_UNICODE=n
--- a/www/design.html	Wed Nov 12 23:23:03 2008 -0600
+++ b/www/design.html	Thu Nov 13 21:13:15 2008 -0600
@@ -28,18 +28,18 @@
 the behavior of the build:</p>
 
 <ul>
-<li><p><b>FWL_NO_TOOLCHAIN</b> - This tells mini-native.sh not to include a
-compiler toolchain (binutils, gcc, bash, make, and distcc), but instead just
-build a small uClibc/busybox system.</p>
+<li><p><b>NATIVE_NOTOOLCHAIN</b> - This tells mini-native.sh not to
+include a compiler toolchain (binutils, gcc, bash, make, and distcc), but
+instead just build a small uClibc/busybox system.</p>
 
-<p>Setting FWL_NO_TOOLCHAIN="headers" will leave the libc and kernel header
-files in the appropriate include directory, for use by a compiler such as
-pcc, llvm/clang, or tinycc.  (Building and installing additional tools
+<p>Setting NATIVE_NOTOOLCHAIN="headers" will leave the libc and kernel
+header files in the appropriate include directory, for use by a compiler such
+as pcc, llvm/clang, or tinycc.  (Building and installing additional tools
 such as "make" remains your problem.)</p>
 </li>
 
-<li><p><b>FWL_TOPDIR</b> - Path to the top level directory within the
-native filesystem.  If this is blank, configure sets this to a default value
+<li><p><b>NATIVE_NOTOOLSDIR</b> - Path to the top level directory within
+the native filesystem.  If this is blank, configure sets this to a default value
 of "/tools", to act as a Linux From Scratch style chroot environment.  For
 a more traditional filesystem layout, set this to "/" or to "/usr".</p></li>
 
@@ -69,7 +69,7 @@
 #!/bin/bash type lines at the start of shell scripts.)</p>
 </li>
 
-<li><p><b>FWL_BUILD_STATIC</b> - Tells cross-compiler.sh to statically link all
+<li><p><b>CROSS_BUILD_STATIC</b> - Tells cross-compiler.sh to statically link all
 binaries in the cross compiler toolchain it creates.</p>
 
 <p>The prebuilt binary versions in the download directory are statically linked