kernel-module-split: Remove get_ext_mod
PATCH 1/1 kernel-module-split: Remove get_ext_mod
This function is calling make on the kernel makefiles. Even through --dry-run is specificed, in my local tests it executes things and this is bad in itself.
The function is called from a shell function meaning it is always expanded during parsing, which means we're executing make during every datastore parse, which is also very bad.
Simplfy the function down to ${S} for now. If there is need to change that we can parameterise it but we need working/safe builds and this is the least worse alternative besides reverting the changes.
Signed-off-by Richard Purdie <[email protected]>
--- .../kernel-module-split.bbclass | 2 +- meta/lib/oe/kernel_module.py | 21 ------------------- 2 files changed, 1 insertion(+), 22 deletions(-)
meta/classes-recipe/kernel-module-split.bbclass +1 -1
@@ -62,7 +62,7 @@ post_strip_kernel_modules_signing(){ oe_runmake \ -C ${KBUILD_OUTPUT} \ MODLIB=${PKGD}${KERNEL_MODULE_INSTALL_PREFIX} \ - ${@'M=%s' % oe.kernel_module.get_ext_mod(d) if not "virtual/kernel" in d.getVar('PROVIDES') else ''} \ + ${@'M=%s' % '${S}' if not "virtual/kernel" in d.getVar('PROVIDES') else ''} \ modules_sign fi }
meta/lib/oe/kernel_module.py +0 -21
@@ -25,24 +25,3 @@ def kernel_module_os_env(d, env_dict): env_dict['KBUILD_EXTRA_SYMBOLS'] = kbuild_extra_symbols else: env_dict['KBUILD_EXTRA_SYMBOLS'] = '' - -def get_ext_mod(d): - """ - Extract the resolved Kbuild M= variable from an out of tree module Makefile variable database. - """ - import re - import bb.process - - try: - output = bb.process.run( - "make -C %s --dry-run --print-data-base" % d.getVar("B") - )[0] - except bb.process.ExecutionError: - return d.getVar("S") - - for line in output.splitlines(): - m = re.match(r'^M\s*=\s*(.*)$', line) - if m: - return m.group(1).strip() - - return d.getVar("S")