5
5
LOCAL_VERSION = "0.3.0"
6
6
LATEST_VERSION_URL = "https://github.com/AppleOSX/UXTU4Unix/releases/latest"
7
7
GITHUB_API_URL = "https://api.github.com/repos/AppleOSX/UXTU4Unix/releases/latest"
8
- cpu_codename = ["Raven" , "Picasso" , "Massite" , "Renoir" , "Cezanne" , "Dali" , "Lucienne" , "Van Gogh" , "Rembrandt" , "Phoenix Point" , "Hawk Point" , "Strix Point" ]
9
8
os .makedirs ('Logs' , exist_ok = True )
10
9
logging .basicConfig (filename = 'Logs/UXTU4Unixlog' , filemode = 'w' , encoding = 'utf-8' ,
11
10
level = logging .INFO , format = '%(levelname)s %(asctime)s %(message)s' ,
18
17
cfg = ConfigParser ()
19
18
cfg .read (CONFIG_PATH )
20
19
20
+ ryzen_family = [
21
+ "Unknown" ,
22
+ "SummitRidge" ,
23
+ "PinnacleRidge" ,
24
+ "RavenRidge" ,
25
+ "Dali" ,
26
+ "Pollock" ,
27
+ "Picasso" ,
28
+ "FireFlight" ,
29
+ "Matisse" ,
30
+ "Renoir" ,
31
+ "Lucienne" ,
32
+ "VanGogh" ,
33
+ "Mendocino" ,
34
+ "Vermeer" ,
35
+ "Cezanne_Barcelo" ,
36
+ "Rembrandt" ,
37
+ "Raphael" ,
38
+ "DragonRange" ,
39
+ "PhoenixPoint" ,
40
+ "PhoenixPoint2" ,
41
+ "HawkPoint" ,
42
+ "SonomaValley" ,
43
+ "GraniteRidge" ,
44
+ "FireRange" ,
45
+ "StrixPoint" ,
46
+ "StrixPoint2" ,
47
+ "Sarlak" ,
48
+ ]
49
+
21
50
def clear ():
22
51
subprocess .call ('clear' , shell = True )
23
52
logging .info (r"""
@@ -31,7 +60,7 @@ def clear():
31
60
)
32
61
if cfg .get ('Settings' , 'Debug' , fallback = '0' ) == '1' :
33
62
logging .info (f" Loaded: { cfg .get ('User' , 'Preset' ,fallback = '' )} " )
34
- logging .info (f" Version: { LOCAL_VERSION } by GorouFlex and AppleOSX (macOS Edition) - Special Beta 1 " )
63
+ logging .info (f" Version: { LOCAL_VERSION } by GorouFlex and AppleOSX (macOS Edition)" )
35
64
logging .info ("" )
36
65
37
66
def get_hardware_info (command , use_sudo = False ):
@@ -45,12 +74,89 @@ def get_hardware_info(command, use_sudo=False):
45
74
output , error = process .communicate ()
46
75
return output .decode ('utf-8' ).strip ()
47
76
77
+ def get_codename ():
78
+ cpu = cfg .get ('Info' , 'CPU' )
79
+ signature = cfg .get ('Info' , 'Signature' )
80
+ words = signature .split (' ' )
81
+ family_index = words .index ("Family" ) + 1
82
+ model_index = words .index ("Model" ) + 1
83
+ stepping_index = words .index ("Stepping" ) + 1
84
+ cpu_family = int (words [family_index ].rstrip (',' ))
85
+ cpu_model = int (words [model_index ].rstrip (',' ))
86
+ cpu_stepping = int (words [stepping_index ].rstrip (',' ))
87
+ if cpu == 'Intel' :
88
+ cfg .set ('Info' , 'Type' , 'Intel' )
89
+ else :
90
+ if cpu_family == 23 :
91
+ cfg .set ('Info' , 'Architecture' , 'Zen 1 - Zen 2' )
92
+ if cpu_model == 1 :
93
+ cfg .set ('Info' , 'Family' , 'SummitRidge' )
94
+ elif cpu_model == 8 :
95
+ cfg .set ('Info' , 'Family' , 'PinnacleRidge' )
96
+ elif cpu_model == 17 or cpu_model == 18 :
97
+ cfg .set ('Info' , 'Family' , 'RavenRidge' )
98
+ elif cpu_model == 24 :
99
+ cfg .set ('Info' , 'Family' , 'Picasso' )
100
+ elif cpu_model == 32 and '15e' in cpu or '15Ce' in cpu or '20e' in cpu :
101
+ cfg .set ('Info' , 'Family' , 'Pollock' )
102
+ elif cpu_model == 32 :
103
+ cfg .set ('Info' , 'Family' , 'Dali' )
104
+ elif cpu_model == 80 :
105
+ cfg .set ('Info' , 'Family' , 'FireFlight' )
106
+ elif cpu_model == 96 :
107
+ cfg .set ('Info' , 'Family' , 'Renoir' )
108
+ elif cpu_model == 104 :
109
+ cfg .set ('Info' , 'Family' , 'Lucienne' )
110
+ elif cpu_model == 113 :
111
+ cfg .set ('Info' , 'Family' , 'Matisse' )
112
+ elif cpu_model == 144 :
113
+ cfg .set ('Info' , 'Family' , 'VanGogh' )
114
+ elif cpu_model == 160 :
115
+ cfg .set ('Info' , 'Family' , 'Mendocino' )
116
+ elif cpu_family == 25 :
117
+ cfg .set ('Info' , 'Architecture' , 'Zen 3 - Zen 4' )
118
+ if cpu_model == 33 :
119
+ cfg .set ('Info' , 'Family' , 'Vermeer' )
120
+ elif cpu_model == 63 or cpu_model == 68 :
121
+ cfg .set ('Info' , 'Family' , 'Rembrandt' )
122
+ elif cpu_model == 80 :
123
+ cfg .set ('Info' , 'Family' , 'Cezanne_Barcelo' )
124
+ elif cpu_model == 97 and 'HX' in cpu :
125
+ cfg .set ('Info' , 'Family' , 'DragonRange' )
126
+ elif cpu_model == 97 :
127
+ cfg .set ('Info' , 'Family' , 'Raphael' )
128
+ elif cpu_model == 116 :
129
+ cfg .set ('Info' , 'Family' , 'PhoenixPoint' )
130
+ elif cpu_model == 120 :
131
+ cfg .set ('Info' , 'Family' , 'PhoenixPoint2' )
132
+ elif cpu_model == 117 :
133
+ cfg .set ('Info' , 'Family' , 'HawkPoint' )
134
+ elif cpu_family == 26 :
135
+ cfg .set ('Info' , 'Architecture' , 'Zen 5 - Zen 6' )
136
+ if cpu_model == 32 :
137
+ cfg .set ('Info' , 'Family' , 'StrixPoint' )
138
+ else :
139
+ cfg .set ('Info' , 'Family' , 'GraniteRidge' )
140
+ else :
141
+ cfg .set ('Info' , 'Family' , 'Unknown' )
142
+ with open (CONFIG_PATH , 'w' ) as config_file :
143
+ cfg .write (config_file )
144
+ family = cfg .get ('Info' , 'Family' )
145
+ if 'SummitRidge' in family or 'PinnacleRidge' in family or 'Matisse' in family or 'Vermeer' in family or 'Raphael' in family or 'GraniteRidge' in family :
146
+ cfg .set ('Info' , 'Type' , 'Amd_Desktop_Cpu' )
147
+ else :
148
+ cfg .set ('Info' , 'Type' , 'Amd_Apu' )
149
+ with open (CONFIG_PATH , 'w' ) as config_file :
150
+ cfg .write (config_file )
151
+
48
152
def get_presets ():
49
- cpu_family = get_hardware_info (f"{ current_dir } /Assets/ryzenadj -i | grep 'CPU Family' | awk -F\" : \" '{{print $2}}'" , use_sudo = True )
50
- cpu_model = get_hardware_info ("sysctl -n machdep.cpu.brand_string" )
153
+ cpu_family = cfg .get ('Info' , 'Family' )
154
+ cpu_model = cfg .get ('Info' , 'CPU' )
155
+ cpu_type = cfg .get ('Info' , 'Type' )
156
+ cpu_model = cpu_model .replace ("AMD" , "" ).replace ("with" , "" ).replace ("Mobile" , "" ).replace ("Ryzen" , "" ).replace ("Radeon" , "" ).replace ("Graphics" , "" ).replace ("Vega" , "" ).replace ("Gfx" , "" )
51
157
loca = None
52
- try :
53
- if cpu_codename .index (cpu_family ) < cpu_codename .index ("Massite " ):
158
+ if cpu_type == 'Amd_Apu' :
159
+ if ryzen_family .index (cpu_family ) < ryzen_family .index ("Matisse " ):
54
160
if "U" in cpu_model or "e" in cpu_model or "Ce" in cpu_model :
55
161
loca = "Assets.Presets.AMDAPUPreMatisse_U_e_Ce"
56
162
from Assets .Presets .AMDAPUPreMatisse_U_e_Ce import PRESETS
@@ -66,7 +172,7 @@ def get_presets():
66
172
else :
67
173
loca = "Assets.Presets.AMDCPU"
68
174
from Assets .Presets .AMDCPU import PRESETS
69
- elif cpu_codename .index (cpu_family ) > cpu_codename .index ("Massite " ):
175
+ elif ryzen_family .index (cpu_family ) > ryzen_family .index ("Matisse " ):
70
176
if "U" in cpu_model :
71
177
loca = "Assets.Presets.AMDAPUPostMatisse_U"
72
178
from Assets .Presets .AMDAPUPostMatisse_U import PRESETS
@@ -88,9 +194,6 @@ def get_presets():
88
194
else :
89
195
loca = "Assets.Presets.AMDCPU"
90
196
from Assets .Presets .AMDCPU import PRESETS
91
- except :
92
- loca = "Assets.Presets.AMDCPU"
93
- from Assets .Presets .AMDCPU import PRESETS
94
197
cfg .set ('User' , 'Preset' , loca )
95
198
with open (CONFIG_PATH , 'w' ) as config_file :
96
199
cfg .write (config_file )
@@ -102,12 +205,14 @@ def hardware_info():
102
205
logging .info (
103
206
f' - Processor: { get_hardware_info ("sysctl -n machdep.cpu.brand_string" )} '
104
207
)
105
- cpu_family = get_hardware_info ( "Assets/ryzenadj -i | grep 'CPU Family'" , use_sudo = True ). strip ( )
208
+ cpu_family = cfg . get ( 'Info' , 'Family' )
106
209
smu_version = get_hardware_info ("Assets/ryzenadj -i | grep 'SMU BIOS Interface Version'" , use_sudo = True ).strip ()
107
210
if cpu_family :
108
- logging .info (f' - { cpu_family } ' )
211
+ logging .info (f' - Codename: { cpu_family } ' )
109
212
if smu_version :
110
213
logging .info (f' - { smu_version } ' )
214
+ logging .info (f' - Architecture: { cfg .get ("Info" , "Architecture" )} ' )
215
+ logging .info (f' - Type: { cfg .get ("Info" , "Type" )} ' )
111
216
logging .info (f' - Cores: { get_hardware_info ("sysctl -n hw.physicalcpu" )} ' )
112
217
logging .info (f' - Threads: { get_hardware_info ("sysctl -n hw.logicalcpu" )} ' )
113
218
logging .info (
@@ -130,6 +235,8 @@ def welcome_tutorial():
130
235
cfg .add_section ('User' )
131
236
if not cfg .has_section ('Settings' ):
132
237
cfg .add_section ('Settings' )
238
+ if not cfg .has_section ('Info' ):
239
+ cfg .add_section ('Info' )
133
240
clear ()
134
241
logging .info ("--------------- Welcome to UXTU4Unix ---------------" )
135
242
logging .info ("Designed for AMD Zen-based processors on macOS/Linux" )
@@ -164,13 +271,16 @@ def welcome_tutorial():
164
271
cfg .set ('Settings' , 'DynamicMode' , '0' )
165
272
cfg .set ('Settings' , 'Debug' , '1' )
166
273
cfg .set ('Settings' , 'SIP' , '03080000' )
274
+ cfg .set ('Info' , 'CPU' , get_hardware_info (f"{ current_dir } /Assets/dmidecode -t processor | grep 'Version' | awk -F': ' '{{print $2}}'" , use_sudo = True ).strip ())
275
+ cfg .set ('Info' , 'Signature' , get_hardware_info (f"{ current_dir } /Assets/dmidecode -t processor | grep 'Signature' | awk -F': ' '{{print $2}}'" , use_sudo = True ).strip ())
167
276
except ValueError :
168
277
logging .info ("Invalid option." )
169
278
raise SystemExit
170
279
with open (CONFIG_PATH , 'w' ) as config_file :
171
280
cfg .write (config_file )
172
281
if not check_run ():
173
282
install_menu ()
283
+ get_codename ()
174
284
preset_cfg ()
175
285
clear ()
176
286
@@ -670,12 +780,11 @@ def about():
670
780
while True :
671
781
clear ()
672
782
logging .info ("About UXTU4Unix" )
673
- logging .info ("The Stepping Codename Update (3BL2TDREAM )" )
783
+ logging .info ("The L2T Update (2FUTURE )" )
674
784
logging .info ("----------------------------" )
675
785
logging .info ("Maintainer: GorouFlex\n CLI: GorouFlex" )
676
786
logging .info ("GUI: NotchApple1703\n Advisor: NotchApple1703" )
677
- logging .info ("dmidecode for macOS: Acidanthera" )
678
- logging .info ("Command file for macOS: CorpNewt\n Tester: nlqanh524" )
787
+ logging .info ("Command file: CorpNewt\n Tester: nlqanh524" )
679
788
logging .info ("----------------------------" )
680
789
try :
681
790
logging .info (f"F. Force update to the latest version ({ get_latest_ver ()} )" )
0 commit comments