summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2015-06-26 11:23:06 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-08 13:07:16 +0100
commit43969db1c7ab4219a1f9bb0f48cd5f5375376829 (patch)
tree596f03728c5af88632accccd49d8b26463741cc7 /meta
parent8f8327d99b6f4616f09525a807d91e3784bbd435 (diff)
downloadpoky-43969db1c7ab4219a1f9bb0f48cd5f5375376829.tar.gz
rootfs.py: Add check for kernel modules before running depmod
Add a check for kernel modules so we don't un-necessarily run the depmods, this will also handle the case with linux-dummy does not place the kernel-abiversion since it also does not have kernel modules. [YOCTO #7884] (From OE-Core rev: 2b87991be82f4bcf76f8cc3a79bcefc225bae8ba) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/rootfs.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index a9a6c85a2c..e86480cf25 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -254,16 +254,30 @@ class Rootfs(object):
254 self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c', 254 self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c',
255 'new', '-v']) 255 'new', '-v'])
256 256
257 def _check_for_kernel_modules(self, modules_dir):
258 for root, dirs, files in os.walk(modules_dir, topdown=True):
259 for name in files:
260 found_ko = name.endswith(".ko")
261 if found_ko:
262 return found_ko
263 return False
264
257 def _generate_kernel_module_deps(self): 265 def _generate_kernel_module_deps(self):
266 modules_dir = os.path.join(self.image_rootfs, 'lib', 'modules')
267 # if we don't have any modules don't bother to do the depmod
268 if not self._check_for_kernel_modules(modules_dir):
269 bb.note("No Kernel Modules found, not running depmod")
270 return
271
258 kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR', True), "kernel-depmod", 272 kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR', True), "kernel-depmod",
259 'kernel-abiversion') 273 'kernel-abiversion')
260 if not os.path.exists(kernel_abi_ver_file): 274 if not os.path.exists(kernel_abi_ver_file):
261 bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file) 275 bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file)
262 276
263 kernel_ver = open(kernel_abi_ver_file).read().strip(' \n') 277 kernel_ver = open(kernel_abi_ver_file).read().strip(' \n')
264 modules_dir = os.path.join(self.image_rootfs, 'lib', 'modules', kernel_ver) 278 versioned_modules_dir = os.path.join(self.image_rootfs, modules_dir, kernel_ver)
265 279
266 bb.utils.mkdirhier(modules_dir) 280 bb.utils.mkdirhier(versioned_modules_dir)
267 281
268 self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver]) 282 self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver])
269 283