Skip to content

Commit fd77a81

Browse files
committed
utils: Look for kernel.release in $KBUILD_OUTPUT
As well as the other locations.
1 parent 98a725f commit fd77a81

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

lib/utils.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,19 @@ def get_vmlinux():
7070

7171

7272
def get_expected_release():
73+
candidates = []
7374
env = os.environ.get('KERNEL_RELEASE_PATH', None)
74-
for path in [env, 'include/config/kernel.release', 'kernel.release']:
75-
if path and os.path.isfile(path):
75+
if env:
76+
candidates.append(env)
77+
78+
default_path = 'include/config/kernel.release'
79+
env = os.environ.get('KBUILD_OUTPUT', None)
80+
if env:
81+
candidates.append(f'{env}/{default_path}')
82+
83+
candidates.extend([default_path, 'kernel.release'])
84+
for path in candidates:
85+
if os.path.isfile(path):
7686
break
7787
else:
7888
logging.error(f"Couldn't find kernel.release, export KERNEL_RELEASE_PATH")

0 commit comments

Comments
 (0)