diff root-filesystem.sh @ 849:5dd1a99a0737

Factor out more common code: busybox and toybox builds.
author Rob Landley <rob@landley.net>
date Wed, 14 Oct 2009 15:52:15 -0500
parents 3cd64af0d1b6
children 3794d9a0be4c
line wrap: on
line diff
--- a/root-filesystem.sh	Wed Oct 14 03:51:57 2009 -0500
+++ b/root-filesystem.sh	Wed Oct 14 15:52:15 2009 -0500
@@ -110,41 +110,8 @@
 cp "$SRCDIR"/MANIFEST "$ROOT_TOPDIR/src" &&
 cp "${WORK}/config-${C_LIBRARY}" "$ROOT_TOPDIR/src/config-${C_LIBRARY}" || dienow
 
-# Build and install toybox
-
-setupfor toybox
-make defconfig &&
-if [ -z "$USE_TOYBOX" ]
-then
-  CFLAGS="$CFLAGS $STATIC_FLAGS" make CROSS="${ARCH}-" &&
-  cp toybox "$ROOT_TOPDIR/bin" &&
-  ln -s toybox "$ROOT_TOPDIR/bin/patch" &&
-  ln -s toybox "$ROOT_TOPDIR/bin/oneit" &&
-  ln -s toybox "$ROOT_TOPDIR/bin/netcat"
-else
-  CFLAGS="$CFLAGS $STATIC_FLAGS" \
-    make install_flat PREFIX="$ROOT_TOPDIR"/bin CROSS="${ARCH}-"
-fi
-
-cleanup
-
-# Build and install busybox
-
-setupfor busybox
-make allyesconfig KCONFIG_ALLCONFIG="${SOURCES}/trimconfig-busybox" &&
-cp .config "$ROOT_TOPDIR"/src/config-busybox &&
-LDFLAGS="$LDFLAGS $STATIC_FLAGS" \
-  make -j $CPUS CROSS_COMPILE="${ARCH}-" $VERBOSITY &&
-make busybox.links &&
-cp busybox "$ROOT_TOPDIR/bin" || dienow
-
-for i in $(sed 's@.*/@@' busybox.links)
-do
-  # Allowed to fail.
-  ln -s busybox "$ROOT_TOPDIR/bin/$i" 2>/dev/null || true
-done
-
-cleanup
+STAGE_DIR="$ROOT_TOPDIR"/bin build_section busybox
+cp "$WORK"/config-busybox "$ROOT_TOPDIR"/src || dienow
 
 # Build and install make