mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
initfamfs: bring back to life. Was also easy!
This commit is contained in:
11
build-linux
11
build-linux
@@ -64,8 +64,6 @@ Run `make modules_install` after `make`.
|
||||
|
||||
def build(self):
|
||||
build_dir = self.get_build_dir()
|
||||
if self.env['initrd'] or self.env['initramfs']:
|
||||
raise Exception('just trolling, --initrd and --initramfs are broken for now')
|
||||
os.makedirs(build_dir, exist_ok=True)
|
||||
tool = 'gcc'
|
||||
gcc = self.get_toolchain_tool(tool)
|
||||
@@ -105,10 +103,12 @@ Run `make modules_install` after `make`.
|
||||
for i, config_fragment in enumerate(config_fragments):
|
||||
config_fragments[i] = os.path.join(self.env['linux_config_dir'], config_fragment)
|
||||
config_fragments.extend(self.env['config_fragment'])
|
||||
if self.env['config'] != []:
|
||||
cli_configs = self.env['config']
|
||||
if self.env['initramfs']:
|
||||
cli_configs.append('CONFIG_INITRAMFS_SOURCE="{}"'.format(self.env['buildroot_cpio']))
|
||||
if cli_configs:
|
||||
cli_config_fragment_path = os.path.join(build_dir, 'lkmc_cli_config_fragment')
|
||||
cli_config_str = '\n'.join(self.env['config'])
|
||||
self.sh.write_string_to_file(cli_config_fragment_path, cli_config_str)
|
||||
self.sh.write_configs(cli_config_fragment_path, cli_configs, mode='w')
|
||||
config_fragments.append(cli_config_fragment_path)
|
||||
self.sh.cp(
|
||||
base_config_file,
|
||||
@@ -136,6 +136,7 @@ Run `make modules_install` after `make`.
|
||||
common_make_args +
|
||||
self.sh.add_newlines(self.env['extra_make_args'])
|
||||
),
|
||||
# https://github.com/cirosantilli/linux-kernel-module-cheat#proc-version
|
||||
extra_env={
|
||||
'KBUILD_BUILD_VERSION': '1',
|
||||
'KBUILD_BUILD_TIMESTAMP': 'Thu Jan 1 00:00:00 UTC 1970',
|
||||
|
||||
Reference in New Issue
Block a user