# HG changeset patch
# User Rob Landley
# Date 1226632395 21600
# Node ID 3e9d715e4a119dff80600453dc60914ee644aaa6
# Parent cf6d49937be11e7aeb9872e0115317b1e81b562c
Rename CROSS_BUILD_STATIC, NATIVE_NOTOOLSDIR, NATIVE_NOTOOLCHAIN and make them work properly.
diff -r cf6d49937be1 -r 3e9d715e4a11 config
--- 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"
diff -r cf6d49937be1 -r 3e9d715e4a11 cross-compiler.sh
--- 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
diff -r cf6d49937be1 -r 3e9d715e4a11 mini-native.sh
--- 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
diff -r cf6d49937be1 -r 3e9d715e4a11 package-mini-native.sh
--- 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
diff -r cf6d49937be1 -r 3e9d715e4a11 sources/cronjob.sh
--- 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
diff -r cf6d49937be1 -r 3e9d715e4a11 sources/native/bin/qemu-setup.sh
--- 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.)
diff -r cf6d49937be1 -r 3e9d715e4a11 sources/trimconfig-busybox
--- 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
diff -r cf6d49937be1 -r 3e9d715e4a11 www/design.html
--- 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:
-FWL_NO_TOOLCHAIN - 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.
+NATIVE_NOTOOLCHAIN - 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.
-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
+
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.)
-FWL_TOPDIR - Path to the top level directory within the
-native filesystem. If this is blank, configure sets this to a default value
+
NATIVE_NOTOOLSDIR - 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".
@@ -69,7 +69,7 @@
#!/bin/bash type lines at the start of shell scripts.)
-FWL_BUILD_STATIC - Tells cross-compiler.sh to statically link all
+
CROSS_BUILD_STATIC - Tells cross-compiler.sh to statically link all
binaries in the cross compiler toolchain it creates.
The prebuilt binary versions in the download directory are statically linked