From ae0e9b61a00b00b5157c1fc2781c5c4f3f6b3aab Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 7 Oct 2024 00:02:23 +0300 Subject: [PATCH] Detect the kernel version before the arch --- kernel_hardening_checker/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel_hardening_checker/__init__.py b/kernel_hardening_checker/__init__.py index dd26712..0af2e30 100755 --- a/kernel_hardening_checker/__init__.py +++ b/kernel_hardening_checker/__init__.py @@ -293,12 +293,6 @@ def main() -> None: if args.sysctl: print(f'[+] Sysctl output file to check: {args.sysctl}') - arch, msg = detect_arch_kconfig(args.config, supported_archs) - if arch is None: - sys.exit(f'[!] ERROR: {msg}') - if mode != 'json': - print(f'[+] Detected microarchitecture: {arch}') - if args.kernel_version: kernel_version, msg = detect_kernel_version(args.kernel_version) else: @@ -310,6 +304,12 @@ def main() -> None: if mode != 'json': print(f'[+] Detected kernel version: {kernel_version}') + arch, msg = detect_arch_kconfig(args.config, supported_archs) + if arch is None: + sys.exit(f'[!] ERROR: {msg}') + if mode != 'json': + print(f'[+] Detected microarchitecture: {arch}') + compiler, msg = detect_compiler(args.config) if mode != 'json': if compiler: -- 2.31.1