summaryrefslogtreecommitdiff
path: root/classes/kernel-module-split-blacklist.bbclass
diff options
context:
space:
mode:
authorStefan Christ <s.christ@phytec.de>2015-10-15 15:28:38 +0200
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2015-10-20 14:32:46 +0200
commitb93f1e78beb10c189dde0e92ca238f8e9166771c (patch)
tree904e446e4633adce401e9834f6aa3fa9af3155a2 /classes/kernel-module-split-blacklist.bbclass
parentb6685d1992be60ca670071048bf45e837b2f6558 (diff)
downloadmeta-phytec-b93f1e78beb10c189dde0e92ca238f8e9166771c.tar.bz2
meta-phytec-b93f1e78beb10c189dde0e92ca238f8e9166771c.zip
kernel-module-split-blacklist.bbclass: fix bug
Sometimes while rebuilding linux-mainline you get the error: The stack trace of python calls that resulted in this exception/failure was: File: 'split_kernel_module_packages', lineno: 185, function: <module> 0181: d.setVar("RDEPENDS_%s" % (kernel_modules), ' '.join(rdepends)) 0182: 0183: 0184: *** 0185:split_kernel_module_packages(d) 0186: File: 'split_kernel_module_packages', lineno: 180, function: split_kernel_module_packages 0176: # After that the package 'kernel-modules' doesn't pull these packages onto 0177: # the rootfs automatically. 0178: kernel_modules = d.getVar("KERNEL_MODULES_META_PACKAGE", True) 0179: rdepends = d.getVar("RDEPENDS_%s" % (kernel_modules), True) *** 0180: rdepends = [pkg for pkg in rdepends.split(" ") if pkg not in blacklisted_modules] 0181: d.setVar("RDEPENDS_%s" % (kernel_modules), ' '.join(rdepends)) 0182: 0183: 0184: Exception: AttributeError: 'NoneType' object has no attribute 'split' To fix this the patch rewrites the code to handle the cases when d.getVar() returns None. 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.bbclass22
1 files changed, 12 insertions, 10 deletions
diff --git a/classes/kernel-module-split-blacklist.bbclass b/classes/kernel-module-split-blacklist.bbclass
index cfcc2df..cd42bab 100644
--- a/classes/kernel-module-split-blacklist.bbclass
+++ b/classes/kernel-module-split-blacklist.bbclass
@@ -21,16 +21,18 @@ KERNEL_MODULES_RDEPENDS_BLACKLIST ??= ""
# <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(' '))
+ if modules:
+ 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))
+ # 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)
+ if rdepends is not None:
+ rdepends = [pkg for pkg in rdepends.split(" ") if pkg not in blacklisted_modules]
+ d.setVar("RDEPENDS_%s" % (kernel_modules), ' '.join(rdepends))
}