-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcompile_environment.py
More file actions
executable file
·117 lines (92 loc) · 3.86 KB
/
compile_environment.py
File metadata and controls
executable file
·117 lines (92 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/python3
import os
import sys
os.environ["BUILD_FROM_KERNEL"]='yes'
dict_project={
#sharkl2
#pike2
'sp7731e_1h10_native-userdebug' : { 'path' : 'sprd-board-config/pike2/sp7731e_1h10/', },
'sp7731e_1h20_native-userdebug' : { 'path' : 'sprd-board-config/pike2/sp7731e_1h20/', },
#sharkle
'sp9832e_1h10_native-userdebug' : { 'path' : 'sprd-board-config/sharkle/sp9832e_1h10/', },
'sp9832e_10c20_native-userdebug' : { 'path' : 'sprd-board-config/sharkle/sp9832e_10c20/', },
'sp9832e_1h10_gofu-userdebug' : { 'path' : 'sprd-board-config/sharkle/sp9832e_1h10_go/', },
'sp9832ep_haps_native-userdebug' : { 'path' : 'sprd-board-config/sharkle/sp9832ep_haps/', },
#sharkl3
's9863a1h10_Natv-userdebug' : { 'path' : 'sprd-board-config/sharkl3/sp9863a_1h10/', },
's9863a1h10_Tsc-userdebug' : { 'path' : 'sprd-board-config/sharkl3/sp9863a_1h10/', },
#sharkl5
'ums312_haps_native-userdebug' : { 'path' : 'sprd-board-config/sharkl5/ums312_haps/', },
'ums312_1h10_native-userdebug' : { 'path' : 'sprd-board-config/sharkl5/ums312_1h10/', },
'ums312_1h10_go_32b_native-userdebug' : { 'path' : 'sprd-board-config/sharkl5/ums312_1h10_go_32b/', },
#sharkl5Pro
'ums518_haps_native-userdebug' : { 'path' : 'sprd-board-config/sharkl5Pro/ums518_haps/', },
'ums518_zebu_native-userdebug' : { 'path' : 'sprd-board-config/sharkl5Pro/ums518_zebu/', },
'ums518_haps_bkd_native-userdebug' : { 'path' : 'sprd-board-config/sharkl5Pro/ums518_haps_bkd/', },
#roc1-3h10
'ud710_3h10_native-userdebug' : { 'path' : 'sprd-board-config/roc1/ud710_3h10/', },
'ud710_3h10u_native-userdebug' : { 'path' : 'sprd-board-config/roc1/ud710_3h10u/', },
#roc1-2h10
'ud710_2h10_native-userdebug' : { 'path' : 'sprd-board-config/roc1/ud710_2h10/', },
#orca-1h10
'udx710_1h10_native-userdebug' : { 'path' : 'sprd-board-config/orca/udx710_1h10/', },
#orca-2h10
'udx710_2h10_native-userdebug' : { 'path' : 'sprd-board-config/orca/udx710_2h10/', },
#orca-3h10
'udx710_3h10_native-userdebug' : { 'path' : 'sprd-board-config/orca/udx710_3h10/', },
}
print_head="""
Lunch menu... pick a combo:
You're building on Linux
Pick a number:
choice a project
"""
def transform_dict_to_list():
global list_project
list_project=list(dict_project)
list_project.sort()
def print_boardname():
print(print_head, end='')
for i in range(len(list_project)):
print(' {}. {}'.format(i + 1, list_project[i]))
print('Which would you like? [aosp_arm-eng] ')
def judge_parameters():
global board_name
if len(sys.argv) == 1:
get_line=input()
elif (len(sys.argv) == 2):
get_line=sys.argv[1]
else:
print('The num of parameter is error.')
return -1
if get_line.isdigit():
if (int(get_line) <= 0 or int(get_line) > len(list_project)):
print('The num you input is out of range, please check.')
return -1
board_name=list_project[int(get_line)-1][:-10]
else:
if get_line in list_project:
board_name=get_line[:-10]
return 0
for i in range(len(list_project)):
if (get_line == list_project[i][:-5]):
os.environ["TARGET_BUILD_VARIANT"]='user'
board_name=get_line[:-5]
return 0
print('The board name was error, please check.')
return -1
def get_board_attribute():
path=dict_project[board_name+'-userdebug']['path']+board_name
print('Get board attrubute from: ', path)
os.environ["BOARD_PATH"]=path
os.environ["TARGET_BOARD"]=board_name
def main():
os.system('rm -rf .config')
transform_dict_to_list()
print_boardname()
if (judge_parameters() == -1):
return
get_board_attribute()
os.system('make -f AndroidKernel.mk config')
if __name__ == '__main__':
main()