summaryrefslogtreecommitdiffstats
path: root/target/linux/beagleboard/image/gen_image.sh
diff options
context:
space:
mode:
authorryd <ryd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-12-14 10:35:16 +0000
committerryd <ryd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-12-14 10:35:16 +0000
commit3c85d7b8ce3e0640578e7ea1fa849b00e0785f48 (patch)
tree8782483ad54f31b3cac544836a7865c1831ae8ff /target/linux/beagleboard/image/gen_image.sh
parent963ef9554dfbcf7ea5f1ff83363e66812f012ae5 (diff)
Adding Beagleboard support - unfinished
The beagleboard target is still unfinied: running: - MMC Card (incl. boot) - DSS2 graphic driver missing: - full USB Host and Gadget TODO: - improve graphic support - full boot from flash and SD - incl. update - XServer - Gaming support git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18775 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/beagleboard/image/gen_image.sh')
-rwxr-xr-xtarget/linux/beagleboard/image/gen_image.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/beagleboard/image/gen_image.sh b/target/linux/beagleboard/image/gen_image.sh
new file mode 100755
index 000000000..4fd6e377e
--- /dev/null
+++ b/target/linux/beagleboard/image/gen_image.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# Copyright (C) 2006 - 2007 OpenWrt.org
+set -x
+[ $# == 5 ] || {
+ echo "SYNTAX: $0 <file> <kernel size> <kernel directory> <rootfs size> <rootfs image>"
+ exit 1
+}
+
+OUTPUT="$1"
+KERNELSIZE="$2"
+KERNELDIR="$3"
+ROOTFSSIZE="$4"
+ROOTFSIMAGE="$5"
+
+rm -f "$OUTPUT"
+
+head=16
+sect=63
+cyl=$(( ($KERNELSIZE + $ROOTFSSIZE) * 1024 * 1024 / ($head * $sect * 512)))
+
+# create partition table
+set `ptgen -o "$OUTPUT" -h $head -s $sect -p ${KERNELSIZE}m -p ${ROOTFSSIZE}m`
+
+KERNELOFFSET="$(($1 / 512))"
+KERNELSIZE="$(($2 / 512))"
+ROOTFSOFFSET="$(($3 / 512))"
+ROOTFSSIZE="$(($4 / 512))"
+
+BLOCKS="$((($KERNELSIZE / 2) - 1))"
+
+genext2fs -d "$KERNELDIR" -b "$BLOCKS" "$OUTPUT.kernel"
+dd if="$OUTPUT.kernel" of="$OUTPUT" bs=512 seek="$KERNELOFFSET" conv=notrunc
+[ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc count="$ROOTFSSIZE"
+dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc
+#rm -f "$OUTPUT.kernel"