Adding custom recipe to core-image-sato reports ERROR: Task do_populate_sdk in core-image-sato.bb rdepends upon nonexistant task do_package_write_rpm

24 views Asked by At

I have created a custom recipe to fetch a git repo and install it in the file system. The repo consists of mainly python scripts so there is nothing to compile or package. I have debugged the recipe using bitbake and the recipe successfully fetches the repo and installs the files I want without errors or warnings. The recipe is as follows...

DESCRIPTION = "Recipe for populating bash/python scripts and services for testing the nova gen2 pcb."
HOMEPAGE = "https://github.com/xxx"
LICENSE = "CLOSED"
SECTION = ""
DEPENDS = ""

#Get the test scripts from the TRC nova gen2 test repo
SRC_URI = "git://[email protected]/xxx.git;protocol=ssh;branch=main"

#SHA of desired commit
SRCREV = "..."

#Override the Build directory location
S = "${WORKDIR}/git"

#Specify destination directory
MY_DESTINATION = "/home/root/toro"

#Put it in the target filesystem
do_install(){
    install -d ${D}${MY_DESTINATION}
    #only copy gen2 folder to the filesystem
    cp -r ${S}/gen2 ${D}${MY_DESTINATION}
}

do_package[noexec] = "1"
do_package_qa[noexec] = "1"
do_package_write_rpm[noexec] = "1"

FILES:${PN} += "${MY_DESTINATION}"

I now attempt to create a recipe to add the above recipe to my image. Within my layer folder, I add a folder called images and put in the following recipe (torohwtest-core-image-sato.bb)...

#Base this recipe on core-image-sato core image
require recipes-sato/images/core-image-sato.bb

DESCRIPTION = "Adds meta-torohwtest layer to core-image-sato"

do_package_write_rpm[noexec] = "1"

IMAGE_INSTALL += "novahwtest"

I then edit my layer.conf file to add to the BBFILES list... ${LAYERDIR}/images/*.bb

I then edit my local.conf file in the build directory to add the following... IMAGE_INSTALL:append = " torohwtest-core-image-sato"

I now do a bitbake core-image-sato to create my appended core-image-sato with addition custom recipe...

When I attempt to bitbake the core-image-sato recipe my expectation is that I generate a new core-image-sato image and then can run as a qemu machine to verify my files are present in the file system.

Instead I get the following error when issuing the bitbake core-image-sato command...

ERROR: Task do_populate_sdk in .../core-image-sato.bb rdepends upon non-existent task do_package_write_rpm in .../torohwtest-core-image-sato.bb ERROR: Command execution failed: 1

Note that I had to override the do_package_write_rpm task in my custom recipe as there is nothing to package, yet I am still getting this error? Any guidance would be appreciated!

1

There are 1 answers

0
RichM On

After some research I found a few problems with my recipe...

  1. Overriding the packaging tasks was a problem. Part of the packaging process looks at files transferred and determines if there are dependencies on other packages in the build. I removed the do_package...[noexec] lines of the recipe
  2. Now that the packaging tasks could run, I get an error indicating that a bash script in my group of files has no RDEPENDS entry in my recipe. Adding a RDEPENDS:${PN} += " bash " line to my recipe fixed this error.
  3. Another error in the recipe related to the do_package_write_rpm task, required setting the SECTION variable to something other than "". Changing SECTION = "base" solved this task error
  4. Make sure that the FILES:${PN} += full/path/to/files/directory so that do_package tasks can work.

Functioning recipe...

DESCRIPTION = "Recipe for populating bash/python scripts and services for 
testing the nova gen2 pcb."
HOMEPAGE = "https://github.com/***"
LICENSE = "CLOSED"
SECTION = "base"
DEPENDS = ""
RDEPENDS:${PN} += " bash "

#Get the test scripts from the TRC nova gen2 test repo
SRC_URI = "git://[email protected]/***.git;protocol=ssh;branch=main"

SHA of desired commit
SRCREV = "..."

#Override the Build directory location
S = "${WORKDIR}/git"

#Specify destination directory
MY_DESTINATION = "/home/root/toro"

#Put it in the target filesystem
do_install(){
    install -d ${D}${MY_DESTINATION}
    #only copy gen2 folder to the filesystem
    cp -r ${S}/gen2 ${D}${MY_DESTINATION}
}

#necessary to allow do_package to work
FILES:${PN} += "${MY_DESTINATION}/gen2"