linux-firmware: add bbpapend to fix packaging
authorFlorian Boor <florian@kernelconcepts.de>
Wed, 27 Jun 2018 11:23:47 +0000 (13:23 +0200)
committerFlorian Boor <florian@kernelconcepts.de>
Wed, 27 Jun 2018 12:04:24 +0000 (14:04 +0200)
recipes-kernel/linux-firmware/linux-firmware_%.bbappend [new file with mode: 0644]

diff --git a/recipes-kernel/linux-firmware/linux-firmware_%.bbappend b/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
new file mode 100644 (file)
index 0000000..2b8adf4
--- /dev/null
@@ -0,0 +1,16 @@
+def add_package_and_files(d):
+    packages = d.getVar('PACKAGES')
+    files = d.getVar('LICENSE_FILES_DIRECTORY')
+    pn = d.getVar('PN')
+    pn_lic = "%s%s" % (pn, d.getVar('LICENSE_PACKAGE_SUFFIX', False))
+    if pn_lic in packages.split():
+        bb.warn("%s package already existed in %s." % (pn_lic, pn))
+    else:
+        # first in PACKAGES to be sure that nothing else gets LICENSE_FILES_DIRECTORY
+        d.setVar('PACKAGES', "%s %s" % (pn_lic, packages))
+        d.setVar('FILES_' + pn_lic, files)
+        rrecommends_pn = d.getVar('RRECOMMENDS_' + pn)
+        if rrecommends_pn:
+            d.setVar('RRECOMMENDS_' + pn, "%s %s" % (pn_lic, rrecommends_pn))
+        else:
+            d.setVar('RRECOMMENDS_' + pn, "%s" % (pn_lic))