Customized image recipe

I created a dedicated image recipe based on “console-trdx-image” which works fine. Now i want to edit the script (via patch) and i want to add an additional u-boot script which should be included in the resulting tarball. What would be the correct way to do so? I do not want to copy the whole “meta-toradex-demos/recipes-images/files/colibiri-imx7” folder, i just want to add/edit. Adding my file to SRC_URI within my image recipe seems not to be sufficent.
Any help would be appreciated.


Note that this use case has not been considered when was added.

The imagedeploytools task in will copy and the U-Boot scripts to ${IMAGE_DIR}/ and ${IMAGE_DIR}/${MACHINE}_bin. One thing which you could do is to append to the imagedeploytools task in your image recipe to change those files or to add additional ones.

I expect that with SRC_URI you could bring a U-Boot script file to ${WORKDIR} and then copy it to ${IMAGE_DIR}/${MACHINE}_bin.

You could use sed or patch to change files e.g. as the following does:

imagedeploytools_append_colibri-imx7 () {
    sed -i 's/\(KERNEL_DEVICETREE\=\"\)/\1imx7d-colibri-vibration.dtb /' ${IMAGE_DIR}/
    sed -i '1s/^/setenv fdt_board vibration ; saveenv \n/' ${IMAGE_DIR}/${MACHINE}_bin/flash_blk.scr