summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
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-26 04:24:02 -1000
commit3b8d0acca30c806fb69fc3096d41593cc76ed22c (patch)
tree75e6dfb8054c3a517e0091194e9b487632dd2334 /meta/classes/kernel.bbclass
parent1955a65b98f53fe82183c35372c57c3ddd7cdfe1 (diff)
downloadpoky-3b8d0acca30c806fb69fc3096d41593cc76ed22c.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: cf2267f80ec44b24c627347df7efbd492a07dcfa) 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>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r--meta/classes/kernel.bbclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index a82e4cf942..f7d199e917 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -176,13 +176,14 @@ do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILD
176do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}" 176do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
177python do_symlink_kernsrc () { 177python do_symlink_kernsrc () {
178 s = d.getVar("S") 178 s = d.getVar("S")
179 if s[-1] == '/':
180 # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
181 s=s[:-1]
182 kernsrc = d.getVar("STAGING_KERNEL_DIR") 179 kernsrc = d.getVar("STAGING_KERNEL_DIR")
183 if s != kernsrc: 180 if s != kernsrc:
184 bb.utils.mkdirhier(kernsrc) 181 bb.utils.mkdirhier(kernsrc)
185 bb.utils.remove(kernsrc, recurse=True) 182 bb.utils.remove(kernsrc, recurse=True)
183 if s[-1] == '/':
184 # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as
185 # directory name and fail
186 s = s[:-1]
186 if d.getVar("EXTERNALSRC"): 187 if d.getVar("EXTERNALSRC"):
187 # With EXTERNALSRC S will not be wiped so we can symlink to it 188 # With EXTERNALSRC S will not be wiped so we can symlink to it
188 os.symlink(s, kernsrc) 189 os.symlink(s, kernsrc)