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:03:25 +0100 |
commit | 1b696a45ddb00fbe1d993b19339071486d0cfef2 (patch) | |
tree | a3e4608f0fb5b10144290ead04da7792669d06f7 /meta | |
parent | 6f7144ebe2da4c72ef58280e034b2cc75331a471 (diff) | |
download | openembedded-core-1b696a45ddb00fbe1d993b19339071486d0cfef2.tar.gz openembedded-core-1b696a45ddb00fbe1d993b19339071486d0cfef2.tar.bz2 openembedded-core-1b696a45ddb00fbe1d993b19339071486d0cfef2.zip |
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]
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-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): self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c', 'new', '-v']) + def _check_for_kernel_modules(self, modules_dir): + for root, dirs, files in os.walk(modules_dir, topdown=True): + for name in files: + found_ko = name.endswith(".ko") + if found_ko: + return found_ko + return False + def _generate_kernel_module_deps(self): + modules_dir = os.path.join(self.image_rootfs, 'lib', 'modules') + # if we don't have any modules don't bother to do the depmod + if not self._check_for_kernel_modules(modules_dir): + bb.note("No Kernel Modules found, not running depmod") + return + kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR', True), "kernel-depmod", 'kernel-abiversion') if not os.path.exists(kernel_abi_ver_file): bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file) kernel_ver = open(kernel_abi_ver_file).read().strip(' \n') - modules_dir = os.path.join(self.image_rootfs, 'lib', 'modules', kernel_ver) + versioned_modules_dir = os.path.join(self.image_rootfs, modules_dir, kernel_ver) - bb.utils.mkdirhier(modules_dir) + bb.utils.mkdirhier(versioned_modules_dir) self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver]) |