]> code.ossystems Code Review - openembedded-core.git/commitdiff
linux-dummy: add empty dependent packages
authorLi Wang <li.wang@windriver.com>
Fri, 12 Mar 2021 09:52:50 +0000 (17:52 +0800)
committerSteve Sakoman <steve@sakoman.com>
Wed, 24 Mar 2021 14:30:32 +0000 (04:30 -1000)
some kernel includes kernel-image-image and kernel-devicetree packages.
these patckages are defined in kernel.bbclass
but, when use linux-dummy, these packages are not defined.
so, define them as empty packages for avoiding compile error:

ERROR: Nothing RPROVIDES 'kernel-devicetree'

Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 8dbae2dd5ac3de629957ca699f823f5438e80163)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/linux-dummy.bbclass [new file with mode: 0644]
meta/recipes-kernel/linux/linux-dummy.bb

diff --git a/meta/classes/linux-dummy.bbclass b/meta/classes/linux-dummy.bbclass
new file mode 100644 (file)
index 0000000..cd87915
--- /dev/null
@@ -0,0 +1,26 @@
+
+python __anonymous () {
+    if d.getVar('PREFERRED_PROVIDER_virtual/kernel') == 'linux-dummy':
+        # copy part codes from kernel.bbclass
+        kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
+
+        # set an empty package of kernel-devicetree
+        d.appendVar('PACKAGES', ' %s-devicetree' % kname)
+        d.setVar('ALLOW_EMPTY_%s-devicetree' % kname, '1')
+
+        # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
+        type = d.getVar('KERNEL_IMAGETYPE') or ""
+        alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or ""
+        types = d.getVar('KERNEL_IMAGETYPES') or ""
+        if type not in types.split():
+            types = (type + ' ' + types).strip()
+        if alttype not in types.split():
+            types = (alttype + ' ' + types).strip()
+
+        # set empty packages of kernel-image-*
+        for type in types.split():
+            typelower = type.lower()
+            d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
+            d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1')
+}
+
index 95dc85ff2fccb93e12938f3f0c92cc5c1daccbd1..c56f8990de2c0435d28cff69df30737f327566da 100644 (file)
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
 
 PROVIDES += "virtual/kernel"
 
-inherit deploy
+inherit deploy linux-dummy
 
 PACKAGES_DYNAMIC += "^kernel-module-.*"
 PACKAGES_DYNAMIC += "^kernel-image-.*"