From 1064be45dfffe9e09f4d15378986ccee8665de7e Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 11:55:37 -0600 Subject: [PATCH 01/18] Add basic GUI to CI pipeline --- .github/workflows/build-gui.yml | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build-gui.yml diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml new file mode 100644 index 000000000..604b9f2db --- /dev/null +++ b/.github/workflows/build-gui.yml @@ -0,0 +1,39 @@ +name: CI - Build GUI + +on: + push: + workflow_dispatch: + release: + types: [published] + +jobs: + build: + name: Build GUI + runs-on: self-hosted + steps: + - uses: actions/checkout@v2 + - name: Install Python Dependencies + run: pip3 install --upgrade pyinstaller requests + + - run: pyinstaller OCLP-CLI.spec + - run: cd dist; cp OCLP-CLI ../ + - name: Download latest nightly OCLP-GUI + run: curl -S -L https://nightly.link/dortania/OCLP-GUI/workflows/build-app/master/OpenCore-Patcher-GUI.app.zip --output ./OpenCore-Patcher-GUI.app.zip + - run: unzip OpenCore-Patcher-GUI.app.zip + - name: Merge new GUI + run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ + - name: Zip new GUI + run: zip -r OpenCore\ Patcher.app.zip OpenCore-Patcher-GUI.app + - name: Upload Binary to Artifacts + uses: actions/upload-artifact@v2 + with: + name: OpenCore-Patcher-GUI.app + path: OpenCore-Patcher-GUI.app.zip + - name: Upload to Release + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: OpenCore-Patcher-GUI.app.zip + tag: ${{ github.ref }} + file_glob: true From 8cfa90f352690592bd9850c6e6f835f19f3b9afe Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 12:34:05 -0600 Subject: [PATCH 02/18] Update CI --- .github/workflows/build-gui.yml | 3 ++- merge_gui.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 merge_gui.py diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 604b9f2db..3c499de7e 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -19,9 +19,10 @@ jobs: - run: cd dist; cp OCLP-CLI ../ - name: Download latest nightly OCLP-GUI run: curl -S -L https://nightly.link/dortania/OCLP-GUI/workflows/build-app/master/OpenCore-Patcher-GUI.app.zip --output ./OpenCore-Patcher-GUI.app.zip - - run: unzip OpenCore-Patcher-GUI.app.zip + - run: unzip -o OpenCore-Patcher-GUI.app.zip - name: Merge new GUI run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ + - run: python3 merge_gui.py - name: Zip new GUI run: zip -r OpenCore\ Patcher.app.zip OpenCore-Patcher-GUI.app - name: Upload Binary to Artifacts diff --git a/merge_gui.py b/merge_gui.py new file mode 100644 index 000000000..d26acc93e --- /dev/null +++ b/merge_gui.py @@ -0,0 +1,10 @@ +# Updates build version in OCLP-GUI during CI builds +# Copyright (C) 2021 Mykola Grymalyuk +import plistlib +from pathlib import Path +from Resources import Constants + +app_path = Path.cwd() / Path ("OpenCore Patcher.app/Contents/Info.plist") +info = plistlib.load(Path(app_path).open("rb")) +info["CFBundleShortVersionString"] = Constants.Constants().patcher_version +plistlib.dump(info, Path(app_path).open("wb"), sort_keys=True) \ No newline at end of file From 56194be7163603b80df494ea074ba682d3bee187 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 12:51:47 -0600 Subject: [PATCH 03/18] Fix CI --- .github/workflows/build-gui.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 3c499de7e..6064c051d 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -20,6 +20,7 @@ jobs: - name: Download latest nightly OCLP-GUI run: curl -S -L https://nightly.link/dortania/OCLP-GUI/workflows/build-app/master/OpenCore-Patcher-GUI.app.zip --output ./OpenCore-Patcher-GUI.app.zip - run: unzip -o OpenCore-Patcher-GUI.app.zip + - run: unzip OpenCore-Patcher-GUI.app.zip - name: Merge new GUI run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py From 4f74629e3f36ac87e8dbc5fcb2bd96f6d1b8070d Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 12:54:34 -0600 Subject: [PATCH 04/18] Fix CI --- .github/workflows/build-gui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 6064c051d..ffd32703a 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -20,7 +20,7 @@ jobs: - name: Download latest nightly OCLP-GUI run: curl -S -L https://nightly.link/dortania/OCLP-GUI/workflows/build-app/master/OpenCore-Patcher-GUI.app.zip --output ./OpenCore-Patcher-GUI.app.zip - run: unzip -o OpenCore-Patcher-GUI.app.zip - - run: unzip OpenCore-Patcher-GUI.app.zip + - run: unzip OpenCore-Patcher-GUI.app.zip; rm OpenCore-Patcher-GUI.app.zip - name: Merge new GUI run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py From 5c09c103017f5473aaa2708b763ae230f63c2259 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 12:57:31 -0600 Subject: [PATCH 05/18] Fix typo --- .github/workflows/build-gui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index ffd32703a..2e118c710 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -25,7 +25,7 @@ jobs: run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py - name: Zip new GUI - run: zip -r OpenCore\ Patcher.app.zip OpenCore-Patcher-GUI.app + run: zip -r OpenCore-Patcher-GUI.app.zip OpenCore\ Patcher.app - name: Upload Binary to Artifacts uses: actions/upload-artifact@v2 with: From 44c4a488f4485c49957a8cbca6d9acc5e4f7e3c1 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:09:42 -0600 Subject: [PATCH 06/18] Add codesign to GUI --- .github/workflows/build-app.yml | 2 -- .github/workflows/build-gui.yml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 5003fc74b..7523c6972 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -18,10 +18,8 @@ jobs: - run: pyinstaller OpenCore-Patcher.spec - run: ./after_pyinstaller.sh - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' - run: cd dist; zip ../OpenCore-Patcher.zip OpenCore-Patcher; zip -r ../OpenCore-Patcher.app.zip OpenCore-Patcher.app - - run: ./../sign-app.sh - name: Upload App to Artifacts uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 2e118c710..e8b978251 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -24,8 +24,10 @@ jobs: - name: Merge new GUI run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' - name: Zip new GUI run: zip -r OpenCore-Patcher-GUI.app.zip OpenCore\ Patcher.app + - run: ./../sign-gui.sh - name: Upload Binary to Artifacts uses: actions/upload-artifact@v2 with: From 024d41c946449dadbbab7fad94c0552207dda52e Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:12:12 -0600 Subject: [PATCH 07/18] Fix incorrect file path --- .github/workflows/build-gui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index e8b978251..5b7b23b48 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -24,7 +24,7 @@ jobs: - name: Merge new GUI run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"' - name: Zip new GUI run: zip -r OpenCore-Patcher-GUI.app.zip OpenCore\ Patcher.app - run: ./../sign-gui.sh From bb5673e770c9ac23fa826058441bc48bc53c6ef8 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:15:10 -0600 Subject: [PATCH 08/18] Force codesign --- .github/workflows/build-gui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 5b7b23b48..494476990 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -24,7 +24,7 @@ jobs: - name: Merge new GUI run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"' - name: Zip new GUI run: zip -r OpenCore-Patcher-GUI.app.zip OpenCore\ Patcher.app - run: ./../sign-gui.sh From e609866c5e15426bb73091a8fb8f4a0b1d5e7a2f Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:50:29 -0600 Subject: [PATCH 09/18] Extra codesigning --- .github/workflows/build-gui.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 494476990..a74fa9e4f 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -25,6 +25,8 @@ jobs: run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/OCLP-CLI"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/oclpd"' - name: Zip new GUI run: zip -r OpenCore-Patcher-GUI.app.zip OpenCore\ Patcher.app - run: ./../sign-gui.sh From ca22da4ebb2901d2205bd3f4ddbd01c823f22c7d Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:58:12 -0600 Subject: [PATCH 10/18] Test --- .github/workflows/build-gui.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index a74fa9e4f..09f50239f 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -29,6 +29,7 @@ jobs: - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/oclpd"' - name: Zip new GUI run: zip -r OpenCore-Patcher-GUI.app.zip OpenCore\ Patcher.app + - run: /usr/bin/ditto -c -k –sequesterRsrc --keepParent OpenCore\ Patcher.app OpenCore-Patcher-GUI.app.zip - run: ./../sign-gui.sh - name: Upload Binary to Artifacts uses: actions/upload-artifact@v2 From 1bc9f3d3962af1f19e2f5681560a14de658cf305 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:59:24 -0600 Subject: [PATCH 11/18] Fix --- .github/workflows/build-gui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 09f50239f..a00e11196 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -29,7 +29,7 @@ jobs: - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/oclpd"' - name: Zip new GUI run: zip -r OpenCore-Patcher-GUI.app.zip OpenCore\ Patcher.app - - run: /usr/bin/ditto -c -k –sequesterRsrc --keepParent OpenCore\ Patcher.app OpenCore-Patcher-GUI.app.zip + - run: ditto -c -k --sequesterRsrc --keepParent OpenCore\ Patcher.app OpenCore-Patcher-GUI.app.zip - run: ./../sign-gui.sh - name: Upload Binary to Artifacts uses: actions/upload-artifact@v2 From 15a5e54cbb5318e2a909cca7b2414fa04a3e102c Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 14:06:13 -0600 Subject: [PATCH 12/18] Fix zip --- .github/workflows/build-gui.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index a00e11196..3ba777db0 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -27,8 +27,6 @@ jobs: - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"' - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/OCLP-CLI"' - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/oclpd"' - - name: Zip new GUI - run: zip -r OpenCore-Patcher-GUI.app.zip OpenCore\ Patcher.app - run: ditto -c -k --sequesterRsrc --keepParent OpenCore\ Patcher.app OpenCore-Patcher-GUI.app.zip - run: ./../sign-gui.sh - name: Upload Binary to Artifacts From 84908939608f545e1e94c0f81683894034d2c085 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 14:22:34 -0600 Subject: [PATCH 13/18] Fix error --- .github/workflows/build-gui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 3ba777db0..872efcd80 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -16,7 +16,7 @@ jobs: run: pip3 install --upgrade pyinstaller requests - run: pyinstaller OCLP-CLI.spec - - run: cd dist; cp OCLP-CLI ../ + - run: cd dist; cp OCLP-CLI ../; cd .. - name: Download latest nightly OCLP-GUI run: curl -S -L https://nightly.link/dortania/OCLP-GUI/workflows/build-app/master/OpenCore-Patcher-GUI.app.zip --output ./OpenCore-Patcher-GUI.app.zip - run: unzip -o OpenCore-Patcher-GUI.app.zip From cc2eebfd4213f00a3f77f61df829fe3796920890 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 14:34:37 -0600 Subject: [PATCH 14/18] Test --- .github/workflows/build-gui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index 872efcd80..b14833304 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -24,9 +24,9 @@ jobs: - name: Merge new GUI run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"' - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/OCLP-CLI"' - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/oclpd"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"' - run: ditto -c -k --sequesterRsrc --keepParent OpenCore\ Patcher.app OpenCore-Patcher-GUI.app.zip - run: ./../sign-gui.sh - name: Upload Binary to Artifacts From db708022e90374e0fc243dca62adf028e359fbae Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 16:20:45 -0600 Subject: [PATCH 15/18] Fix model issue --- OCLP-CLI.command | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OCLP-CLI.command b/OCLP-CLI.command index bfee6526a..b93e8a103 100755 --- a/OCLP-CLI.command +++ b/OCLP-CLI.command @@ -52,6 +52,7 @@ class OpenCoreLegacyPatcher: # Building args requiring value values parser.add_argument("--model", action="store", help="Set custom model", required=False) + parser.add_argument("--disk", action="store", help="Specifies disk to patch", required=False) parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False) # SysPatch args @@ -70,6 +71,8 @@ class OpenCoreLegacyPatcher: else: print("- Using default payloads location") + if args.disk: + print(f"Disk set: {args.disk}") if args.verbose: print("- Set verbose configuration") self.constants.verbose_debug = True @@ -104,8 +107,6 @@ class OpenCoreLegacyPatcher: if args.moderate_smbios: print("- Set Moderate SMBIOS Patching configuration") self.constants.serial_settings = "Moderate" - if args.model: - host_is_target if args.smbios_spoof: if args.smbios_spoof == "Minimal": self.constants.serial_settings = "Minimal" From baaa897d104c3cbea2d1ae70449064cf18f72d2f Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 21:46:42 -0600 Subject: [PATCH 16/18] Add disk type detection --- OCLP-CLI.command | 3 ++- Resources/Build.py | 25 +++++++++++++++++++++++++ Resources/Constants.py | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/OCLP-CLI.command b/OCLP-CLI.command index b93e8a103..c19297fad 100755 --- a/OCLP-CLI.command +++ b/OCLP-CLI.command @@ -72,7 +72,8 @@ class OpenCoreLegacyPatcher: print("- Using default payloads location") if args.disk: - print(f"Disk set: {args.disk}") + print(f"- Disk set: {args.disk}") + self.constants.disk = args.disk if args.verbose: print("- Set verbose configuration") self.constants.verbose_debug = True diff --git a/Resources/Build.py b/Resources/Build.py index 65c3db3c5..734d20396 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -98,6 +98,29 @@ class BuildOpenCore: fw_mask = b"\xff\x3f\x08\xc0\x00\x00\x00\x00" return fw_feature, fw_mask + def disk_type(self): + drive_host_info = plistlib.loads(subprocess.run(f"diskutil info -plist {self.constants.disk}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()) + sd_type = drive_host_info["MediaName"] + try: + ssd_type = drive_host_info["SolidState"] + except KeyError: + ssd_type = False + # Array filled with common SD Card names + # Note most USB-based SD Card readers generally report as "Storage Device", and no reliable way to detect further + if sd_type in ["SD Card Reader", "SD/MMC"]: + print("- Adding SD Card icon") + shutil.copy(self.constants.icon_path_sd, self.constants.opencore_release_folder) + elif ssd_type is True: + print("- Adding SSD icon") + shutil.copy(self.constants.icon_path_ssd, self.constants.opencore_release_folder) + elif drive_host_info["BusProtocol"] == "USB": + print("- Adding External USB Drive icon") + shutil.copy(self.constants.icon_path_external, self.constants.opencore_release_folder) + else: + print("- Adding Internal Drive icon") + shutil.copy(self.constants.icon_path_internal, self.constants.opencore_release_folder) + + def build_efi(self): Utilities.cls() if not self.constants.custom_model: @@ -639,6 +662,8 @@ class BuildOpenCore: if self.model == self.constants.override_smbios: print("- Adding -no_compat_check") self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -no_compat_check" + if self.constants.disk != "": + self.disk_type() def set_smbios(self): spoofed_model = self.model diff --git a/Resources/Constants.py b/Resources/Constants.py index 954cdc569..63b63ed11 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -43,6 +43,7 @@ class Constants: self.innie_version = "1.3.0" self.fw_kext = "1.0.0" self.patcher_support_pkg_version = "0.0.10" # PatcherSupportPkg + self.disk = "" # Get resource path self.current_path = Path(__file__).parent.parent.resolve() From 3ce8b18ecbecf6841da022addf24a6d17b92af3f Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Wed, 23 Jun 2021 22:11:45 -0600 Subject: [PATCH 17/18] Update CI --- .github/workflows/build-app.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 7523c6972..2683a4165 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -1,4 +1,4 @@ -name: CI - Build App +name: CI - Build TUI on: push: @@ -8,7 +8,7 @@ on: jobs: build: - name: Build App + name: Build TUI runs-on: self-hosted steps: - uses: actions/checkout@v2 @@ -19,18 +19,18 @@ jobs: - run: pyinstaller OpenCore-Patcher.spec - run: ./after_pyinstaller.sh - - run: cd dist; zip ../OpenCore-Patcher.zip OpenCore-Patcher; zip -r ../OpenCore-Patcher.app.zip OpenCore-Patcher.app + - run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app - name: Upload App to Artifacts uses: actions/upload-artifact@v2 with: - name: OpenCore-Patcher.app - path: OpenCore-Patcher.app.zip + name: OpenCore-Patcher-TUI.app + path: OpenCore-Patcher-TUI.app.zip - name: Upload to Release if: github.event_name == 'release' uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: OpenCore-Patcher.app.zip + file: OpenCore-Patcher-TUI.app.zip tag: ${{ github.ref }} file_glob: true From 04a83462c33357bda4a4ee7b7774c747e27d92ed Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Thu, 24 Jun 2021 09:19:27 -0600 Subject: [PATCH 18/18] Add notarization to TUI TUI is deprecated, binary will be dropped in the future --- .github/workflows/build-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 2683a4165..a913918d7 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -18,8 +18,9 @@ jobs: - run: pyinstaller OpenCore-Patcher.spec - run: ./after_pyinstaller.sh - + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' - run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app + - run: ./../sign-tui.sh - name: Upload App to Artifacts uses: actions/upload-artifact@v2 with: