summaryrefslogtreecommitdiff
path: root/classes/kernel-module-split-blacklist.bbclass
diff options
context:
space:
mode:
authorStefan Christ <s.christ@phytec.de>2015-06-08 10:26:02 +0200
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2015-06-09 16:07:56 +0200
commit32df2a5f0ad6addee4e8d7162f34055e2cd7575d (patch)
treed76ac6f19064b04c16df5a1660ec6c1907fd9003 /classes/kernel-module-split-blacklist.bbclass
parentc6e30baabd764119c12ced880dca526c1ef4e8e3 (diff)
downloadmeta-phytec-32df2a5f0ad6addee4e8d7162f34055e2cd7575d.tar.bz2
meta-phytec-32df2a5f0ad6addee4e8d7162f34055e2cd7575d.zip
classes: add kernel-module-split-blacklist.bbclass
This bbclass is a helper class to modify the runtime dependency list of the empty package 'kernel-modules'. The variable KERNEL_MODULES_RDEPENDS_BLACKLIST can be used to remove some packages from the dependency list. It's useful if you want to install some kernel module packages by hand on the rootfs. Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Diffstat (limited to 'classes/kernel-module-split-blacklist.bbclass')
-rw-r--r--classes/kernel-module-split-blacklist.bbclass36
1 files changed, 36 insertions, 0 deletions
diff --git a/classes/kernel-module-split-blacklist.bbclass b/classes/kernel-module-split-blacklist.bbclass
new file mode 100644
index 0000000..cfcc2df
--- /dev/null
+++ b/classes/kernel-module-split-blacklist.bbclass
@@ -0,0 +1,36 @@
+# Copyright (C) 2015 PHYTEC Messtechnik GmbH,
+# Author: Stefan Christ <s.christ@phytec.de>
+
+# The package 'kernel-modules' (real name in KERNEL_MODULES_META_PACKAGE) is a
+# empty package which depends on all kernel module packages. Since the package
+# 'kernel-modules' is installed often by default on the rootfs, all available
+# kernel modules will be pulled onto the rootfs.
+#
+# If you want to install some kernel modules 'by hand', e.g. in a image recipe
+# or package group, you can append the package name to the variable
+#
+# KERNEL_MODULES_RDEPENDS_BLACKLIST
+#
+# This will remove the package from the RDEPENDS list of the package
+# 'kernel_modules' and therefore the kernel module is not installed by default.
+
+KERNEL_MODULES_RDEPENDS_BLACKLIST ??= ""
+
+
+# The task 'split_kernel_module_packages' is defined in
+# <poky>/meta/classes/kernel-module-split.bbclass.
+python split_kernel_module_packages_append () {
+ # Get all modules which shouldn't be in RDEPENDS.
+ blacklisted_modules = set(s.strip() for s in
+ d.getVar("KERNEL_MODULES_RDEPENDS_BLACKLIST", True).split(' '))
+
+ # Remove packages in set blacklisted_modules from variable
+ # RDEPENDS_${KERNEL_MODULES_META_PACKAGE}.
+ # After that the package 'kernel-modules' doesn't pull these packages onto
+ # the rootfs automatically.
+ kernel_modules = d.getVar("KERNEL_MODULES_META_PACKAGE", True)
+ rdepends = d.getVar("RDEPENDS_%s" % (kernel_modules), True)
+ rdepends = [pkg for pkg in rdepends.split(" ") if pkg not in blacklisted_modules]
+ d.setVar("RDEPENDS_%s" % (kernel_modules), ' '.join(rdepends))
+
+}