summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStaffan Rydén <staffan.ryden@axis.com>2023-07-20 13:02:56 +0200
committerSteve Sakoman <steve@sakoman.com>2023-08-15 06:18:49 -1000
commitf28f7aa98b3ea6e33a1093ef7ffb90951a3520f6 (patch)
treeb56f0d5e8be1688639895b021aa3de069890bc52
parentd7e4741091a4eb7ba98b1f600d001d6cadacb06a (diff)
downloadpoky-f28f7aa98b3ea6e33a1093ef7ffb90951a3520f6.tar.gz
kernel: Fix path comparison in kernel staging dir symlinking
Due to an oversight in the do_symlink_kernsrc function, the path comparison between "S" and "STAGING_KERNEL_DIR" is broken. The code obtains both variables, but modifies the local copy of "S" before comparing them, causing the comparison to always return false. This can cause the build to fail when the EXTERNALSRC flag is enabled, since the code will try to create a symlink even if one already exists. This patch resolves the issue by comparing the variables before they are modified. (From OE-Core rev: 76ca96ebde8c318e32d4bf65714a6241965b0b8f) Signed-off-by: Staffan Rydén <staffan.ryden@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit afd2038ef8a66a5e6433be31a14e1eb0d9f9a1d3) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/classes-recipe/kernel.bbclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 3190feddf4..759f72d571 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -181,13 +181,14 @@ do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILD
181do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}" 181do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
182python do_symlink_kernsrc () { 182python do_symlink_kernsrc () {
183 s = d.getVar("S") 183 s = d.getVar("S")
184 if s[-1] == '/':
185 # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
186 s=s[:-1]
187 kernsrc = d.getVar("STAGING_KERNEL_DIR") 184 kernsrc = d.getVar("STAGING_KERNEL_DIR")
188 if s != kernsrc: 185 if s != kernsrc:
189 bb.utils.mkdirhier(kernsrc) 186 bb.utils.mkdirhier(kernsrc)
190 bb.utils.remove(kernsrc, recurse=True) 187 bb.utils.remove(kernsrc, recurse=True)
188 if s[-1] == '/':
189 # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as
190 # directory name and fail
191 s = s[:-1]
191 if d.getVar("EXTERNALSRC"): 192 if d.getVar("EXTERNALSRC"):
192 # With EXTERNALSRC S will not be wiped so we can symlink to it 193 # With EXTERNALSRC S will not be wiped so we can symlink to it
193 os.symlink(s, kernsrc) 194 os.symlink(s, kernsrc)