What I used to do this was use ROOTFS_POSTPROCESS_COMMAND
variable to add my own shell script functions.
I needed to append the petalinux-user-image in meta-plnx-generated
so in my meta-user
layer, I created the following file: petalinux-user-image.bbappend:
inherit core-image
ROOTFS_POSTPROCESS_COMMAND += "my_install_function; "
my_install_function(){
echo "hello" > ${IMAGE_ROOTFS}/hello.txt
}
What I am trouble with is how do I add files to the ${IMAGE_ROOTFS}
. I can remove/move files/create files, but can't seem to copy files from my meta-user
layer to the ${IMAGE_ROOTFS}
, like with normal recipes where I can install files. The ${WORKDIR}
points the rootfs folders in build, and ${THIS_DIR}
seems to point to the petalinux-user-image in meta-plnx-generated
. I have given the meta-user
layer a higher priority than the meta-plnx-generated
layer, so task order is correct.
Help or ideas would be appreciated, thanks.
The general answer is that you're doing this backwards. The best practice here would be to write recipes for the additional files you want in your image and include those packages in your image. The ROOTFS_POSTPROCESS_COMMAND hook is intended for minor content tweaks.