Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79474C00140 for ; Tue, 2 Aug 2022 13:44:12 +0000 (UTC) Subject: BBClass function and symbolic link (symlink) ... I throw in the towel #python #bitbake #kirkstone To: yocto@lists.yoctoproject.org From: "Martin Leduc" X-Originating-Location: Drummondville, Quebec, CA (184.144.158.143) X-Originating-Platform: Windows Chrome 103 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 02 Aug 2022 06:44:02 -0700 Message-ID: Content-Type: multipart/alternative; boundary="a1NZjzyNUARTCYkovBl2" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 02 Aug 2022 13:44:12 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57729 --a1NZjzyNUARTCYkovBl2 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi team, Well,=C2=A0I throw in the towel.=C2=A0 But it's looks like so simple .... f= or me =F0=9F=A4=A3=F0=9F=A4=A3. I've a function to replace the version file in /etc/version.=C2=A0 This fun= ction 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 +=3D " \ 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 valid= ate 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 --a1NZjzyNUARTCYkovBl2 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi team,

Well, I throw in the towel.  But it's looks l= ike so simple .... for me =F0=9F=A4=A3=F0=9F=A4=A3.

I've a funct= ion to replace the version file in /etc/version.  This function is int= egrated 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 +=3D= " \
    set_version_file ; \
"

My function is written like this
set_version_file() {
    bbplain "set_version_fil= e BEGIN"
    mkdir -p ${IMAGE_ROOTFS}= /etc/tmp/
    echo ${PV} > ${IM= AGE_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 do= n'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 tr= y), 
  • from the poky folder I've tried grep -r "ln" ./* | grep bbclass (to val= idate the syntax)
  • Read many posts on this topic

I'm unable to find where is my issue.

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

BR,
Martin --a1NZjzyNUARTCYkovBl2--