Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Babanpreet Singh <bbnpreetsingh@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>,
	Richard Purdie <richard.purdie@linuxfoundation.org>,
	Etienne Cordonnier <ecordonnier@snap.com>,
	Julien Stephan <jstephan@baylibre.com>,
	Babanpreet Singh <bbnpreetsingh@gmail.com>
Subject: [PATCH] kernel.bbclass: keep the sources when do_symlink_kernsrc reruns
Date: Sat, 14 Nov 2026 18:55:27 +0000	[thread overview]
Message-ID: <20261114185527.6-1-bbnpreetsingh@gmail.com> (raw)

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]

Suggested-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
---
 meta/classes-recipe/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 46da867a63..44223a4712 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -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] == '/':
-- 
2.43.0


                 reply	other threads:[~2026-11-14 18:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261114185527.6-1-bbnpreetsingh@gmail.com \
    --to=bbnpreetsingh@gmail.com \
    --cc=bruce.ashfield@gmail.com \
    --cc=ecordonnier@snap.com \
    --cc=jstephan@baylibre.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox