From 7592e73bacd0deaf81c61daf22b89f6b2b584870 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 6 Nov 2010 18:54:20 +0000 Subject: Merge branch 'adm8668' git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23900 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/adm8668/image/my-mkimage | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 target/linux/adm8668/image/my-mkimage (limited to 'target/linux/adm8668/image/my-mkimage') diff --git a/target/linux/adm8668/image/my-mkimage b/target/linux/adm8668/image/my-mkimage new file mode 100755 index 0000000000..7012d7b975 --- /dev/null +++ b/target/linux/adm8668/image/my-mkimage @@ -0,0 +1,26 @@ +#!/bin/sh +# my-mkimage +# This will just pad the kernel partition to 64k boundary, then add rootfs. +# but we have to be fancy because u-boot mkimage is going to add 64 byte header. +# +# Copyright (C) 2010 Scott Nicholas + +PATH_LOADER=$1 +PATH_ROOTFS=$2 +OUTPUT=$3 + +# todo - check arguments...? nah... +if [ -x $OUTPUT ]; then + echo usage: $0 loader.bin root.squashfs output.bin + exit +fi + +OLDSIZE=$(stat -c%s $PATH_LOADER) +NEWSIZE=$(((OLDSIZE / 65536 + 1) * 65536 - 64)) + +dd if=$PATH_LOADER of=vmlinuz.tmp bs=$NEWSIZE conv=sync +cat $PATH_ROOTFS >>vmlinuz.tmp +../../../../staging_dir/host/bin/mkimage -A mips -O linux -T kernel -C none -a 0x400000 -e 0x400000 -n "ADM8668 Linux Kernel(2.4.31)" -d vmlinuz.tmp $OUTPUT +rm vmlinuz.tmp + +printf '\n\nOk done, now your squashfs starts on an erase boundary of %x :)\n\n' $((NEWSIZE+64)) -- cgit v1.2.3