Skip to contentSkip to conversation

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

DISCUSSION Martin Leduc 2 participants 8 messages Aug 2, 2022 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

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.

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

#1 lore raw
Quoted 22 lines · Martin Leduc via lists.yoctoproject.org

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"
}
Quoted 3 lines

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?

Quoted 28 lines

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
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#57729): https://lists.yoctoproject.org/g/yocto/message/57729
Mute This Topic: https://lists.yoctoproject.org/mt/92770329/3616693
Mute #kirkstone:https://lists.yoctoproject.org/g/yocto/mutehashtag/kirkstone Mute #python:https://lists.yoctoproject.org/g/yocto/mutehashtag/python Mute #bitbake:https://lists.yoctoproject.org/g/yocto/mutehashtag/bitbake Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

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 <[email protected]>
Envoyé : 2 août 2022 09:57
À : Martin Leduc <[email protected]>
Cc : [email protected]
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.

Quoted 22 lines · Martin Leduc via lists.yoctoproject.org

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"
}
Quoted 3 lines

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?

Quoted 33 lines

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
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#57729):
https://lists.yoctoproject.org/g/yocto/message/57729
Mute This Topic: https://lists.yoctoproject.org/mt/92770329/3616693
Mute #kirkstone:https://lists.yoctoproject.org/g/yocto/mutehashtag/kirkston e Mute #python:https://lists.yoctoproject.org/g/yocto/mutehashtag/python Mute #bitbake:https://lists.yoctoproject.org/g/yocto/mutehashtag/bitbake Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

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 ....

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

Martin Leduc
T : (418) 856-6896
[email protected]

-----Message d'origine-----
De : [email protected] <[email protected]> De la part de Martin Leduc via lists.yoctoproject.org Envoyé : 2 août 2022 10:20
À : Joshua Watt <[email protected]>
Cc : [email protected]
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 <[email protected]> Envoyé : 2 août 2022 09:57 À : Martin Leduc <[email protected]> Cc : [email protected] 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.

Quoted 22 lines · Martin Leduc via lists.yoctoproject.org

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"
}
Quoted 3 lines

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?

Quoted 19 lines

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

#5 lore raw
Quoted 5 lines · Martin Leduc

Hi Joshua,

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

Quoted 8 lines

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?

Quoted 80 lines

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

Martin Leduc
T : (418) 856-6896
[email protected]

-----Message d'origine-----
De : [email protected] <[email protected]> De la part de Martin Leduc via lists.yoctoproject.org Envoyé : 2 août 2022 10:20
À : Joshua Watt <[email protected]>
Cc : [email protected]
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 <[email protected]> Envoyé : 2 août 2022 09:57 À : Martin Leduc <[email protected]> Cc : [email protected] 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.

Quoted 22 lines · Martin Leduc via lists.yoctoproject.org

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"
}
Quoted 3 lines

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?

Quoted 19 lines

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

#6 lore raw

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 <[email protected]>
Envoyé : 2 août 2022 11:10
À : Martin Leduc <[email protected]>
Cc : [email protected]
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.

Quoted 5 lines · Martin Leduc

Hi Joshua,

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

Quoted 8 lines

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?

Quoted 85 lines

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

Martin Leduc
T : (418) 856-6896
[email protected]

-----Message d'origine-----
De : [email protected] <[email protected]> De la part de Martin Leduc via lists.yoctoproject.org Envoyé : 2 août 2022 10:20 À : Joshua Watt <[email protected]> Cc :
[email protected] 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 <[email protected]> Envoyé : 2 août 2022 09:57 À :
Martin Leduc <[email protected]> Cc :
[email protected] 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.

Quoted 22 lines · Martin Leduc via lists.yoctoproject.org

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"
}
Quoted 3 lines

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?

Quoted 19 lines

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

#7 lore raw
In reply to Joshua Watt

Hi Joshua,

Everything is around the /etc/version file. I know that this file is generated automatically and this is hardcoded in Yocto. I've to check how to found a workaround on this.

Sorry for this.

Have a great day

-----Message d'origine-----
De : Joshua Watt <[email protected]>
Envoyé : 2 août 2022 11:10
À : Martin Leduc <[email protected]>
Cc : [email protected]
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.

Quoted 5 lines · Martin Leduc

Hi Joshua,

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

Quoted 8 lines

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?

Quoted 85 lines

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

Martin Leduc
T : (418) 856-6896
[email protected]

-----Message d'origine-----
De : [email protected] <[email protected]> De la part de Martin Leduc via lists.yoctoproject.org Envoyé : 2 août 2022 10:20 À : Joshua Watt <[email protected]> Cc :
[email protected] 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 <[email protected]> Envoyé : 2 août 2022 09:57 À :
Martin Leduc <[email protected]> Cc :
[email protected] 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.

Quoted 22 lines · Martin Leduc via lists.yoctoproject.org

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"
}
Quoted 3 lines

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?

Quoted 19 lines

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Hi Joshua,

It's 100% my fault, I'm mixed 2 variables:

ROOTFS_POSTPROCESS_COMMAND
IMAGE_POSTPROCESS_COMMAND

My "ln " command have to be placed into IMAGE_POSTPROCESS_COMMAND, not ROOTFS_POSTPROCESS_COMMAND.

Thank you to have answer

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

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 <[email protected]> Envoyé : 2 août 2022 11:10 À : Martin Leduc <[email protected]> Cc : [email protected] 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.

Quoted 5 lines · Martin Leduc

Hi Joshua,

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

Quoted 8 lines

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?

Quoted 85 lines

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

Martin Leduc
T : (418) 856-6896
[email protected]

-----Message d'origine-----
De : [email protected] <[email protected]> De la part de Martin Leduc via lists.yoctoproject.org Envoyé : 2 août 2022 10:20 À : Joshua Watt <[email protected]> Cc :
[email protected] 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 <[email protected]> Envoyé : 2 août 2022 09:57 À :
Martin Leduc <[email protected]> Cc :
[email protected] 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.

Quoted 22 lines · Martin Leduc via lists.yoctoproject.org

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"
}
Quoted 3 lines

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?

Quoted 19 lines

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