# HG changeset patch # User Rob Landley # Date 1221521067 18000 # Node ID c2b290c1df404e2738f979eb53faf0e9ac889a68 # Parent f6802733e62700ee27d874dbedbce30166a28a55 Upgrade BUILD_SHORT to make a small busybox+uClibc system in /usr, with top level symlinks (/bin, /lib, etc) and adjustments to boot script and run-emulator. diff -r f6802733e627 -r c2b290c1df40 mini-native.sh --- a/mini-native.sh Tue Aug 26 17:48:32 2008 -0500 +++ b/mini-native.sh Mon Sep 15 18:24:27 2008 -0500 @@ -4,6 +4,9 @@ source include.sh +# Purple. And why not? +echo -e "\e[35m" + rm -rf "${NATIVE}" if [ -z "${BUILD_SHORT}" ] @@ -14,13 +17,16 @@ export UCLIBC_DYNAMIC_LINKER=/tools/lib/ld-uClibc.so.0 export UCLIBC_RPATH=/tools/lib else - TOOLS="${NATIVE}" + TOOLS="${NATIVE}/usr" && + mkdir -p "$TOOLS" && + mkdir "${NATIVE}"/{tmp,proc,sys,dev,etc} && + ln -s usr/bin "${NATIVE}/bin" && + ln -s usr/sbin "${NATIVE}/sbin" && + ln -s usr/lib "${NATIVE}/lib" || dienow fi + mkdir -p "${TOOLS}/bin" || dienow -# Purple. And why not? -echo -e "\e[35m" - # Build and install Linux kernel. setupfor linux @@ -86,10 +92,22 @@ cleanup busybox +# Copy qemu setup script and so on. + +cp -r "${SOURCES}/native/." "${TOOLS}/" || dienow + if [ ! -z "${BUILD_SHORT}" ] then + + sed -i -e 's@/tools/@/usr/@g' -e 's@/bin/bash@/bin/ash@' \ + "${TOOLS}/bin/qemu-setup.sh" || dienow + # If you want to use tinycc, you need to keep the headers but don't need gcc. - [ "$BUILD_SHORT" != "headers" ] && rm -rf "${TOOLS}"/include + if [ "$BUILD_SHORT" != "headers" ] + then + rm -rf "${TOOLS}"/include && + rm -rf "${TOOLS}/src" || dienow + fi else # Build and install native binutils @@ -201,10 +219,6 @@ fi -# Copy qemu setup script and so on. - -cp -r "${SOURCES}/native/." "${TOOLS}/" || dienow - # Clean up and package the result "${ARCH}-strip" "${TOOLS}"/{bin/*,sbin/*,libexec/gcc/*/*/*} diff -r f6802733e627 -r c2b290c1df40 package-mini-native.sh --- a/package-mini-native.sh Tue Aug 26 17:48:32 2008 -0500 +++ b/package-mini-native.sh Mon Sep 15 18:24:27 2008 -0500 @@ -112,6 +112,11 @@ [ $? -ne 0 ] && dienow + if [ ! -z "$BUILD_SHORT" ] + then + sed -i 's@/tools/@/usr/@g' "system-image-$ARCH"/*.sh || dienow + fi + [ "$ARCH" == powerpc ] && cp "$SOURCES"/toys/ppc_rom.bin system-image-$ARCH tar cvjf "$BUILD"/system-image-$ARCH.tar.bz2 system-image-$ARCH }