sys.exit(f'[!] ERROR: unable to open {file}, are you sure it exists?')
-def detect_arch_kconfig(fname: str) -> Tuple[StrOrNone, str]:
+def detect_arch_by_kconfig(fname: str) -> Tuple[StrOrNone, str]:
arch = None
with _open(fname) as f:
return arch, 'OK'
-def detect_arch_sysctl(fname: str) -> Tuple[StrOrNone, str]:
+def detect_arch_by_sysctl(fname: str) -> Tuple[StrOrNone, str]:
arch_mapping = {
'ARM64': r'^aarch64|armv8',
'ARM': r'^armv[3-7]',
# detect the kernel microarchitecture
if kconfig:
- arch, msg = detect_arch_kconfig(kconfig)
+ arch, msg = detect_arch_by_kconfig(kconfig)
if arch is None:
sys.exit(f'[!] ERROR: {msg}')
if mode != 'json':
else:
assert(not cmdline), 'wrong perform_checking() usage'
assert(sysctl), 'wrong perform_checking() usage'
- arch, msg = detect_arch_sysctl(sysctl)
+ arch, msg = detect_arch_by_sysctl(sysctl)
if mode != 'json':
if arch is None:
print(f'[!] WARNING: {msg}, arch-dependent checks will be dropped')