[yocto] Custom image type with dependencies

Jef Driesen jef.driesen at niko.eu
Mon Oct 1 06:51:50 PDT 2018


Hi,

We use a gpg signed tarball as our image format. This is implemented 
using CONVERSIONTYPES:

CONVERSIONTYPES += "gpg"
CONVERSION_CMD_gpg = "gpg --batch --yes -s ${IMAGE_NAME}.rootfs.${type}"
CONVERSION_DEPENDS_gpg = "gnupg"

And then in the image recipe:

IMAGE_FSTYPES += "tar tar.gpg"

This works, except for one thing. The above is a simplification and the 
actual signing is done by a script. It does not only sign the tarball, 
but also adds a few extra files.

But how do I fetch the script, and those extra files? I tried to use 
SRC_URI, as you would do in a regular recipe. But that doesn't work 
because image.bbclass contains:

do_fetch[noexec] = "1"

Next, I tried to create a native "gpgsign" recipe containing my script 
and its dependencies. I then added the dependency:

CONVERSION_DEPENDS_gpg = "gpgsign-native"

assuming it would put my script in the native sysroot of the image. But 
that doesn't seem to work. The only thing that happens are some 
gpgsign-native files in these directories:

./recipe-sysroot-native/installeddeps/
./recipe-sysroot-native/sysroot-providers/

But no files are added in:

./recipe-sysroot-native/

If I do the same with for example xz-native, then the xz binaries are 
added to the native sysroot, and then compressing the image works fine. 
But not for my gpg signing.

What am I doing wrong?

Jef


More information about the yocto mailing list