Re: BBClass function and symbolic link (symlink) ... I throw in the towel #kirkstone #python #bitbake


Joshua Watt
 

On Tue, Aug 2, 2022 at 8:44 AM Martin Leduc via lists.yoctoproject.org
<martin.leduc=luminator.com@...> wrote:

Hi team,

Well, I throw in the towel. But it's looks like so simple .... for me 🤣🤣.

I've a function to replace the version file in /etc/version. This function is integrated into my mybase-image.bbclass, defined in my layer and I add, in my core-image-minimal.bbappend recipe inherit mybase-image.bbclass.

In my bbclass, I call my function using

ROOTFS_POSTPROCESS_COMMAND += " \
set_version_file ; \
"

My function is written like this
set_version_file() {
bbplain "set_version_file BEGIN"
mkdir -p ${IMAGE_ROOTFS}/etc/tmp/
echo ${PV} > ${IMAGE_ROOTFS}/etc/tmp/version
chmod 644 ${IMAGE_ROOTFS}/etc/tmp/version
rm ${IMAGE_ROOTFS}/etc/version
ln -sf /etc/tmp/version "${IMAGE_ROOTFS}/etc/version"
}
Note: /etc/tmp is just for the purpose of this test

I mean, I don't try to do anything outstanding but the ln -sf line makes my compilation crash BUT.... it works like a charm with Warrior but Kirkstone rejects "ln -sf" command.
Can you provide a little more detail about how it crashes? Also, I'm
not quite clear what you mean by "works like a charm with Warrior"; it
sounds like something still isn't working in Warrior that you need, or
just in Kirkstone?


I'm definitely not the only one who adds symlinks to the recipes

I've also tried:

lnr
inherit relative_symlinks (don't have any impact but I've given it a try),
from the poky folder I've tried grep -r "ln" ./* | grep bbclass (to validate the syntax)
Read many posts on this topic


I'm unable to find where is my issue.

Any ideas are welcome, even if it works like a charm on Warrior but not in Kirkstone.

BR,
Martin

Join yocto@lists.yoctoproject.org to automatically receive all group messages.