6 from threading import Thread
13 from exceptions import MissingFile
18 if phs == phase.phs("Not Initialized"):
20 os.mkdir(conf.build_folder)
21 except FileExistsError:
24 elif phs == phase.phs("Initializing"):
25 print("-- Initializing ...")
26 initialize.kconfig_parser()
28 initialize.gen_requred()
33 elif phs == phase.phs("Initialized"):
34 print("-- Initialized")
36 elif phs == phase.phs("Solution generating"):
37 print("-- Generating solution ...")
41 elif phs == phase.phs("Solution generated"):
42 print("-- Solution generated")
44 elif phs == phase.phs("Solution applying"):
45 print("-- Applying generated solution ...")
48 elif phs == phase.phs("Solution applied"):
49 print("-- Generated solution applied")
50 phase.set(2) # TODO edited
51 elif phs == phase.phs("Kernel configuration"):
52 print("-- Kernel configure ...")
54 elif phs == phase.phs("Kernel configured"):
55 print("-- Kernel configured")
57 elif phs == phase.phs("Kernel build"):
58 print("-- Build Linux ...")
61 elif phs == phase.phs("Kernel built"):
62 print("-- Linux built")
65 # TODO repair, not working
67 os.rmdir(conf.build_folder)
68 os.chdir(conf.linux_sources)
69 subprocess.call(['make','clean'])
70 os.rm('.config') # remove linux config file
73 class mainThread(Thread):
74 def __init__(self, name):
75 Thread.__init__(self, name=name)
85 def sigterm_handler(_signo, _stack_frame):
90 thr = mainThread("thred")
94 except KeyboardInterrupt:
97 #################################################################################
99 if __name__ == '__main__':
101 signal.signal(signal.SIGTERM, sigterm_handler)