3 # This will just pad the kernel partition to 64k boundary, then add rootfs.
4 # but we have to be fancy because u-boot mkimage is going to add 64 byte header.
6 # Copyright (C) 2010 Scott Nicholas <neutronscott@scottn.us>
12 # todo - check arguments...? nah...
13 if [ -x $OUTPUT ]; then
14 echo usage
: $0 loader.bin root.squashfs output.bin
18 OLDSIZE
=$
(stat
-c%s
$PATH_LOADER)
19 NEWSIZE
=$
(((OLDSIZE
/ 65536 + 1) * 65536 - 64))
21 dd if=$PATH_LOADER of
=vmlinuz.tmp bs
=$NEWSIZE conv
=sync
22 cat $PATH_ROOTFS >>vmlinuz.tmp
23 ..
/..
/..
/..
/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
26 printf '\n\nOk done, now your squashfs starts on an erase boundary of %x :)\n\n' $
((NEWSIZE
+64))