changeset 597:3d67228ceb1e

Rename $NATIVE to $NATIVE_ROOT and allow it to be supplied externally so system-image.sh can package up an arbitrary native root filesystem source dir.
author Rob Landley <rob@landley.net>
date Thu, 22 Jan 2009 17:03:52 -0600
parents c262e2847a28
children 5fa326c07bc4
files mini-native.sh sources/include.sh system-image.sh
diffstat 3 files changed, 15 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/mini-native.sh	Mon Jan 19 22:57:49 2009 -0600
+++ b/mini-native.sh	Thu Jan 22 17:03:52 2009 -0600
@@ -8,7 +8,7 @@
 echo -e "$NATIVE_COLOR"
 echo "=== Building minimal native development environment"
 
-rm -rf "${NATIVE}"
+rm -rf "${NATIVE_ROOT}"
 
 if [ ! -z "${NATIVE_TOOLSDIR}" ]
 then
@@ -16,15 +16,15 @@
 
   # Tell the wrapper script where to find the dynamic linker.
   export UCLIBC_DYNAMIC_LINKER=/tools/lib/ld-uClibc.so.0
-  UCLIBC_TOPDIR="${NATIVE}"
+  UCLIBC_TOPDIR="${NATIVE_ROOT}"
   UCLIBC_DLPREFIX="/tools"
 else
-  mkdir -p "${NATIVE}"/{tmp,proc,sys,dev,etc} || dienow
+  mkdir -p "${NATIVE_ROOT}"/{tmp,proc,sys,dev,etc} || dienow
   UCLIBC_TOPDIR="${TOOLS}"
   for i in bin sbin lib
   do
     mkdir -p "$TOOLS/$i" || dienow
-    ln -s "usr/$i" "${NATIVE}/$i" || dienow
+    ln -s "usr/$i" "${NATIVE_ROOT}/$i" || dienow
   done
 fi
 
--- a/sources/include.sh	Mon Jan 19 22:57:49 2009 -0600
+++ b/sources/include.sh	Thu Jan 22 17:03:52 2009 -0600
@@ -91,14 +91,14 @@
 
   # Setup directories and add the cross compiler to the start of the path.
 
-  export NATIVE="${BUILD}/mini-native-$ARCH"
+  [ -z "$NATIVE_ROOT" ] && export NATIVE_ROOT="${BUILD}/mini-native-$ARCH"
   export PATH="${BUILD}/cross-compiler-$ARCH/bin:$PATH"
 
   if [ ! -z "${NATIVE_TOOLSDIR}" ]
   then
-    TOOLS="${NATIVE}/tools"
+    TOOLS="${NATIVE_ROOT}/tools"
   else
-    TOOLS="${NATIVE}/usr"
+    TOOLS="${NATIVE_ROOT}/usr"
   fi
 else
   HW_ARCH=host
--- a/system-image.sh	Mon Jan 19 22:57:49 2009 -0600
+++ b/system-image.sh	Thu Jan 22 17:03:52 2009 -0600
@@ -53,10 +53,10 @@
   echo "Generating initramfs (in background)"
   $CC usr/gen_init_cpio.c -o my_gen_init_cpio || dienow
   (./my_gen_init_cpio <(
-      "$SOURCES"/toys/gen_initramfs_list.sh "$NATIVE"
-      [ ! -e "$NATIVE"/init ] &&
+      "$SOURCES"/toys/gen_initramfs_list.sh "$NATIVE_ROOT"
+      [ ! -e "$NATIVE_ROOT"/init ] &&
         echo "slink /init /$TOOLSDIR/sbin/init.sh 755 0 0"
-      [ ! -d "$NATIVE"/dev ] && echo "dir /dev 755 0 0"
+      [ ! -d "$NATIVE_ROOT"/dev ] && echo "dir /dev 755 0 0"
       echo "nod /dev/console 660 0 0 c 5 1"
     ) || dienow
   ) | gzip -9 > initramfs_data.cpio.gz || dienow
@@ -83,8 +83,9 @@
   IMAGE=
 elif [ "$SYSIMAGE_TYPE" == "ext2" ]
 then
-  # Generate a 64 megabyte ext2 filesystem image from the $NATIVE directory,
-  # with a temporary file defining the /dev nodes for the new filesystem.
+  # Generate a 64 megabyte ext2 filesystem image from the $NATIVE_ROOT
+  # directory, with a temporary file defining the /dev nodes for the new
+  # filesystem.
 
   echo "Generating ext2 image (in background)"
 
@@ -94,7 +95,7 @@
   echo "/dev d 755 0 0 - - - - -" > "$DEVLIST" &&
   echo "/dev/console c 640 0 0 5 1 0 0 -" >> "$DEVLIST" &&
 
-  genext2fs -z -D "$DEVLIST" -d "${NATIVE}" -i 1024 -b $[64*1024] \
+  genext2fs -z -D "$DEVLIST" -d "${NATIVE_ROOT}" -i 1024 -b $[64*1024] \
     "${SYSIMAGE}/${IMAGE}" &&
   rm "$DEVLIST" || dienow
 
@@ -105,7 +106,7 @@
 
 #  IMAGE="image-${ARCH}.sqf"
 #  echo -n "Creating squashfs image (in background)"
-#  "${WORK}/mksquashfs" "${NATIVE}" "${SYSIMAGE}/$IMAGE" \
+#  "${WORK}/mksquashfs" "${NATIVE_ROOT}" "${SYSIMAGE}/$IMAGE" \
 #    -noappend -all-root -info || dienow
 else
   echo "Unknown image type." >&2