From: Alexander Popov Date: Sun, 6 Oct 2024 21:02:23 +0000 (+0300) Subject: Detect the kernel version before the arch X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=ae0e9b61a00b00b5157c1fc2781c5c4f3f6b3aab;p=kconfig-hardened-check.git Detect the kernel version before the arch --- 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: