Skip to contentSkip to conversation

devtool: better support for kernel

PATCH New Markus Lehtonen 1 participant 5 messages Sep 8, 2015

lore
Share & tools
lore
#0 lore raw

cover devtool: better support for kernel

This patchset contains few patches to improve the devtool support for kernel recipes. With these patches it is possible build a modified kernel and also build other packages (e.g. external modules) against it. The first three patches are actually a bit more generic patches that make externalsrc behave better with kernel recipes.

The following changes since commit 8402958cd2cb87b8283c8ee4e2d08e1a6717d67a:

pseudo_1.7.3.bb: New version of pseudo (2015-09-06 15:24:28 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib marquiz/devtool/kernel
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=marquiz/devtool/kernel

for you to fetch changes up to a7aeb51b63040a2783d60c45d9249daa47c2fde3:

devtool: modify: enable do_shared_workdir for kernel (2015-09-08 13:29:39 +0300)

----------------------------------------------------------------
Markus Lehtonen (4):
extrernalsrc.bbclass: treat kernel meta like local source kernel-yocto.bbclass: do_kernel_metadata depends on do_unpack kernel.bbclass: do not mv/link sources when externalsrc enabled
devtool: modify: enable do_shared_workdir for kernel

 meta/classes/externalsrc.bbclass  | 12 ++++++++----
 meta/classes/kernel-yocto.bbclass |  2 +-
 meta/classes/kernel.bbclass       | 10 +++++++---
 scripts/lib/devtool/standard.py   |  2 +-
 4 files changed, 17 insertions(+), 9 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/4 extrernalsrc.bbclass: treat kernel meta like local source

Kernel metadata repository needs to be fetched/unpacked into the work directory in order to build the kernel. Sources pointing to a remote location are skipped by externalsrc by default which caused kernel build to fail (because of remote kernel-meta was not made availeble). This patch will make kernel-meta always available.

[YOCTO #6658]

---
 meta/classes/externalsrc.bbclass | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
meta/classes/externalsrc.bbclass +8 -4
index 8f7f479..37c6320 100644
@@ -36,11 +36,15 @@ python () {
         else:
             d.setVar('B', '${WORKDIR}/${BPN}-${PV}/')
 
-        srcuri = (d.getVar('SRC_URI', True) or '').split()
         local_srcuri = []
-        for uri in srcuri:
-            if uri.startswith('file://'):
-                local_srcuri.append(uri)
+        fetch = bb.fetch2.Fetch((d.getVar('SRC_URI', True) or '').split(), d)
+        for url in fetch.urls:
+            url_data = fetch.ud[url]
+            parm = url_data.parm
+            if (url_data.type == 'file' or
+                    'type' in parm and parm['type'] == 'kmeta'):
+                local_srcuri.append(url)
+
         d.setVar('SRC_URI', ' '.join(local_srcuri))
 
         if '{SRCPV}' in d.getVar('PV', False):
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/4 kernel-yocto.bbclass: do_kernel_metadata depends on do_unpack

In reply to Markus Lehtonen

Make sure that 'do_unpack' is executed before 'do_kernel_metadata'. Enabling externalsrc for kernel disables 'do_validate_branches' task which caused 'do_kernel_metadata' to fail as the dependency chain to 'do_unpack' got broken.

[YOCTO #6658]

---
 meta/classes/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-yocto.bbclass +1 -1
index 231e08d..325f94c 100644
@@ -228,7 +228,7 @@ do_kernel_checkout() {
 do_kernel_checkout[dirs] = "${S}"
 
 addtask kernel_checkout before do_kernel_metadata after do_unpack
-addtask kernel_metadata after do_validate_branches before do_patch
+addtask kernel_metadata after do_validate_branches do_unpack before do_patch
 do_kernel_metadata[depends] = "kern-tools-native:do_populate_sysroot"
 
 do_kernel_configme[dirs] += "${S} ${B}"
Signature · 1 line
2.1.4
#3 lore raw

PATCH 3/4 kernel.bbclass: do not mv/link sources when externalsrc enabled

In reply to Markus Lehtonen

If externalsrc is enabled the 'do_unpack' task is run if the recipe has some local source files. In the case of kernel recipe this caused the (externalsrc) source tree to be moved/symlinked. This patch prevents the behaviour, making sure the source tree is not moved around when externalsrc is enabled. Instead of moving the source tree, STAGING_KERNEL_DIR will be a symlink to it.

[YOCTO #6658]

---
 meta/classes/kernel.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +7 -3
index 919293e..dfbdfd2 100644
@@ -68,9 +68,13 @@ base_do_unpack_append () {
     if s != kernsrc:
         bb.utils.mkdirhier(kernsrc)
         bb.utils.remove(kernsrc, recurse=True)
-        import subprocess
-        subprocess.call(d.expand("mv ${S} ${STAGING_KERNEL_DIR}"), shell=True)
-        os.symlink(kernsrc, s)
+        if d.getVar("EXTERNALSRC", True):
+            # With EXTERNALSRC S will not be wiped so we can symlink to it
+            os.symlink(s, kernsrc)
+        else:
+            import shutil
+            shutil.move(s, kernsrc)
+            os.symlink(kernsrc, s)
 }
 
 inherit kernel-arch deploy
Signature · 1 line
2.1.4
#4 lore raw

PATCH 4/4 devtool: modify: enable do_shared_workdir for kernel

In reply to Markus Lehtonen

Do not put 'do_shared_workdir' into SRCTREECOVEREDTASKS when creating bbappend for kernel packages. This will allow building packages that depend on the shared build artifacts of kernel.

[YOCTO #6658]

---
 scripts/lib/devtool/standard.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/devtool/standard.py +1 -1
index e59fb5e..ee00c6d 100644
@@ -493,7 +493,7 @@ def modify(args, config, basepath, workspace):
             f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (args.recipename, srctree))
 
         if bb.data.inherits_class('kernel', rd):
-            f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout do_shared_workdir do_fetch do_unpack"\n')
+            f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout do_fetch do_unpack"\n')
         if initial_rev:
             f.write('\n# initial_rev: %s\n' % initial_rev)
             for commit in commits:
Signature · 1 line
2.1.4