I am trying to create a meta layer for my application. For testing purposes, I would like to have the Image pre-built with a sample video file. I have seen this answered, but it seems that all the answers I find are deprecated. I am running Yocto Kirkstone.
So, my meta-layer looks like this : video-image.bb
SUMMARY = "Adds usb-uvc capabilities, h264 encoding"
IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
IMAGE_LINGUAS = " "
LICENSE = "MIT"
inherit core-image
# Set rootfs to 1 GB by default
IMAGE_OVERHEAD_FACTOR ?= "1.0"
IMAGE_ROOTFS_SIZE ?= "1003520"
#IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "", d)}"
inherit extrausers
# Change root password (note the capital -P)
EXTRA_USERS_PARAMS = " \
usermod -p '\$6\$11223344\$N9q7Gt5eJJb54sBuR/.7ih8w/OeBBQ8D38FmefDKuTMVM5RbnR07FQayQQWSntbXw/DPpuS781UWLHDTY1lhr1' root; \
"
MY_FILES = "/home/antoine/Downloads/qb_helmet_sample.mp4"
FILES_${PN} += "${datadir}/movies"
FILES_${PN} += "${datadir}/movies/${MY_FILES}"
do_install(){
install -d ${D}${datadir}/movies
install -m 0644 ${MY_FILES} ${D}${datadir}/movies/
}
When I run bitbake video-image, the image is created and I can see the effect of my layer such as the modified root password, but the directory and files are not there. How can I fix this?
video-imageinheritscore-imagewhich itselfinheritsimage.To understand what you did, you need to understand that
recipehas 2 types:A package recipe provides a final package that can be one of the following types:
debrpmipkThis is controlled via the
PACKAGE_CLASSESvariable that you can find in yourlocal.conffile.So, in order to create a package, a list of
tasksare executed bybitbakeon a given recipe.bbfile, it is like cooking a recipe:do_fetch: Download what is inSRC_URIintoDL_DIR(akadownloads)do_unpack: Upacks what is inDL_DIRintoWORKDIRof the recipedo_patch: Apply some patches if.patchfiles found inSRC_URIdo_configure: Do some configuration before compilationdo_compile: The compilation processdo_install: This install files toDwhich isWORKDIR/imagethat specifies what should be go into the final packagedo_package: Do createpackageandpackage-splitfolders for all packages to create of the recipe based on theFILESvariabledo_package_write_<type>: Create the final packages, type is one ofdebrpmipkAlso there are some inter tasks like
do_populate_sysrootanddo_prepare_recipe_sysroot,do_package_qa, ... But it is not important right now.When dealing with
Imagerecipes, there in no task of the previous list.Image recipes are just a collection of
Packagerecipes thatBitbakewill use to create the finalrootfs, hince it has other tasks like:do_rootfsdo_image_<type>type can be one ofIMAGE_FSTYPES(Example:ext4, ..)do_image_completeSo, in order to add something to an image, it means that you need to add a
Packagerecipe to the list that theImagerecipe uses which isIMAGE_INSTALL.In your case:
.bbto install your video filesvideo-recipe_0.1.bbIMPORTANT