changeset 395:c2b290c1df40

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.
author Rob Landley <rob@landley.net>
date Mon, 15 Sep 2008 18:24:27 -0500
parents f6802733e627
children 63dae3cd1163
files mini-native.sh package-mini-native.sh
diffstat 2 files changed, 28 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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/*/*/*}
--- 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
 }