+def detect_arch(fname):
+ with open(fname, 'r') as f:
+ arch_pattern = re.compile("CONFIG_[a-zA-Z0-9_]*=y")
+ arch = None
+ msg = None
+ print('[+] Trying to detect architecture in "{}"...'.format(fname))
+ for line in f.readlines():
+ if arch_pattern.match(line):
+ option, value = line[7:].split('=', 1)
+ if option in supported_archs:
+ if not arch:
+ arch = option
+ else:
+ return None, 'more than one supported architecture is detected'
+ if not arch:
+ return None, 'failed to detect architecture'
+ else:
+ return arch, 'OK'
+
+
+def construct_checklist(arch):