Skip to content

Commit 18c4371

Browse files
authored
No longer using ryzenadj codename
1 parent a82a73c commit 18c4371

File tree

1 file changed

+124
-15
lines changed

1 file changed

+124
-15
lines changed

macOS/UXTU4Unix.py

Lines changed: 124 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
LOCAL_VERSION = "0.3.0"
66
LATEST_VERSION_URL = "https://github.com/AppleOSX/UXTU4Unix/releases/latest"
77
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"]
98
os.makedirs('Logs', exist_ok=True)
109
logging.basicConfig(filename='Logs/UXTU4Unixlog', filemode='w', encoding='utf-8',
1110
level=logging.INFO, format='%(levelname)s %(asctime)s %(message)s',
@@ -18,6 +17,36 @@
1817
cfg = ConfigParser()
1918
cfg.read(CONFIG_PATH)
2019

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+
2150
def clear():
2251
subprocess.call('clear', shell=True)
2352
logging.info(r"""
@@ -31,7 +60,7 @@ def clear():
3160
)
3261
if cfg.get('Settings', 'Debug', fallback='0') == '1':
3362
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)")
3564
logging.info("")
3665

3766
def get_hardware_info(command, use_sudo=False):
@@ -45,12 +74,89 @@ def get_hardware_info(command, use_sudo=False):
4574
output, error = process.communicate()
4675
return output.decode('utf-8').strip()
4776

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+
48152
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", "")
51157
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"):
54160
if "U" in cpu_model or "e" in cpu_model or "Ce" in cpu_model:
55161
loca = "Assets.Presets.AMDAPUPreMatisse_U_e_Ce"
56162
from Assets.Presets.AMDAPUPreMatisse_U_e_Ce import PRESETS
@@ -66,7 +172,7 @@ def get_presets():
66172
else:
67173
loca = "Assets.Presets.AMDCPU"
68174
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"):
70176
if "U" in cpu_model:
71177
loca = "Assets.Presets.AMDAPUPostMatisse_U"
72178
from Assets.Presets.AMDAPUPostMatisse_U import PRESETS
@@ -88,9 +194,6 @@ def get_presets():
88194
else:
89195
loca = "Assets.Presets.AMDCPU"
90196
from Assets.Presets.AMDCPU import PRESETS
91-
except:
92-
loca = "Assets.Presets.AMDCPU"
93-
from Assets.Presets.AMDCPU import PRESETS
94197
cfg.set('User', 'Preset', loca)
95198
with open(CONFIG_PATH, 'w') as config_file:
96199
cfg.write(config_file)
@@ -102,12 +205,14 @@ def hardware_info():
102205
logging.info(
103206
f' - Processor: {get_hardware_info("sysctl -n machdep.cpu.brand_string")}'
104207
)
105-
cpu_family = get_hardware_info("Assets/ryzenadj -i | grep 'CPU Family'", use_sudo=True).strip()
208+
cpu_family = cfg.get('Info', 'Family')
106209
smu_version = get_hardware_info("Assets/ryzenadj -i | grep 'SMU BIOS Interface Version'", use_sudo=True).strip()
107210
if cpu_family:
108-
logging.info(f' - {cpu_family}')
211+
logging.info(f' - Codename: {cpu_family}')
109212
if smu_version:
110213
logging.info(f' - {smu_version}')
214+
logging.info(f' - Architecture: {cfg.get("Info", "Architecture")}')
215+
logging.info(f' - Type: {cfg.get("Info", "Type")}')
111216
logging.info(f' - Cores: {get_hardware_info("sysctl -n hw.physicalcpu")}')
112217
logging.info(f' - Threads: {get_hardware_info("sysctl -n hw.logicalcpu")}')
113218
logging.info(
@@ -130,6 +235,8 @@ def welcome_tutorial():
130235
cfg.add_section('User')
131236
if not cfg.has_section('Settings'):
132237
cfg.add_section('Settings')
238+
if not cfg.has_section('Info'):
239+
cfg.add_section('Info')
133240
clear()
134241
logging.info("--------------- Welcome to UXTU4Unix ---------------")
135242
logging.info("Designed for AMD Zen-based processors on macOS/Linux")
@@ -164,13 +271,16 @@ def welcome_tutorial():
164271
cfg.set('Settings', 'DynamicMode', '0')
165272
cfg.set('Settings', 'Debug', '1')
166273
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())
167276
except ValueError:
168277
logging.info("Invalid option.")
169278
raise SystemExit
170279
with open(CONFIG_PATH, 'w') as config_file:
171280
cfg.write(config_file)
172281
if not check_run():
173282
install_menu()
283+
get_codename()
174284
preset_cfg()
175285
clear()
176286

@@ -670,12 +780,11 @@ def about():
670780
while True:
671781
clear()
672782
logging.info("About UXTU4Unix")
673-
logging.info("The Stepping Codename Update (3BL2TDREAM)")
783+
logging.info("The L2T Update (2FUTURE)")
674784
logging.info("----------------------------")
675785
logging.info("Maintainer: GorouFlex\nCLI: GorouFlex")
676786
logging.info("GUI: NotchApple1703\nAdvisor: NotchApple1703")
677-
logging.info("dmidecode for macOS: Acidanthera")
678-
logging.info("Command file for macOS: CorpNewt\nTester: nlqanh524")
787+
logging.info("Command file: CorpNewt\nTester: nlqanh524")
679788
logging.info("----------------------------")
680789
try:
681790
logging.info(f"F. Force update to the latest version ({get_latest_ver()})")

0 commit comments

Comments
 (0)