summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2013-08-23 07:32:45 +0000
committerbnewbold <bnewbold@robocracy.org>2013-08-23 07:35:12 +0000
commitff6619d3a6833f05311fea1fc256d8154785c53e (patch)
treef5d3006129bb7716578905a74cd52b4bc60f427c /board
parent7dc85612036542d3a0e5bf3f54d7240c4e310d4b (diff)
downloadbuildroot-novena-ff6619d3a6833f05311fea1fc256d8154785c53e.tar.gz
buildroot-novena-ff6619d3a6833f05311fea1fc256d8154785c53e.zip
novena debian: build debian and default images
Diffstat (limited to 'board')
-rwxr-xr-xboard/kosagi/novena/novena_make_debian_rom.sh74
-rwxr-xr-xboard/kosagi/novena/novena_make_rom.sh2
2 files changed, 75 insertions, 1 deletions
diff --git a/board/kosagi/novena/novena_make_debian_rom.sh b/board/kosagi/novena/novena_make_debian_rom.sh
new file mode 100755
index 000000000..de3091f41
--- /dev/null
+++ b/board/kosagi/novena/novena_make_debian_rom.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+# based on: https://github.com/sutajiokousagi/meta-kosagi/blob/novena/conf/machine/include/imx61.inc
+
+set -e # halt on failure
+
+BOARD_DIR="$(dirname $0)"
+
+GENFATFS=$HOST_DIR/usr/bin/genfatfs
+MAKEDISK=$HOST_DIR/usr/bin/makedisk
+
+KERNEL_UIMAGE=$BINARIES_DIR/uImage
+KERNEL_UIMAGE_RENAME=uImage-novena.bin
+KERNEL_DTB=$BINARIES_DIR/imx6q-novena.dtb
+KERNEL_DTB_RENAME=uImage-novena.dtb
+UBOOT_BIN=$BINARIES_DIR/u-boot.imx
+UBOOT_SCR=$BINARIES_DIR/boot.scr
+
+ROOTFS_IMG=$BINARIES_DIR/debian-rootfs.ext4
+
+WORK_DIR=$BASE_DIR/makedisk
+FATFS_BLOCKS=65536
+BOOT_SIZE=32M
+EXT_SIZE=400M # TODO: grab this from a BR2_something environment variable?
+PADDING_SIZE=512k
+FINAL_IMAGE=$BINARIES_DIR/novena-final-debian-image.img
+
+if [ ! -f $MAKEDISK ] ||
+ [ ! -f $GENFATFS ]; then
+ echo "makedisk and/or genfatfs missing."
+ exit 1
+fi
+
+if [ ! -f $KERNEL_UIMAGE ] ||
+ [ ! -f $KERNEL_DTB ]; then
+ echo "Kernel files missing."
+ exit 1
+fi
+
+if [ ! -f $UBOOT_BIN ] ||
+ [ ! -f $UBOOT_SCR ]; then
+ echo "u-boot files missing."
+ exit 1
+fi
+
+if [ ! -f $ROOTFS_IMG ]; then
+ echo "rootfs disk image missing."
+ exit 1
+fi
+
+
+# alright, on with it.
+echo "Partitioning and assembling final image file..."
+set -x # verbose command output
+mkdir -p $WORK_DIR/fat-boot
+cp $UBOOT_BIN $WORK_DIR/fat-boot
+cp $UBOOT_SCR $WORK_DIR/fat-boot
+cp $KERNEL_UIMAGE $WORK_DIR/fat-boot/$KERNEL_UIMAGE_RENAME
+cp $KERNEL_DTB $WORK_DIR/fat-boot/uImage-novena.dtb
+$GENFATFS -d $WORK_DIR/fat-boot -b $FATFS_BLOCKS $WORK_DIR/boot-novena.vfat
+$MAKEDISK -o $FINAL_IMAGE \
+ -p $PADDING_SIZE \
+ -a $BOOT_SIZE:0x0b:$WORK_DIR/boot-novena.vfat \
+ -a $EXT_SIZE:0x83:$ROOTFS_IMG
+dd if=$UBOOT_BIN of=$FINAL_IMAGE bs=512 conv=notrunc seek=2
+rm -rf $WORK_DIR
+
+set +x # verbose command output off
+echo "Created final image file"
+ls -lh $FINAL_IMAGE
+echo "Compressing image..."
+rm -f $FINAL_IMAGE.gz
+gzip $FINAL_IMAGE
+ls -lh $FINAL_IMAGE.gz
+echo "Done, but you should probably run 'sync'."
diff --git a/board/kosagi/novena/novena_make_rom.sh b/board/kosagi/novena/novena_make_rom.sh
index 31ad49aa1..976cc5f8f 100755
--- a/board/kosagi/novena/novena_make_rom.sh
+++ b/board/kosagi/novena/novena_make_rom.sh
@@ -15,7 +15,7 @@ KERNEL_DTB_RENAME=uImage-novena.dtb
UBOOT_BIN=$BINARIES_DIR/u-boot.imx
UBOOT_SCR=$BINARIES_DIR/boot.scr
-ROOTFS_IMG=$BINARIES_DIR/debian-rootfs.ext4
+ROOTFS_IMG=$BINARIES_DIR/rootfs.ext4
WORK_DIR=$BASE_DIR/makedisk
FATFS_BLOCKS=65536