]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blobdiff - classes/sdcard_image.bbclass
ti-hw-bringup-image: ship musb workaround
[glsdk/meta-ti-glsdk.git] / classes / sdcard_image.bbclass
index 7ab565a609ad3dcd9c1600dd05cfe4f547892064..d7f48a804bf97591b9803076b26d3b9baa513434 100644 (file)
@@ -7,10 +7,17 @@ IMAGE_FSTYPES_append = " tar.bz2 sdimg"
 LOSETUP ?= "/sbin/losetup"
 
 # Since these need to go in /etc/fstab we can hardcode them
+# Since the vars are weakly assigned, you can override them from your local.conf
 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"
+
+BOOTPARTNAME ?= "${MACHINE}"
+
 IMAGE_CMD_sdimg () {
        SDIMG=${WORKDIR}/sd.img
 
@@ -28,7 +35,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=444
+               dd if=/dev/zero of=${SDIMG} bs=$(echo '255 * 63 * 512' | bc) count=${SDIMG_SIZE}
        fi
 
        ${LOSETUP} ${LOOPDEV} ${SDIMG}
@@ -56,7 +63,7 @@ IMAGE_CMD_sdimg () {
 
        ${LOSETUP} ${LOOPDEV_BOOT} ${SDIMG} -o ${BOOT_OFFSET} 
 
-       /sbin/mkfs.msdos ${LOOPDEV_BOOT} -n boot $LOOPDEV_BLOCKS
+       /sbin/mkfs.msdos ${LOOPDEV_BOOT} -n ${BOOTPARTNAME} $LOOPDEV_BLOCKS
 
        # Prepare filesystem partition
        # Copy ubi used by flashing scripts
@@ -91,13 +98,6 @@ IMAGE_CMD_sdimg () {
                cp -v ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.$suffix ${WORKDIR}/tmp-mnt-boot/u-boot.$suffix 
        fi
 
-       # Deprecated, u-boot should load it from ext3 instead
-       if [ -e ${IMAGE_ROOTFS}/boot/uImage ] ; then
-               cp -v ${IMAGE_ROOTFS}/boot/uImage ${WORKDIR}/tmp-mnt-boot
-       else
-               cp -v ${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin ${WORKDIR}/tmp-mnt-boot/uImage
-       fi
-
        # Cleanup VFAT mount
        echo "Cleaning up VFAT mount"
        umount ${WORKDIR}/tmp-mnt-boot