pythonyoctodockerpy

Custom Yocto Recipes not in .bin


I have created 2 .bb files in separate folders in my custom meta folder, and they can be compiled in bitbake. However, when I take the image and use it, the folders are somehow not there and I've built so many times the image that I do not know where to find them or even look for them. I've tried find / -name "folder_name" and it returns nothing

I am at a loss for where it put the folder if it put it at all. I've checked the logs and the image after compiling, and the folder exists in there but in the .bin it simply doesn't

SRCREV_FORMAT = "twin_ditto"

S = "${WORKDIR}/twin-process"

DEPENDS = "python3 python3-requests python3-psutil python3-setuptools"

do_compile() {
    :
}

do_install() {
    install -d ${D}/opt/twin-scripts/

    echo "#!/bin/sh" > ${D}/opt/twin-scripts/automate-twin-docker-setup
    echo "docker pull eclipse-mosquitto" >> ${D}/opt/twin-scripts/automate-twin-docker-setup
    echo "cd ${S}/iwatch/dockerfile && docker build --no-cache -t iwatch_image -f Dockerfile.iwatch ." >> ${D}/opt/twin-scripts/automate-twin-docker-setup
    chmod +x ${D}/opt/twin-scripts/automate-twin-docker-setup
}

FILES:${PN} = "${bindir}/* ${sysconfdir}/init.d/* /opt/twin-scripts/*"

Solution

  • This is not the "prescribed" way to include scripts in a Yocto recipe.

    Be sure your conf/layer.conf knows where to search for the recipe.

    You should create your desired script before you build the Yocto recipe. Let's call it dockerScript.sh.

    meta-mylayer
    ├── conf
    │   └── layer.conf
    └── recipes-core
        └── mylayer-dockerScript
            ├── dockerScript.bb
            └── files
                └── dockerScript.sh
    

    Then, adjust your dockerScript.bb as follows:

    SRC_URI = " \
        file://dockerScript.sh \
    "
        
    do_install () {
        install -d ${D}/opt/twin-scripts/
        install -m 0755 ${WORKDIR}/dockerScript.sh ${D}/opt/twin-scripts/
    }