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


Martin Leduc <martin.leduc@...>
 

Probably, I don't really know but when I comment the "ln -s" line, using a #, the compilation works. Only the "ln -s" lines

-----Message d'origine-----
De : Joshua Watt <jpewhacker@...>
Envoyé : 2 août 2022 11:10
À : Martin Leduc <martin.leduc@...>
Cc : yocto@...
Objet : [EXTERNAL] Re: [yocto] BBClass function and symbolic link (symlink) ... I throw in the towel #python #bitbake #kirkstone

CAUTION: This email originated from outside of Luminator Technology Group. Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Tue, Aug 2, 2022 at 10:02 AM Martin Leduc <martin.leduc@...> wrote:

Hi Joshua,

I've founded a second function, in the same class, using ln -s

set_log_folder () {
bbplain "Set var log folder BEGIN"
rm -Rf ${IMAGE_ROOTFS}/var/log
ln -s /mnt/general_data/log/ ${IMAGE_ROOTFS}/var/log
bbplain "Set var log folder END"
}

The logs show "Set var log folder BEGIN" and "Set var log folder END" and no issues ....
Your set version function looks like it's running from the logs, so don't think your function is directly causing a problem. My guess is something else later is crashing or something else unrelated?


What the hell I'm doing wrong....


Martin Leduc
T : (418) 856-6896
martin.leduc@...


-----Message d'origine-----
De : yocto@... <yocto@...> De la
part de Martin Leduc via lists.yoctoproject.org Envoyé : 2 août 2022
10:20 À : Joshua Watt <jpewhacker@...> Cc :
yocto@... Objet : Re: [yocto] BBClass function and
symbolic link (symlink) ... I throw in the towel #python #bitbake
#kirkstone

Hi Joshua,

Thank you for your quick reply.

Please see the crash log in the attachment.

"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?"
This bbclass is imported from a previous build make using the Yocto Warrior version and the build report no failure using "ln -s" directly, well it compile.

BR,

-----Message d'origine-----
De : Joshua Watt <jpewhacker@...> Envoyé : 2 août 2022 09:57 À :
Martin Leduc <martin.leduc@...> Cc :
yocto@... Objet : [EXTERNAL] Re: [yocto] BBClass
function and symbolic link (symlink) ... I throw in the towel #python
#bitbake #kirkstone

CAUTION: This email originated from outside of Luminator Technology Group. Do not click links or open attachments unless you recognize the sender and know the content is safe.

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.