diff options
author | Saul Wold <sgw@linux.intel.com> | 2015-06-26 11:23:06 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-02 23:08:39 +0100 |
commit | 38d8f2eb9f1e34657ef1210b28b73dbfb2b1767d (patch) | |
tree | d8faae8cd4b912d546c3149c0e15d44b48728ddf /meta/lib | |
parent | 7e074c3641f0b44317b036dc979dac5e71a5ba9d (diff) | |
download | poky-38d8f2eb9f1e34657ef1210b28b73dbfb2b1767d.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: 1b696a45ddb00fbe1d993b19339071486d0cfef2)
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/lib')
-rw-r--r-- | meta/lib/oe/rootfs.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 327c8eae86..0bd1cf632f 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py | |||
@@ -304,16 +304,30 @@ class Rootfs(object): | |||
304 | self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c', | 304 | self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c', |
305 | 'new', '-v']) | 305 | 'new', '-v']) |
306 | 306 | ||
307 | def _check_for_kernel_modules(self, modules_dir): | ||
308 | for root, dirs, files in os.walk(modules_dir, topdown=True): | ||
309 | for name in files: | ||
310 | found_ko = name.endswith(".ko") | ||
311 | if found_ko: | ||
312 | return found_ko | ||
313 | return False | ||
314 | |||
307 | def _generate_kernel_module_deps(self): | 315 | def _generate_kernel_module_deps(self): |
316 | modules_dir = os.path.join(self.image_rootfs, 'lib', 'modules') | ||
317 | # if we don't have any modules don't bother to do the depmod | ||
318 | if not self._check_for_kernel_modules(modules_dir): | ||
319 | bb.note("No Kernel Modules found, not running depmod") | ||
320 | return | ||
321 | |||
308 | kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR', True), "kernel-depmod", | 322 | kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR', True), "kernel-depmod", |
309 | 'kernel-abiversion') | 323 | 'kernel-abiversion') |
310 | if not os.path.exists(kernel_abi_ver_file): | 324 | if not os.path.exists(kernel_abi_ver_file): |
311 | bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file) | 325 | bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file) |
312 | 326 | ||
313 | kernel_ver = open(kernel_abi_ver_file).read().strip(' \n') | 327 | kernel_ver = open(kernel_abi_ver_file).read().strip(' \n') |
314 | modules_dir = os.path.join(self.image_rootfs, 'lib', 'modules', kernel_ver) | 328 | versioned_modules_dir = os.path.join(self.image_rootfs, modules_dir, kernel_ver) |
315 | 329 | ||
316 | bb.utils.mkdirhier(modules_dir) | 330 | bb.utils.mkdirhier(versioned_modules_dir) |
317 | 331 | ||
318 | self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver]) | 332 | self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver]) |
319 | 333 | ||