changeset 537:15af90157a19

Move the kernel image file from the temp dir into the mini-native dir, and teach packaging not to put it in the ext2 image. (Don't keep important files in the temp directory.)
author Rob Landley <rob@landley.net>
date Sun, 14 Dec 2008 02:03:46 -0600
parents 7b166d9f10c6
children 808ba1d186ac
files mini-native.sh package-mini-native.sh
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mini-native.sh	Sun Dec 14 00:37:19 2008 -0600
+++ b/mini-native.sh	Sun Dec 14 02:03:46 2008 -0600
@@ -43,7 +43,7 @@
 make ARCH="${KARCH}" KCONFIG_ALLCONFIG="$(getconfig linux)" allnoconfig &&
 cp .config "${TOOLS}"/src/config-linux &&
 make -j $CPUS ARCH="${KARCH}" CROSS_COMPILE="${ARCH}-" &&
-cp "${KERNEL_PATH}" "${WORK}/zImage-${ARCH}" &&
+cp "${KERNEL_PATH}" "${NATIVE}/zImage-${ARCH}" &&
 cd ..
 
 cleanup linux
--- a/package-mini-native.sh	Sun Dec 14 00:37:19 2008 -0600
+++ b/package-mini-native.sh	Sun Dec 14 02:03:46 2008 -0600
@@ -22,9 +22,17 @@
 /dev d 755 0 0 - - - - -
 /dev/console c 640 0 0 5 1 0 0 -
 EOF
-genext2fs -z -D "$WORK/devlist" -d "${NATIVE}" -i 1024 -b $[64*1024] "$IMAGE" &&
+mv "$NATIVE/zImage-$ARCH" "$SYSIMAGE" || dienow
+genext2fs -z -D "$WORK/devlist" -d "${NATIVE}" -i 1024 -b $[64*1024] "$IMAGE"
+
+# This little dance is because genext2fs hasn't got --exclude so we have to
+# move the kernel out of the directory, then hardlink it back.
+TEMP=$?
+ln "$SYSIMAGE/zImage-$ARCH" "$NATIVE" || dienow
 rm "$WORK/devlist" || dienow
 
+[ "$TEMP" -ne 0 ] && dienow
+
 # Provide qemu's common command line options between architectures.  The lack
 # of ending quotes on -append is intentional, callers append more kernel
 # command line arguments and provide their own ending quote.
@@ -42,8 +50,7 @@
 # to use an emulator other than qemu, but put the default case in qemu_defaults
 
 cp "$SOURCES/toys/run-emulator.sh" "$SYSIMAGE/run-emulator.sh" &&
-emulator_command image-$ARCH.ext2 zImage-$ARCH >> "$SYSIMAGE/run-emulator.sh" &&
-ln "$WORK/zImage-$ARCH" "$SYSIMAGE"
+emulator_command image-$ARCH.ext2 zImage-$ARCH >> "$SYSIMAGE/run-emulator.sh"
 
 [ $? -ne 0 ] && dienow