Skip to content

Commit cfa2e5a

Browse files
committed
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.
1 parent 76c4cb0 commit cfa2e5a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# Fixed parameters that don't depend on CLI arguments.
4040
consts = {}
4141
consts['repo_short_id'] = 'lkmc'
42-
consts['linux_kernel_version'] = '5.9.2'
42+
consts['linux_kernel_version'] = '.'.join(map(lambda i: str(i), path_properties.linux_kernel_version_tuple))
4343
# https://stackoverflow.com/questions/20010199/how-to-determine-if-a-process-runs-inside-lxc-docker
4444
consts['in_docker'] = os.path.exists('/.dockerenv')
4545
consts['root_dir'] = os.path.dirname(os.path.abspath(__file__))

path_properties.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
from shell_helpers import LF
77

8+
linux_kernel_version_tuple = (5,9,2)
9+
810
class PathProperties:
911
default_c_std = 'c11'
1012
default_cxx_std = 'c++17'
@@ -59,6 +61,7 @@ class PathProperties:
5961
'qemu_x86_64_int_syscall': False,
6062
'interactive': False,
6163
'minimum_gcc_version': (0, 0, 0),
64+
'minimum_linux_version': (0, 0, 0),
6265
# The script takes a perceptible amount of time to run. Possibly an infinite loop.
6366
'more_than_1s': False,
6467
# The path should not be built. E.g.:
@@ -238,6 +241,8 @@ def should_be_built(
238241
)
239242
) and not (
240243
self['minimum_gcc_version'] > self.current_gcc_version
244+
) and not (
245+
self['minimum_linux_version'] > linux_kernel_version_tuple
241246
)
242247
)
243248

0 commit comments

Comments
 (0)