bitbake - How to format partitions for Yocto sdcard image for Variscite iMX6 -
i looking @ generating own image_fstypes=sdcard
image freescale variscite var-som-mx6. have copied meta-fsl-arm/classes/image_types_fsl.bbclass
class , modified there 3 partitions rather two. looking include third partition formatted fat (vfat) files can added onto sdcard not sit alongside files in boot partition or root file system.
i have made additions generate_imx_sdcard()
function create new partition:
generate_imx_sdcard () { # create partition table parted -s ${sdcard} mklabel msdos parted -s ${sdcard} unit kib mkpart primary fat32 ${image_rootfs_alignment} $(expr ${image_rootfs_alignment} \+ ${boot_space_aligned}) parted -s ${sdcard} unit kib mkpart primary $(expr ${image_rootfs_alignment} \+ ${boot_space_aligned}) $(expr ${image_rootfs_alignment} \+ ${boot_space_aligned} \+ $rootfs_size) # line below new partition have added parted -s ${sdcard} unit kib mkpart primary fat32 $(expr ${image_rootfs_alignment} \+ ${boot_space_aligned} \+ $rootfs_size) $(expr ${image_rootfs_alignment} \+ ${boot_space_aligned} \+ $rootfs_size \+ ${third_partition}) parted ${sdcard} print
i have ensured total sdcard side accommodates including this, add new partition size ${third_partition}
total sdcard (device) size:
image_cmd_sdcard () { if [ -z "${sdcard_rootfs}" ]; bberror "sdcard_rootfs undefined. use sdcard image freescale's bsp needs defined." exit 1 fi # align boot partition , calculate total sd card image size boot_space_aligned=$(expr ${boot_space} + ${image_rootfs_alignment} - 1) boot_space_aligned=$(expr ${boot_space_aligned} - ${boot_space_aligned} % ${image_rootfs_alignment}) sdcard_size=$(expr ${image_rootfs_alignment} + ${boot_space_aligned} + $rootfs_size + ${image_rootfs_alignment} + ${third_partition})
when bitbake layer , burn output sdcard image sd card, partitions appropriately sized , available question/problem have is, how format newly created partition?
i understand regular method of doing along lines of mkfs.vfat -n "partition name" /dev/sdd
, supply device, unsure how go in yocto there no device identifier, ${sdcard}
variable. understand if partition formatted ext4 file system possible provide offsets formatting seems there no option if wanted formatted vfat.
any appreciated.
from point of view, way used in image_types_fsl.bbclass generate sd card image little complicated , error-prone if want edit it.
i suggest use wic create image instead.
wiki
Comments
Post a Comment