From a37411907f2aaa82e34dc86b1ef50d0608dcb16c Mon Sep 17 00:00:00 2001 From: Coopydood <39441479+Coopydood@users.noreply.github.com> Date: Sat, 23 Sep 2023 17:08:29 +0100 Subject: [PATCH] Fix verbose typo and add support for PT presence --- resources/baseConfig | 3 ++- scripts/drpc.py | 42 ++++++++++++++++++++++++------ scripts/extras/vfio-passthrough.py | 1 + 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/resources/baseConfig b/resources/baseConfig index b7e4f1c..aa04829 100644 --- a/resources/baseConfig +++ b/resources/baseConfig @@ -30,6 +30,7 @@ ULTMOS_VERSION=0.0.0 IGNORE_FILE=0 REQUIRES_SUDO=0 VFIO_PTA=0 +VFIO_DEVICES=0 GEN_EPOCH=000000000 VERBOSE=1 DISCORD_RPC=1 @@ -117,7 +118,7 @@ echo \ \ \ \ \ Built with ULTMOS v$ULTMOS_VERSION echo \ \ \ \ \ Using $CPU_MODEL CPU model if [ $REQUIRES_SUDO = 1 ] then -echo \ \ \ \ \ Superuser priviledges enabled +echo \ \ \ \ \ Superuser privileges enabled fi if [ $VFIO_PTA = 1 ] then diff --git a/scripts/drpc.py b/scripts/drpc.py index 96bda4d..102b708 100644 --- a/scripts/drpc.py +++ b/scripts/drpc.py @@ -24,6 +24,7 @@ except: None osVer = "Unknown" +ptCount = 0 version = open("./.version") version = version.read() @@ -32,10 +33,17 @@ parser = argparse.ArgumentParser("main") parser.add_argument("--os", dest="osVer",action="store") +parser.add_argument("--pt", dest="pt",action="store") args = parser.parse_args() +#args.pt = "0" + osVer = args.osVer +try: + ptCount = int(args.pt) +except: + None client_id = "1149434759152422922" @@ -69,11 +77,29 @@ RPC.update(large_image="ultmos",large_text=projectVer,details="Loading...",buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) except: exit -time.sleep(4) -try: - RPC.update(small_image="ultmoslite",large_image=osOpt,large_text=osName,small_text=projectVer,details=osName,start=startTime,buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) - #RPC.update(small_image=osOpt,large_image="ultmos",large_text=osName,small_text=projectVer,details=osName,start=startTime,buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) - while True: - time.sleep(15) -except: - exit \ No newline at end of file +time.sleep(2) + +if ptCount == 1: + try: + RPC.update(small_image="ultmoslite",large_image=osOpt,large_text=osName,small_text=projectVer,details=osName,state="Passthrough with "+str(ptCount)+" device",start=startTime,buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) + #RPC.update(small_image=osOpt,large_image="ultmos",large_text=osName,small_text=projectVer,details=osName,start=startTime,buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) + while True: + time.sleep(15) + except: + exit +elif ptCount > 1: + try: + RPC.update(small_image="ultmoslite",large_image=osOpt,large_text=osName,small_text=projectVer,details=osName,state="Passthrough with "+str(ptCount)+" devices",start=startTime,buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) + #RPC.update(small_image=osOpt,large_image="ultmos",large_text=osName,small_text=projectVer,details=osName,start=startTime,buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) + while True: + time.sleep(15) + except: + exit +else: + try: + RPC.update(small_image="ultmoslite",large_image=osOpt,large_text=osName,small_text=projectVer,details=osName,start=startTime,buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) + #RPC.update(small_image=osOpt,large_image="ultmos",large_text=osName,small_text=projectVer,details=osName,start=startTime,buttons=([{"label": "View on GitHub", "url": "https://github.com/Coopydood/ultimate-macOS-KVM"}])) + while True: + time.sleep(15) + except: + exit \ No newline at end of file diff --git a/scripts/extras/vfio-passthrough.py b/scripts/extras/vfio-passthrough.py index f778661..cc69142 100644 --- a/scripts/extras/vfio-passthrough.py +++ b/scripts/extras/vfio-passthrough.py @@ -270,6 +270,7 @@ def manualAPSelect(): apFileM = apFileM.replace("#-display none","-display none") apFileM = apFileM.replace("REQUIRES_SUDO=0","REQUIRES_SUDO=1") apFileM = apFileM.replace("VFIO_PTA=0","VFIO_PTA=1") + apFileM = apFileM.replace("VFIO_DEVICES=0","VFIO_DEVICES="+str(slotCount)) apFileM = apFileM.replace("-device qxl-vga,vgamem_mb=128,vram_size_mb=128","#-device qxl-vga,vgamem_mb=128,vram_size_mb=128 # DISABLED BY VFIO-PCI PASSTHROUGH ASSISTANT") os.system("cp resources/ovmf/OVMF_CODE.fd ovmf/OVMF_CODE.fd") os.system("cp resources/ovmf/OVMF_VARS_PT.fd ovmf/OVMF_VARS.fd")