Skip to content

Commit

Permalink
v0.8.6 - Minor bug fixes, new updater protection
Browse files Browse the repository at this point in the history
  • Loading branch information
Coopydood committed Apr 18, 2023
1 parent fdefff7 commit d762303
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 14 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ resources/script_store/*.json
resources/script_store/extras/*.py
resources/script_store/extras/*.sh
resources/script_store/restore/*.py
resources/script_store/restore/*.sh
resources/script_store/restore/*.sh
INTERNAL_CHECKLIST.pdf
INTERNAL_CHECKLIST.txt
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ultimate-macOS-KVM
### v0.8.5
### v0.8.6
Helping you build the ultimate macOS virtual machine, powered by KVM.

## Introduction
Expand Down Expand Up @@ -128,7 +128,7 @@ This is my way of giving back to the QEMU, KVM, and VFIO community. Please don't
- Yes, my Python is pretty bad. But if it works, it works.

## Credits / Greetz
While I am the creator of these automation/ease-of-use scripts, this project is not possible without both the prior and current works of some very talented people. Although, the testing done voluntarily (no, really) by my very best online friends cannot be overstated either and so they're in here too. Hi guys.
While I am the creator of these automation/ease-of-use scripts, this project is not possible without both the prior and current works of some very talented people. The people who have tested the project are also included.
- **[Dortania](https://github.com/Dortania)** 》 Extensive documentation and Hackintosh development
- **[Kholia](https://github.com/kholia)** 》 Development of scripts and documentation. ultimate-macOS-KVM is intended as an extension to [OSX-KVM](https://github.com/kholia/OSX-KVM).
- **[thenickdude](https://github.com/thenickdude)** 》 Personal support throughout my KVM misadventures and countless community contribs. Cheers.
Expand All @@ -137,5 +137,5 @@ While I am the creator of these automation/ease-of-use scripts, this project is
- **[CyberneticSquid](https://github.com/cyberneticsquid)** 》 Testing for me at stupid-o'-clock because he's a cool Aussie.
- **[Cake](https://github.com/cam-jm)** 》 Another Aussie testing for me in the middle of my sleep-deprived nights, with a slight obsession over cake.
- **[DomTrues](https://github.com/domtrues)** 》 My personal constitution-munching American. Legend has it that I live in his attic, although even I'm not sure. Love this guy either way.
- **[Kaz](https://github.com/Eaz11)** 》 Other than his brilliant English accent's pronounciations (including "macOS Syria"), he's a good mate who's done extensive testing for me. Say hi to your nephew for me.
- **[Kaz](https://github.com/Eaz11)** 》 Other than his brilliant English accent's pronounciations (including "macOS Syria"), he's done extensive testing. Say hi to your nephew for me.
- **[GigantTech](https://twitter.com/TechGigant)** 》 Moderately annoying German guy that I convinced to install Linux subsequently letting him test my project. It's free real estate!
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.5
0.8.6
14 changes: 14 additions & 0 deletions docs/changelogs/v0-8-6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## v0.8.6
### Minor update • 18/04/2023

This update includes the following features / fixes / changes:

- Changed the way non-delta updates are flagged and dealt with
- Fixed an issue preventing the integrity check on some restore tool sessions
- The local restore tool will now warn if version differences could cause downgrade
- The local backup store is now flushed after a full restore with obliterator
- Minor wording changes to menus and readme

To see individual code changes, visit the project's commits page at https://github.com/Coopydood/ultimate-macOS-KVM/commits/main

Remember, commits by Coopydood will always be signed as **4CD28348A3DD016F** or GitHub's public key.
7 changes: 7 additions & 0 deletions resources/UPGRADEPATH
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
0.8.0
0.8.1
0.8.2
0.8.3
0.8.4
0.8.5
0.8.6
5 changes: 5 additions & 0 deletions resources/baseConfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ ID="$USR_ID"
NAME="$USR_NAME"
FILE="$USR_CFG"

IGNORE_FILE=0
REQUIRES_SUDO=0
VFIO_PTA=0
GENEPOCH=000000000

ALLOCATED_RAM="$USR_ALLOCATED_RAM"
CPU_SOCKETS="$USR_CPU_SOCKS"
CPU_CORES="$USR_CPU_CORES"
Expand Down
24 changes: 19 additions & 5 deletions scripts/repo-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,18 @@ class color:

if os.path.exists("./resources/WEBVERSION"): os.system("rm ./resources/WEBVERSION")
os.system("wget -q --output-document=./resources/WEBVERSION --no-cache --no-cookies https://raw.githubusercontent.com/Coopydood/ultimate-macOS-KVM/main/VERSION")
if os.path.exists("./resources/UPGRADEPATH"): os.system("rm ./resources/UPGRADEPATH")
os.system("wget -q --output-document=./resources/UPGRADEPATH --no-cache --no-cookies https://raw.githubusercontent.com/Coopydood/ultimate-macOS-KVM/main/UPGRADEPATH")


webVersion = open("./resources/WEBVERSION")
webVersion = webVersion.read()


time.sleep(2)
clear()

if "*" in webVersion:
noDelta = 1


webVersion = webVersion.replace("*","")

Expand All @@ -67,7 +71,15 @@ class color:
versionInt = version.replace(".","")
webVersionInt = webVersion.replace(".","")

if os.path.exists("./resources/UPGRADEPATH"):
deltaSupport = open("./resources/UPGRADEPATH")
deltaSupport = deltaSupport.read()
deltaSupport = deltaSupport.replace("\n"," ")
if version not in deltaSupport:
noDelta = 1

if "*" in webVersion:
noDelta = 1

versionInt = int(versionInt)
webVersionInt = int(webVersionInt)
Expand Down Expand Up @@ -228,11 +240,13 @@ def updateBrains():
print(color.BOLD+" Current Version\n "+" v"+version,color.END+"\n")
print(color.END+" ⊘\n")
print(color.END+color.GRAY+" Latest Version\n "+" v"+webVersion,"\n"+color.END)
print(" Your version is incompatible with the latest version.\n To protect your data, auto-update is unavailable.\n\n This happens when your version is very old,\n or a major update has been released. You can\n manually download and install it.\n")
print(color.GRAY+" 1. Download and Install..."+color.END)
print(color.BOLD+" 2. Download only")
print(" Your version is incompatible with the latest version.\n To protect your data, auto-update is unavailable.\n\n This happens when your version is too old,\n or a major update has been released. You can\n manually download and install it.\n")

print(color.BOLD+" 1. Download only")
print(color.END+" Q. Exit without updating\n")
detectChoice1 = str(input(color.BOLD+"Select> "+color.END))
if detectChoice1 == "1":
detectChoice1 == "2"
updateBrains()
elif versionInt < webVersionInt and noDelta == 0:
clear()
Expand Down
30 changes: 30 additions & 0 deletions scripts/restore/localfull.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class color:
else:
print(color.RED+color.BOLD+" ●"+color.END+" DAMAGED")


if integrity == 1:
print(color.END+color.BOLD+"\n THIS TOOL:")
print(color.BOLD+color.GREEN+" WILL "+color.END+"reset the virtual NVRAM")
Expand Down Expand Up @@ -111,6 +112,35 @@ def throwError():
if detectChoice2 == "X" or detectChoice2 == "x":

clear()

version = open("./VERSION")
version = version.read()

versionStore = open("./resources/script_store/VERSION")
versionStore = versionStore.read()

versionInt = version.replace(".","")
versionStoreInt = versionStore.replace(".","")

versionInt = int(versionInt)
versionStoreInt = int(versionStoreInt)

if versionStoreInt < versionInt:
print("\n\n "+color.BOLD+color.YELLOW+"⚠ RISK OF DOWNGRADE DETECTED"+color.END,"")
print(" Version data does not match local store\n")
print(" The version data of the repository files in the local project store\n do not match those of your current files. As a result, restoring locally\n may downgrade your repository to an older version.\n"+color.END+"")
print("\n Would you like to continue?\n"+color.END)
print(color.BOLD+" 1. Continue anyway...")
print(color.END+" Q. Exit to restore tools...\n")
detectChoice3 = str(input(color.BOLD+"Select> "+color.END))
if detectChoice3 == 1:
clear()
elif detectChoice3 == "q" or detectChoice3 == "Q":
clear()
os.system('./scripts/restoretools.py')



print("\n\n "+color.BOLD+color.RED+"↺ RESET ALL COMPONENTS LOCALLY"+color.END,"")
print(" Restoring...\n\n\n")
print(" Please wait while the restore process is in progress.\n This may take a few moments.\n\n DO NOT INTERRUPT THIS OPERATION.\n\n\n")
Expand Down
3 changes: 2 additions & 1 deletion scripts/restore/obliterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def throwError():
os.system("rm ./boot/OpenCore.qcow2 > /dev/null 2>&1")
os.system("rm ./boot/config.plist > /dev/null 2>&1")
os.system("rm -rf ./boot/EFI > /dev/null 2>&1")
os.system("rm -rf ./resources/script_store/ > /dev/null 2>&1")
os.system("rm ./ovmf/OVMF_VARS.fd > /dev/null 2>&1")
os.system("rm ./ovmf/OVMF_CODE.fd > /dev/null 2>&1")
os.system("rm ./resources/dmg2img > /dev/null 2>&1")
Expand Down Expand Up @@ -203,7 +204,7 @@ def throwError():


os.system("cp ./resources/ovmf/OVMF_CODE.fd ./ovmf/OVMF_CODE.fd")
os.system("cp ./ovmf/var/OVMF_VARS.fd ./ovmf/OVMF_VARS.fd")
os.system("cp ./resources/ovmf/OVMF_VARS.fd ./ovmf/OVMF_VARS.fd")


errorMessage = "Restoration failed. You may not have sufficient\n permissions or damaged files."
Expand Down
6 changes: 3 additions & 3 deletions scripts/restoretools.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def startup():
if detected == 0:
print("\n\n Welcome to"+color.RED+color.BOLD,"Restore Tools"+color.END,"")
print(" Created by",color.BOLD+"Coopydood\n"+color.END)
print(" This menu lets you reset and restore various aspects\n of the project, such as"+color.BOLD,"the vNVRAM, OpenCore image, OVMF\n firmware, and even the repo itself."+color.END+"\n"+color.RED,"\n Most things in this menu are intentionally destructive!"+color.END)
print(" This menu lets you reset and restore various aspects\n of the repository, such as"+color.BOLD,"the vNVRAM, OpenCore image, OVMF\n firmware, and even the repo itself."+color.END+"\n"+color.RED,"\n Most things in this menu are intentionally destructive!"+color.END)
#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(color.BOLD+"\n 1. Reset vNVRAM")
Expand All @@ -58,8 +58,8 @@ def startup():
print(color.RED+" 3. Restore OVMF code files...")
print(color.RED+" 4. Delete AutoPilot data...")
#print(color.END+" 4. Import config file into virt-manager")
print(color.RED+" R. Restore all local components...")
print(color.RED+color.BOLD+" X. Download and restore everything...")
print(color.RED+" R. Restore all components locally...")
print(color.RED+color.BOLD+" X. Download and restore repository...")
print(color.END+" B. Back...")
print(color.END+" Q. Exit\n")
detectChoice3 = str(input(color.BOLD+"Select> "+color.END))
Expand Down

0 comments on commit d762303

Please sign in to comment.