mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
Implement a minimum linux version build mechanism
We were about to use it for scull.c when we found a way to fix its build intsead.
This commit is contained in:
@@ -39,7 +39,7 @@ common = sys.modules[__name__]
|
||||
# Fixed parameters that don't depend on CLI arguments.
|
||||
consts = {}
|
||||
consts['repo_short_id'] = 'lkmc'
|
||||
consts['linux_kernel_version'] = '5.9.2'
|
||||
consts['linux_kernel_version'] = '.'.join(map(lambda i: str(i), path_properties.linux_kernel_version_tuple))
|
||||
# https://stackoverflow.com/questions/20010199/how-to-determine-if-a-process-runs-inside-lxc-docker
|
||||
consts['in_docker'] = os.path.exists('/.dockerenv')
|
||||
consts['root_dir'] = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
@@ -5,6 +5,8 @@ import signal
|
||||
|
||||
from shell_helpers import LF
|
||||
|
||||
linux_kernel_version_tuple = (5,9,2)
|
||||
|
||||
class PathProperties:
|
||||
default_c_std = 'c11'
|
||||
default_cxx_std = 'c++17'
|
||||
@@ -59,6 +61,7 @@ class PathProperties:
|
||||
'qemu_x86_64_int_syscall': False,
|
||||
'interactive': False,
|
||||
'minimum_gcc_version': (0, 0, 0),
|
||||
'minimum_linux_version': (0, 0, 0),
|
||||
# The script takes a perceptible amount of time to run. Possibly an infinite loop.
|
||||
'more_than_1s': False,
|
||||
# The path should not be built. E.g.:
|
||||
@@ -238,6 +241,8 @@ class PathProperties:
|
||||
)
|
||||
) and not (
|
||||
self['minimum_gcc_version'] > self.current_gcc_version
|
||||
) and not (
|
||||
self['minimum_linux_version'] > linux_kernel_version_tuple
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user