kernel.bbclass: keep the sources when do_symlink_kernsrc reruns
PATCH 1/1 kernel.bbclass: keep the sources when do_symlink_kernsrc reruns
With S outside STAGING_KERNEL_DIR, a second do_symlink_kernsrc without do_unpack deletes the sources and leaves STAGING_KERNEL_DIR as a link to itself:
do_kernel_checkout: [Errno 17] File exists: '.../linux-yocto-7.2.13+git'
S is already a symlink to STAGING_KERNEL_DIR by then. Skip the move when the two resolve to the same directory.
[YOCTO #15325]
--- meta/classes-recipe/kernel.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel.bbclass +1 -1
@@ -196,7 +196,7 @@ do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDD python do_symlink_kernsrc () { s = d.getVar("S") kernsrc = d.getVar("STAGING_KERNEL_DIR") - if s != kernsrc: + if os.path.realpath(s) != os.path.realpath(kernsrc): bb.utils.mkdirhier(kernsrc) bb.utils.remove(kernsrc, recurse=True) if s[-1] == '/':
Signature · 1 line
2.43.0
Hi Babanpreet,
are you aware of
https://lists.openembedded.org/g/openembedded-core/topic/103308574?msg=192851#msg192851
? It has some useful context about what I had tried a while ago.
Étienne
Quoted 36 lines · Babanpreet Singh
With S outside
STAGING_KERNEL_DIR, a seconddo_symlink_kernsrcwithoutdo_unpackdeletes the sources and leavesSTAGING_KERNEL_DIRas a link to itself:
do_kernel_checkout: [Errno 17] File exists: '.../linux-yocto-7.2.13+git'S is already a symlink to
STAGING_KERNEL_DIRby then. Skip the move when the two resolve to the same directory.[YOCTO #15325]
Suggested-by Julien Stephan <[email protected]>Signed-off-by Babanpreet Singh <[email protected]>--- meta/classes-recipe/kernel.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/classes-recipe/kernel.bbclass +0
-0@@ -196,7 +196,7 @@ do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR}${B} ${STAGING_KERNEL_BUILDD
pythondo_symlink_kernsrc() {
s =d.getVar("S")
kernsrc =d.getVar("STAGING_KERNEL_DIR")meta/classes-recipe/kernel.bbclass +1
-2- if s != kernsrc: + if os.path.realpath(s) != os.path.realpath(kernsrc): bb.utils.mkdirhier(kernsrc) bb.utils.remove(kernsrc, recurse=True) if s[-1] == '/': --2.43.0
Quoted 3 lines · Etienne Cordonnier
are you aware of
https://lists.openembedded.org/g/openembedded-core/topic/103308574?msg=192851#msg192851
? It has some useful context about what I had tried a while ago.
Hi Étienne,
Yes, I read your v2 to v5 and Richard's review of v5 before writing this. The copy was what he objected to, so this one makes none. When S already resolves to STAGING_KERNEL_DIR it leaves both alone.
Thanks for the pointer.
Baban