Skip to contentSkip to conversation

kernel.bbclass: Fix symlink creation when using externalsrc

PATCH In review Stefan Stanacar 1 participant 2 messages Jan 29, 2018 – Feb 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel.bbclass: Fix symlink creation when using externalsrc

do_unpack is by default in SRCTREECOVEREDTASKS so this append can't run, since do_unpack gets removed by when externalsrc is enabled.

This was hidden because externalsrc does actually run do_fetch and do_unpack if there are type=kmeta or file:// entries in the SRC_URI value of the kernel recipe. (which is the case for linux-yocto).

Make this a separate task so that it actually gets run for kernel recipes with no file:// or type=kmeta in SRC_URI.

---
 meta/classes/kernel.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +2 -1
index 2f6eca3..6a8d6e8 100644
@@ -125,7 +125,7 @@ inherit ${KERNEL_CLASSES}
 # the symlink.
 do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
 do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
-base_do_unpack_append () {
+python do_symlink_staging_dir () {
     s = d.getVar("S")
     if s[-1] == '/':
         # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
@@ -142,6 +142,7 @@ base_do_unpack_append () {
             shutil.move(s, kernsrc)
             os.symlink(kernsrc, s)
 }
+addtask do_symlink_staging_dir after do_unpack before do_patch do_configure
 
 inherit kernel-arch deploy
 
Signature · 1 line
2.7.4
#1 lore raw

Ping?

Quoted 48 lines · Stefan Stanacar

do_unpack is by default in SRCTREECOVEREDTASKS so this append can't run, since
do_unpack gets removed by when externalsrc is enabled.

This was hidden because externalsrc does actually run do_fetch and do_unpack if
there are type=kmeta or file:// entries in the SRC_URI value of the kernel recipe.
(which is the case for linux-yocto).

Make this a separate task so that it actually gets run for kernel recipes with
no file:// or type=kmeta in SRC_URI.

---
 meta/classes/kernel.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +0 -0
index 2f6eca3..6a8d6e8 100644
@@ -125,7 +125,7 @@ inherit ${KERNEL_CLASSES}
 # the symlink.
 do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B}

${STAGING_KERNEL_BUILDDIR}"
do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B}
${STAGING_KERNEL_BUILDDIR}"

meta/classes/kernel.bbclass +1 -1
-base_do_unpack_append () {
+python do_symlink_staging_dir () {
     s = d.getVar("S")
     if s[-1] == '/':
         # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use

s as directory name and fail

meta/classes/kernel.bbclass +1 -0
@@ -142,6 +142,7 @@ base_do_unpack_append () {
             shutil.move(s, kernsrc)
             os.symlink(kernsrc, s)
 }
+addtask do_symlink_staging_dir after do_unpack before do_patch

do_configure

inherit kernel-arch deploy

--
2.7.4