1
votes

I would like to add pre-built ipk package to the final image using Yocto at build time. What should be the correct workflow for this?

What I have tried:

1) As suggested here I used bin_package class and added ipk package to the SRC_URI

inherit bin_package
...
SRC_URI = "file://test.ipk;subdir=test-1.0"

This unpacks the package and repack it again. Unfortunately it omitted some control scripts, etc. when unpacking to work directory. Don't know why? With additional small modifications I got some usable solution, but I doubt that this is correct approach.

2) Use the package in original form and install it directly to rootfs I tried something like this

inherit deploy

SRC_URI = "file://test.ipk;unpack=0"

do_deploy() {
  install -D ${WORKDIR}/test.ipk ${DEPLOY_DIR_IPK}/test.ipk
}

addtask deploy after do_compile

I don't know if I can just copy package to e.g. "${DEPLOY_DIR_IPK}" and how to let Yocto know that the package is available and that I could use "IMAGE_INSTALL_append += "test"" to have it installed in the image.

Thanks for inputs!

1

1 Answers

0
votes

To be honest I don't understand the first solution, secondly according to the documentation about do_deploy task : https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#ref-tasks-deploy Why don't you use do_install ?

I'm not an expert but I think you should maybe try something like that:

SUMMARY = "sample recipe"
LICENSE = "CLOSED"

SRC_URI = "file://test.ipk;unpack=0"

do_install () {
    install -d ${D}${foobar}
    install -m 0755 ${WORKDIR}/test.ipk ${D}${foobar}
}