Create Yocto Filesystem of type rootfs.img

1.2k views Asked by At

I'm trying to create filesystem of extension rootfs.img from Yocto. Adding IMAGE_FSTYPE="img" is failing, saying img is not recognized because its definition is not defined in any meta class.

I have looked into using wic, but cant find the command that should go in .wks file

Any ways in which I can create rootfs.img (instead of rootfs.tar.gz or rootfs.ext4) in Yocto?

Tried wic & IMAGE_FSTYPES="img"

1

There are 1 answers

0
psy On

Solved it this way : Added function oe_mkimgfs() similar to https://git.yoctoproject.org/poky/tree/meta/classes/image_types.bbclass#n63

Modified mkfs cmd to mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.img -d ${IMAGE_ROOTFS}

Also added other macros :

EXTRA_IMAGECMD_img ?= "-i 4096"
do_image_img[depends] += "e2fsprogs-native:do_populate_sysroot"
RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4 img"

IMAGE_CMD_img = "oe_mkimgfs ext4 ${EXTRA_IMAGECMD}"