1 storcenter_pack_image() {
3 KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/uImage* | tail -1`
4 if [ -z "$KERNEL" ]; then
5 oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Bitbake linux-storcenter to create one."
8 ROOTFS=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2
9 OUTPUT=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flash.img
10 PADFILE=${DEPLOY_DIR_IMAGE}/padfile.zzz
11 HEX_MAX_KERN_SIZE=170000
12 DEC_MAX_KERN_SIZE=`echo "ibase=16; $HEX_MAX_KERN_SIZE" | bc `
13 HEX_MAX_ROOT_SIZE=590000
14 DEC_MAX_ROOT_SIZE=`echo "ibase=16; $HEX_MAX_ROOT_SIZE" | bc `
15 KERNEL_SIZE=`ls -l $KERNEL | awk '{print $5}'`
16 if [ $KERNEL_SIZE -gt $DEC_MAX_KERN_SIZE ]; then
17 oefatal "Kernel too large at $KERNEL_SIZE bytes. Max is $DEC_MAX_KERN_SIZE."
20 ROOT_SIZE=`ls -l $ROOTFS | awk '{print $5}'`
21 if [ $ROOT_SIZE -gt $DEC_MAX_ROOT_SIZE ]; then
22 oefatal "Rootfs is too large at $ROOT_SIZE bytes. Max is $DEC_MAX_ROOT_SIZE."
25 PAD_SIZE=`echo "$DEC_MAX_KERN_SIZE - $KERNEL_SIZE" | bc `
26 dd if=/dev/zero of=$PADFILE bs=$PAD_SIZE count=1 2>>/dev/null
27 cat $KERNEL $PADFILE $ROOTFS > $OUTPUT