#!/bin/sh
if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ]; then
echo "Usage:" $0 "orignal_image fs_dir new_image"
exit
fi
echo
echo "Original Image:" $1
echo "Your Filesystem:" $2
echo "New Image:" $3
echo
echo "Press 'y' to continue"
read yn
if [ "$yn" = "y" ]; then
# tools/mkcramfs $2 fs.bin
# make -C ./tools/tool/ clean > /dev/null 2>&1
# make -C ./tools/tool/mksquashfs > /dev/null 2>&1
tools/mksquashfs $2 fs.bin -noappend -be -lzma -no-fragments -noI -b 8192
tools/bcmImageBuilder --output bcm963xx_fs_kernel --chip 6348 --board "96348W3" --blocksize 64 --cfefile tools/cfe6348.bin --rootfsfile fs.bin --kernelfile tools/vmlinux.lz
tools/makeImage $3 $1 bcm963xx_fs_kernel
rm -rf fs.bin bcm963xx_fs_kernel
echo $3 "Created!"
else
echo "EXIT!"
fi