Skip to content

Commit

Permalink
Small refinements and start work on VBIOS dumper
Browse files Browse the repository at this point in the history
  • Loading branch information
Coopydood committed May 19, 2023
1 parent 9346335 commit 0bea280
Show file tree
Hide file tree
Showing 7 changed files with 552 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ resources/script_store/restore/*.py
resources/script_store/restore/*.sh
INTERNAL_CHECKLIST.pdf
INTERNAL_CHECKLIST.txt
internal/*
internal/*
resources/.webversion
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ Here's a table with my best judgement on minimum, recommended, and best system r
<li><b>Wget</b> 》 <code>wget</code></li>
<li><b>QEMU</b> 》 <code>qemu-base</code> or <code>qemu-full</code></li>
<li><b>Libvirt</b> 》 <code>libvirt</code></li>
<li><b>DNSmasq</b> 》 <code>dnsmasq</code></li>
<li><b>Python</b> 》 <code>python</code></li>
</ul>
<b>Optional / Recommended</b>
<ul>
<li><b>Virtual Machine Manager (GUI)</b> 》 <code>virt-manager</code></li>
<li><b>Virsh</b> 》 <code>virsh</code></li>
</ul>
</details>

Expand Down
1 change: 0 additions & 1 deletion resources/.webversion

This file was deleted.

8 changes: 0 additions & 8 deletions resources/UPGRADEPATH

This file was deleted.

64 changes: 64 additions & 0 deletions scripts/extras/dump-vbios.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
# pylint: disable=C0301,C0116,C0103,R0903

"""
This script was created by Coopydood as part of the ultimate-macOS-KVM project.
https://github.com/user/Coopydood
https://github.com/Coopydood/ultimate-macOS-KVM
Signature: 4CD28348A3DD016F
"""

# This script should NOT be run directly, but instead from the main "main.py" script.


import os
import time
import subprocess
import re
import json
import sys
import argparse

sys.path.insert(0, 'scripts')

detectChoice = 1
latestOSName = "Ventura"
latestOSVer = "13"
runs = 0

class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'

def startup():
global detectChoice
print("\n\n Welcome to"+color.BOLD+color.YELLOW,"Dump VBIOS Tool"+color.END,"")
print(" Created by",color.BOLD+"Coopydood\n"+color.END)
print(" This script will attempt to guide you through the process\n of dumping your GPU's VBIOS into a generated ROM file that\n can be used with OVMF.\n")
#print(color.BOLD+"\n"+"Profile:"+color.END,"https://github.com/Coopydood")
#print(color.BOLD+" Repo:"+color.END,"https://github.com/Coopydood/ultimate-macOS-KVM")
print(" Select an option to continue.")
print(color.BOLD+"\n 1. Auto-detect (Recommended)")
print(color.END+" Detects installed GPUs and lets you select one\n")
print(color.END+" 2. Enter VFIO-PCI ID manually...")
print(color.END+" B. Back...")
print(color.END+" Q. Exit\n")
detectChoice = str(input(color.BOLD+"Select> "+color.END))




def clear(): print("\n" * 150)

clear()
startup()
44 changes: 22 additions & 22 deletions scripts/extras/gpu-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def autoRun():

for x in vgaGrep:
#val = x.split('[', 1)[1].split(']')
a = "aaaa"
a = "aaaa" # aaaaaaaa?
val = re.findall('\[.*?\]', x)
vgaGrepT.append(val)
gpuList = open("scripts/gpulist.json")
Expand Down Expand Up @@ -134,7 +134,7 @@ def autoRun():
elif gpuCount == 1:
print(" I"+color.BOLD+color.GREEN,"successfully"+color.END,"detected"+color.BOLD,gpuCount,"GPU"+color.END,"in your system:\n")
else:
print(" I"+color.BOLD+color.RED,"failed"+color.END,"to detect any GPUs in your system.\nSomething has went very wrong somewhere, or your GPU is weirder than you are.\nPerhaps try entering your GPU model"+color.BOLD,"manually"+color.END,"by selecting the second option instead.\n")
print(" I"+color.BOLD+color.RED,"failed"+color.END,"to detect any GPUs in your system.\n Something has went very wrong somewhere, or your GPU is weirder than you are.\n Perhaps try entering your GPU model"+color.BOLD,"manually"+color.END,"by selecting the second option instead.\n")

for gpu in gpus:
if (gpu["name"]) in model:
Expand Down Expand Up @@ -266,12 +266,12 @@ def manualRun():
if args.manual is not None:
model = args.manual
else:
print(color.BOLD+"Enter your GPU manually\n")
print("\nYou have chosen to"+color.BOLD,"enter your GPU model manually."+color.END)
print("To do this, simply type the model of your GPU and hit the ENTER key. You do not\nhave to include the vendor name.\n")
print(color.BOLD+" Example:"+color.END+" If you had an",color.BOLD+"AMD Radeon RX 550")
print(color.END+" You would type"+color.BOLD,"RX 550")
print(color.BOLD+color.CYAN+"\nTIP:"+color.END,"You can see a list of GPUs installed in your system by running "+color.BOLD+"lspci -v | grep \"VGA\"")
print(color.BOLD+" Enter your GPU manually\n")
print("\n You have chosen to"+color.BOLD,"enter your GPU model manually."+color.END)
print(" To do this, simply type the model of your GPU and hit the ENTER key. You do not\n have to include the vendor name.\n")
print(color.BOLD+" Example:"+color.END+" If you had an",color.BOLD+"AMD Radeon RX 550")
print(color.END+" You would type"+color.BOLD,"RX 550")
print(color.BOLD+color.CYAN+"\n TIP:"+color.END,"You can see a list of GPUs installed in your system by running "+color.BOLD+"lspci -v | grep \"VGA\"")
print(color.BOLD+"\n")
model = str(input(color.BOLD+"Model> "+color.END))

Expand All @@ -287,9 +287,9 @@ def manualRun():
gpuCount = gpuCount + 1

if gpuCount == 1:
print("I"+color.BOLD+color.GREEN,"successfully"+color.END,"found a match for "+color.BOLD+"\""+model+"\""+color.END+" in the database:\n")
print(" I"+color.BOLD+color.GREEN,"successfully"+color.END,"found a match for "+color.BOLD+"\""+model+"\""+color.END+" in the database:\n")
else:
print("I"+color.BOLD+color.RED,"failed"+color.END,"to find a match for "+color.BOLD+"\""+model+"\""+color.END+" in the database.\nPlease check your"+color.BOLD,"spelling"+color.END,"and ensure you're not imagining a GPU's existence.\n")
print(" I"+color.BOLD+color.RED,"failed"+color.END,"to find a match for "+color.BOLD+"\""+model+"\""+color.END+" in the database.\n Please check your"+color.BOLD,"spelling"+color.END,"and ensure you're not imagining a GPU's existence.\n")
exit

for gpu in gpus:
Expand Down Expand Up @@ -390,29 +390,29 @@ def manualRun():
if "XT" in model:
gpuName = gpuName + " XT"

print(color.BOLD+gpuName+color.END)
print("───────────────────────────────")
print(" "+color.BOLD+gpuName+color.END)
print(" ───────────────────────────────")
if gpuSupport == True:
print(color.BOLD+color.GREEN+"●",color.END+"Supported\n")
print(color.BOLD+color.GREEN+" ●",color.END+"Supported\n")
elif gpuSupport == False:
print(color.BOLD+color.RED+"●",color.END+"Unsupported\n")
print(color.BOLD+color.RED+" ●",color.END+"Unsupported\n")
else:
print(color.BOLD+color.YELLOW+"●",color.END+"Problematic\n")
print(color.BOLD+color.YELLOW+" ●",color.END+"Problematic\n")

if gpuMaxOS == "9999":
print(color.BOLD+"Maximum macOS:"+color.END,"Latest /",latestOSName,"("+latestOSVer+")")
print(color.BOLD+" Maximum macOS:"+color.END,"Latest /",latestOSName,"("+latestOSVer+")")
elif gpuMaxOS == "-1":
print(color.BOLD+"Maximum macOS:"+color.END,"N/A")
print(color.BOLD+" Maximum macOS:"+color.END,"N/A")
else:
print(color.BOLD+"Maximum macOS:"+color.END,gpuMaxOSF)
print(color.BOLD+" Maximum macOS:"+color.END,gpuMaxOSF)

if gpuMinOS == "-1":
print(color.BOLD+"Minimum macOS:"+color.END,"N/A")
print(color.BOLD+" Minimum macOS:"+color.END,"N/A")
else:
print(color.BOLD+"Minimum macOS:"+color.END,gpuMinOSF)
print(color.BOLD+" Minimum macOS:"+color.END,gpuMinOSF)

print("\n"+color.BOLD+"Additional Information"+color.END)
print(gpuQuirks)
print("\n"+color.BOLD+" Additional Information"+color.END)
print(" "+gpuQuirks)

print("\n")
exit
Expand Down
Loading

0 comments on commit 0bea280

Please sign in to comment.