diff options
author | Oyvind Repvik <nail@nslu2-linux.org> | 2007-03-14 01:24:36 +0000 |
---|---|---|
committer | Oyvind Repvik <nail@nslu2-linux.org> | 2007-03-14 01:24:36 +0000 |
commit | 0a15dd95840eb50f20463ae5944a7f48d6276240 (patch) | |
tree | 87edd7ed315c700330ab58dc2a3dd888f5ba61ca | |
parent | e92dbae3de504594606341e10f76c81d12604882 (diff) |
foonas-image: Add n2100 support
-rw-r--r-- | packages/images/foonas-image.bb | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/packages/images/foonas-image.bb b/packages/images/foonas-image.bb index 8d3541c114..f236bbfec4 100644 --- a/packages/images/foonas-image.bb +++ b/packages/images/foonas-image.bb @@ -3,7 +3,9 @@ LICENSE = "GPL" PR = "r0" DEPENDS = "${MACHINE_TASK_PROVIDER}" -EXTRA_IMAGECMD_jffs2 = "--big-endian --eraseblock=${ERASEBLOCK_SIZE} -D ${SLUGOS_DEVICE_TABLE}" +EXTRA_IMAGECMD_turbostation = "--bit-endian" +EXTRA_IMAGECMD_n2100 = "--little-endian" +EXTRA_IMAGECMD_jffs2 += " --eraseblock=${ERASEBLOCK_SIZE} -D ${SLUGOS_DEVICE_TABLE}" IMAGE_LINGUAS = "" # This is passed to the image command to build the correct /dev @@ -37,9 +39,11 @@ IMAGE_TOOLS = "" FOONAS_SUPPORT += "diffutils cpio findutils uboot-utils udev" # this gets /lib/modules made.... -FOONAS_KERNEL = "kernel-module-ext3 kernel-module-minix \ +FOONAS_KERNEL_turbostation = "kernel-module-ext3 kernel-module-minix \ kernel-module-usb-storage" +FOONAS_KERNEL_n2100 = "kernel-module-ext2 kernel-module-usb-storage" + RDEPENDS = " \ base-files base-passwd netbase \ busybox initscripts foonas-init \ @@ -93,3 +97,34 @@ turbostation_pack_image() { rm -f $PADFILE ls -l $OUTPUT } + +n2100_pack_image() { + # find latest kernel + KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/zImage* | tail -1` + if [ -z "$KERNEL" ]; then + oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Bitbake linux to create one." + exit 1 + fi + ROOTFS=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 + OUTPUT=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flash.img + PADFILE=${DEPLOY_DIR_IMAGE}/padfile.zzz + HEX_MAX_KERN_SIZE=1C0000 + DEC_MAX_KERN_SIZE=`echo "ibase=16; $HEX_MAX_KERN_SIZE" | bc ` + HEX_MAX_ROOT_SIZE=DC0000 + DEC_MAX_ROOT_SIZE=`echo "ibase=16; $HEX_MAX_ROOT_SIZE" | bc ` + KERNEL_SIZE=`ls -l $KERNEL | awk '{print $5}'` + if [ $KERNEL_SIZE -gt $DEC_MAX_KERN_SIZE ]; then + oefatal "Kernel too large at $KERNEL_SIZE bytes. Max is $DEC_MAX_KERN_SIZE." + exit 1 + fi + ROOT_SIZE=`ls -l $ROOTFS | awk '{print $5}'` + if [ $ROOT_SIZE -gt $DEC_MAX_ROOT_SIZE ]; then + oefatal "Rootfs is too large at $ROOT_SIZE bytes. Max is $DEC_MAX_ROOT_SIZE." + exit 1 + fi + PAD_SIZE=`echo "$DEC_MAX_KERN_SIZE - $KERNEL_SIZE" | bc ` + dd if=/dev/zero of=$PADFILE bs=$PAD_SIZE count=1 2>>/dev/null + cat $KERNEL $PADFILE $ROOTFS > $OUTPUT + rm -f $PADFILE + ls -l $OUTPUT +}
\ No newline at end of file |