summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/image_types_sdcard.bbclass19
1 files changed, 19 insertions, 0 deletions
diff --git a/classes/image_types_sdcard.bbclass b/classes/image_types_sdcard.bbclass
index e9b07f1..6c0850f 100644
--- a/classes/image_types_sdcard.bbclass
+++ b/classes/image_types_sdcard.bbclass
@@ -47,3 +47,22 @@ build_hddimg_append() {
47 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.img 47 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.img
48 ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.img 48 ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.img
49} 49}
50
51IMAGE_DEPENDS_tegraflash_append = " parted-native:do_populate_sysroot"
52create_tegraflash_pkg_prepend() {
53 # Create partition table
54 SDCARD=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.img
55 SDCARD_ROOTFS=${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ext3
56 SDCARD_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + $ROOTFS_SIZE + ${IMAGE_ROOTFS_ALIGNMENT})
57
58 dd if=/dev/zero of=${SDCARD} bs=1 count=0 seek=$(expr 1024 \* ${SDCARD_SIZE})
59
60 parted -s ${SDCARD} mklabel msdos
61 parted -s ${SDCARD} unit KiB mkpart primary ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${ROOTFS_SIZE})
62 parted ${SDCARD} print
63
64 dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
65
66 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.img
67 ln -s ${IMAGE_NAME}.img ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.img
68}