Skip to contentSkip to conversation

make do_symlink_kernelsrc reentrant when S is overriden

PATCH Etienne Cordonnier 1 participant 1 message Dec 16, 2023 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Maybe someone has a better idea for a cleaner fix. The regression was introduced in 2019 by
https://github.com/openembedded/openembedded-core/commit/1ba4728f058b90957741fa016230ffa72e206ff3
which moved do_symlink_kernsrc to a separated task (and hence the do_unpack[cleandirs] value does not apply to do_symlink_kernsrc any more). The reason for moving do_symlink_kernsrc to a separated task was that do_unpack is deleted when EXTERNALSRC is enabled.

Etienne

Quoted 53 lines · Etienne Cordonnier via lists.openembedded.org

From: Etienne Cordonnier <[email protected]>

The function do_symlink_kernsrc is not reentrant in the case where S is defined
to a non-default value. This causes build-failures e.g. when building linux-yocto, then updating
poky to a commit which modifies kernel.bbclass, and then building linux-yocto again.

Bugzilla:
https://urldefense.proofpoint.com/v2/url?u=https-3A__bugzilla.yoctoproject.org_show-5Fbug.cgi-3Fid-3D15325&d=DwIDAg&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=Ajdk4NY7T_6MCYvTdJy8xaozyLd62tWw2RgcDnKF3P9UqWVnuU0Xjffudai_QkNp&s=eRsvoOQpEGvpV51FEvvKLBMPTyDPwytETHxf6kOb8dg&e=

---
 meta/classes-recipe/kernel.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes-recipe/kernel.bbclass +2 -0
index 9ff37f5c38..130bedd901 100644
@@ -194,6 +194,11 @@ python do_symlink_kernsrc () {
             os.symlink(s, kernsrc)
         else:
             import shutil
+            if os.path.islink(s):
+                # this happens for instance when a poky update forces

symlink_kernsrc to run again

meta/classes-recipe/kernel.bbclass +2 -0
+                # after s was already moved to kernsrc
+                bb.warn("%s is already a symlink! Not symlinking kernel

sources" % s)
+ return 0
shutil.move(s, kernsrc)
os.symlink(kernsrc, s)
}
--
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#192561):
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_g_openembedded-2Dcore_message_192561&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=Ajdk4NY7T_6MCYvTdJy8xaozyLd62tWw2RgcDnKF3P9UqWVnuU0Xjffudai_QkNp&s=mP5uWFgfxShkWkndcxPXjXhufEBcQZ1UhqiGIcRO-xc&e=
Mute This Topic:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_mt_103208167_7048771&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=Ajdk4NY7T_6MCYvTdJy8xaozyLd62tWw2RgcDnKF3P9UqWVnuU0Xjffudai_QkNp&s=G6hk_tmVlorFMcsrPHPgc9glxUNVtPi8jPMTlVdqhnE&e=
Group Owner: [email protected] Unsubscribe:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_g_openembedded-2Dcore_unsub&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=Ajdk4NY7T_6MCYvTdJy8xaozyLd62tWw2RgcDnKF3P9UqWVnuU0Xjffudai_QkNp&s=9euKUWB--WIB2phAD28pr5wckGSn48Um--gfmNfvltw&e=
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-