sdcard_image bbclass: default to 4GiB, but use 2GiB for beaglebone
authorKoen Kooi <koen@dominion.thruhere.net>
Sat, 15 Oct 2011 11:48:24 +0000 (13:48 +0200)
committerKoen Kooi <koen@dominion.thruhere.net>
Sat, 15 Oct 2011 11:48:24 +0000 (13:48 +0200)
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
classes/sdcard_image.bbclass

index be7ab3b98209495c2eaa2033f48f4e64922a0882..41891fe5adf3d5f8a22d241a1344d834044e0e5d 100644 (file)
@@ -12,6 +12,10 @@ LOOPDEV ?= "/dev/loop1"
 LOOPDEV_BOOT ?= "/dev/loop2"
 LOOPDEV_FS ?= "/dev/loop3"
 
+# Default to 4GiB images, but use 2GiB images for beaglebone
+SDIMG_SIZE ?= "444" 
+SDIMG_SIZE_beaglebone = "222"
+
 IMAGE_CMD_sdimg () {
        SDIMG=${WORKDIR}/sd.img
 
@@ -29,7 +33,7 @@ IMAGE_CMD_sdimg () {
 
        # If an SD image is already present, reuse and reformat it
        if [ ! -e ${SDIMG} ] ; then
-               dd if=/dev/zero of=${SDIMG} bs=$(echo '255 * 63 * 512' | bc) count=222
+               dd if=/dev/zero of=${SDIMG} bs=$(echo '255 * 63 * 512' | bc) count=${SDIMG_SIZE}
        fi
 
        ${LOSETUP} ${LOOPDEV} ${SDIMG}