Skip to content

Commit 0d7ab8c

Browse files
committed
contest: hw: make sure we don't have modules
We deploy just the main kernel and kexec it. We can't have modules. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent d86d566 commit 0d7ab8c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

contest/hw/lib/deployer.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,17 @@ def build_kernel(config, tree_path):
7373
if extra_configs:
7474
_run(['scripts/kconfig/merge_config.sh', '-m', '.config'] + extra_configs,
7575
cwd=tree_path)
76-
_run(['make', '-C', tree_path, 'olddefconfig'])
76+
77+
# Convert all modules to built-in so kexec works without /lib/modules
78+
# on the test kernel.
79+
config_path = os.path.join(tree_path, '.config')
80+
with open(config_path, 'r', encoding='utf-8') as fp:
81+
content = fp.read()
82+
content = re.sub(r'^(CONFIG_\w+)=m$', r'\1=y', content, flags=re.MULTILINE)
83+
with open(config_path, 'w', encoding='utf-8') as fp:
84+
fp.write(content)
85+
86+
_run(['make', '-C', tree_path, 'olddefconfig'])
7787

7888
# Add a random suffix to make the kernel version unique per build
7989
tag = ''.join(random.choices(string.ascii_lowercase, k=4))

0 commit comments

Comments
 (0)