mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
./build and ./test work automatically when cwd is inside userland/libs/XXX without --package-all.
30 lines
707 B
Python
Executable File
30 lines
707 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import platform
|
|
import subprocess
|
|
|
|
import lkmc.import_path
|
|
|
|
build_userland = lkmc.import_path.import_path_relative_root('build-userland')
|
|
|
|
class Main(build_userland.Main):
|
|
def __init__(self):
|
|
defaults = {
|
|
'archs': [platform.processor()],
|
|
'gcc_which': 'host',
|
|
'in_tree': True,
|
|
'targets': ['.'],
|
|
}
|
|
if self.cwd_in_lib():
|
|
defaults['package_all'] = True
|
|
super().__init__(
|
|
description='''\
|
|
https://cirosantilli.com/linux-kernel-module-cheat#userland-setup-getting-started-natively
|
|
''',
|
|
defaults=defaults
|
|
)
|
|
|
|
if __name__ == '__main__':
|
|
Main().cli()
|