mirror of
https://git.yoctoproject.org/poky
synced 2026-04-29 00:32:14 +02:00
rootfs.py: Run depmod(wrapper) against each compiled kernel
We run depmod (through depmodwrapper) at the end of the rootfs generation process. This part of the process assumes in its current implementation that the kernel package name is always 'kernel' and that there is only one set of kernel modules for which we need to generate the modules.dep and map files. The kernel package name can be configured via a variable (KERNEL_PACKAGE_NAME) and becomes a namespace that enables the build system to deal with multiple compiled kernel recipes. This patch checks for all the depmod pkgdata and runs depmod for each of the detected kernel versions/kernel package name. (From OE-Core rev: efa88e1c227d695319197f511701e0230d301f39) Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
475639ba49
commit
5e4f3acbc8
@@ -325,19 +325,29 @@ class Rootfs(object, metaclass=ABCMeta):
|
||||
bb.note("No Kernel Modules found, not running depmod")
|
||||
return
|
||||
|
||||
kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR'), "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)
|
||||
pkgdatadir = self.d.getVar('PKGDATA_DIR')
|
||||
|
||||
with open(kernel_abi_ver_file) as f:
|
||||
kernel_ver = f.read().strip(' \n')
|
||||
# PKGDATA_DIR can include multiple kernels so we run depmod for each
|
||||
# one of them.
|
||||
for direntry in os.listdir(pkgdatadir):
|
||||
match = re.match('(.*)-depmod', direntry)
|
||||
if not match:
|
||||
continue
|
||||
kernel_package_name = match.group(1)
|
||||
|
||||
versioned_modules_dir = os.path.join(self.image_rootfs, modules_dir, kernel_ver)
|
||||
kernel_abi_ver_file = oe.path.join(pkgdatadir, direntry, kernel_package_name + '-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)
|
||||
|
||||
bb.utils.mkdirhier(versioned_modules_dir)
|
||||
with open(kernel_abi_ver_file) as f:
|
||||
kernel_ver = f.read().strip(' \n')
|
||||
|
||||
self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver])
|
||||
versioned_modules_dir = os.path.join(self.image_rootfs, modules_dir, kernel_ver)
|
||||
|
||||
bb.utils.mkdirhier(versioned_modules_dir)
|
||||
|
||||
bb.note("Running depmodwrapper for %s ..." % versioned_modules_dir)
|
||||
self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver, kernel_package_name])
|
||||
|
||||
"""
|
||||
Create devfs:
|
||||
|
||||
Reference in New Issue
Block a user