[backfire] targets: rename "files-2.6.x" directories to "files"
[openwrt-10.03/.git] / target / linux / xburst / files / arch / mips / boot / tools / entry
diff --git a/target/linux/xburst/files/arch/mips/boot/tools/entry b/target/linux/xburst/files/arch/mips/boot/tools/entry
new file mode 100644 (file)
index 0000000..376e822
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# grab the kernel_entry address from the vmlinux elf image
+entry=`$1 $2  | grep kernel_entry`
+
+fs=`echo $entry | grep ffffffff`  # check toolchain output
+
+if [ -n "$fs" ]; then
+       echo "0x"`$1 $2  | grep kernel_entry | cut -c9- | awk '{print $1}'`
+else
+       echo "0x"`$1 $2  | grep kernel_entry | cut -c1- | awk '{print $1}'`
+fi