]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
devtool: fix handling of linux-yocto after multisrc changes
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Sun, 3 Dec 2017 21:42:13 +0000 (10:42 +1300)
committerPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 5 Dec 2017 01:39:24 +0000 (14:39 +1300)
devtool now handles multiple source trees for any recipe that includes
them in SRC_URI, extracting them all side-by-side so that you can make
changes in any of them. As a result, when running devtool modify on a
linux-yocto kernel recipe under the source path you will get a "source"
subdirectory containing the kernel source and a "kernel-meta"
subdirectory next to it containing the kernel metadata. (Previously you
just got the source tree and the kernel metadata remained in the work
directory). We create a symlink automatically at do_unpack from the work
directory so that it can still be found there, however
kernel_feature_dirs() expects to find the kernel-meta repository and
we also now need to make externalsrc remove that so that it doesn't
unpack and overwrite the one we've already extracted. Change
kernel_feature_dirs() so that if there are no kmeta entries in SRC_URI,
it will fall back to a directory named ${KMETA} if it happens to be
present in the work directory, ignoring how it got there.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
meta/classes/externalsrc.bbclass
meta/classes/kernel-yocto.bbclass
scripts/lib/devtool/standard.py

index 65dd13ddc1f7fc4d6b62ff61d87caa0c589cf8ca..1ce53ee2d602eabe06ef262ef4ffcffb5acaf9df 100644 (file)
@@ -65,7 +65,7 @@ python () {
             url_data = fetch.ud[url]
             parm = url_data.parm
             if (url_data.type == 'file' or
-                    'type' in parm and parm['type'] == 'kmeta'):
+                    (parm.get('type', None) == 'kmeta' and d.getVar('EXTERNALSRC_KMETA') != "1")):
                 local_srcuri.append(url)
 
         d.setVar('SRC_URI', ' '.join(local_srcuri))
index 1d447951c49a1885f220b0762337dec1d2862f64..18a71132278b049a3e95cbd8c5f05cfb83ca04fd 100644 (file)
@@ -42,7 +42,12 @@ def find_kernel_feature_dirs(d):
             destdir = parm["destsuffix"]
             if type == "kmeta":
                 feature_dirs.append(destdir)
-           
+    if not feature_dirs:
+        # If the kernel-meta directory already exists (e.g from externalsrc)
+        # with EXTERNALSRC_KMETA = "1" then use it
+        kmetadir = d.getVar('KMETA')
+        if os.path.isdir(os.path.join(d.getVar('WORKDIR'), kmetadir)):
+            feature_dirs.append(kmetadir)
     return feature_dirs
 
 # find the master/machine source branch. In the same way that the fetcher proceses
index cadd038bf6ad327a7ee57857c3c68c6288216c34..fe33c7e1be822e2b31693903eeb113262591c6c7 100644 (file)
@@ -909,7 +909,9 @@ def modify(args, config, basepath, workspace):
 
             if bb.data.inherits_class('kernel', rd):
                 f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout '
-                        'do_fetch do_unpack do_kernel_configme do_kernel_configcheck"\n')
+                        'do_fetch do_kernel_configme do_kernel_configcheck"\n')
+                if bb.data.inherits_class('kernel-yocto', rd):
+                    f.write('EXTERNALSRC_KMETA = "1"\n')
                 f.write('\ndo_patch() {\n'
                         '    :\n'
                         '}\n')