diff --git a/.gitignore b/.gitignore index c666f71..69002bc 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +resources/script_store/restore/*.sh +INTERNAL_CHECKLIST.pdf +INTERNAL_CHECKLIST.txt diff --git a/README.md b/README.md index a2990f5..27c02d3 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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! diff --git a/VERSION b/VERSION index bbde4be..120f532 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.5 \ No newline at end of file +0.8.6 \ No newline at end of file diff --git a/docs/changelogs/v0-8-6.md b/docs/changelogs/v0-8-6.md new file mode 100644 index 0000000..d1d26f8 --- /dev/null +++ b/docs/changelogs/v0-8-6.md @@ -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. \ No newline at end of file diff --git a/resources/UPGRADEPATH b/resources/UPGRADEPATH new file mode 100644 index 0000000..4549f07 --- /dev/null +++ b/resources/UPGRADEPATH @@ -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 \ No newline at end of file diff --git a/resources/baseConfig b/resources/baseConfig index 48dde95..b955823 100644 --- a/resources/baseConfig +++ b/resources/baseConfig @@ -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" diff --git a/scripts/repo-update.py b/scripts/repo-update.py index 21fd7d5..2612c80 100644 --- a/scripts/repo-update.py +++ b/scripts/repo-update.py @@ -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("*","") @@ -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) @@ -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() diff --git a/scripts/restore/localfull.py b/scripts/restore/localfull.py index 2cf90f3..794f0bc 100644 --- a/scripts/restore/localfull.py +++ b/scripts/restore/localfull.py @@ -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") @@ -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") diff --git a/scripts/restore/obliterator.py b/scripts/restore/obliterator.py index 8987044..11adf6a 100644 --- a/scripts/restore/obliterator.py +++ b/scripts/restore/obliterator.py @@ -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") @@ -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." diff --git a/scripts/restoretools.py b/scripts/restoretools.py index 7e5ddc4..7d5c7ce 100644 --- a/scripts/restoretools.py +++ b/scripts/restoretools.py @@ -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") @@ -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))