Lovely-XPP / OCUpdater

Utility for hackintosh user to update OpenCorePkg and main kexts
3 stars 1 forks source link

Error in OCUpdater.py after requirements on Ventura #1

Closed perez987 closed 1 year ago

perez987 commented 1 year ago

Good night, after cloning the repo and installing requirements, when I run OCUpdater.command (double click or directly in Terminal) I get an error:

Traceback (most recent call last):
  File "/Users/yo/Developer/OCUpdater/OCUpdater.py", line 1217, in <module>
    ocup.main()
  File "/Users/yo/Developer/OCUpdater/OCUpdater.py", line 1053, in main
    self.init()
  File "/Users/yo/Developer/OCUpdater/OCUpdater.py", line 411, in init
    self.mount_EFI()
  File "/Users/yo/Developer/OCUpdater/OCUpdater.py", line 373, in mount_EFI
    out = out.split('disk')[1]
IndexError: list index out of range

I'm on Ventura and python 3.10.7.

Lovely-XPP commented 1 year ago

Would you give a capture of running the command below in the terminal.

diskutil list
Lovely-XPP commented 1 year ago

In my code, I try to identify EFI by running this command and extract EFI info from it, so maybe something wrong with it.

perez987 commented 1 year ago
% /Users/yo > diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *500.1 GB   disk0
   1:               Windows_NTFS DATOS                   500.1 GB   disk0s1

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk1
   1:                        EFI EFI                     175.0 MB   disk1s1
   2:       Microsoft Basic Data WINDOWS                 499.3 GB   disk1s2
   3:           Windows Recovery                         636.5 MB   disk1s3

/dev/disk2 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                 Apple_APFS Container disk5         499.9 GB   disk2s2

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk3
   1:                        EFI EFI                     209.7 MB   disk3s1
   2:                 Apple_APFS Container disk4         499.9 GB   disk3s2

/dev/disk4 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +499.9 GB   disk4
                                 Physical Store disk3s2
   1:                APFS Volume macOS13 - Datos         122.1 GB   disk4s1
   2:                APFS Volume Preboot                 1.9 GB     disk4s2
   3:                APFS Volume Recovery                1.1 GB     disk4s3
   4:                APFS Volume macOS13                 8.8 GB     disk4s4
   5:                APFS Volume VM                      1.1 MB     disk4s6

/dev/disk5 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +499.9 GB   disk5
                                 Physical Store disk2s2
   1:                APFS Volume macOS13G - Data         121.5 GB   disk5s1
   2:                APFS Volume macOS13G                8.8 GB     disk5s3
   3:              APFS Snapshot com.apple.os.update-... 8.8 GB     disk5s3s1
   4:                APFS Volume Preboot                 1.8 GB     disk5s4
   5:                APFS Volume Recovery                1.1 GB     disk5s5
   6:                APFS Volume VM                      1.1 MB     disk5s6

Currently working on macOS13G system.

perez987 commented 1 year ago

@Lovely-XPP Maybe the problem is when there are more than 1 EFI partition.

perez987 commented 1 year ago

Tried with only 1 macOS EFI, the error is not fixed.

% /Users/yo > diskutil list                                               
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI EFI                     175.0 MB   disk0s1
   2:       Microsoft Basic Data WINDOWS                 499.3 GB   disk0s2
   3:           Windows Recovery                         636.5 MB   disk0s3

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *500.1 GB   disk1
   1:               Windows_NTFS DATOS                   500.1 GB   disk1s1

/dev/disk2 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                 Apple_APFS Container disk3         499.9 GB   disk2s2

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +499.9 GB   disk3
                                 Physical Store disk2s2
   1:                APFS Volume macOS13G - Data         121.4 GB   disk3s1
   2:                APFS Volume macOS13G                8.8 GB     disk3s3
   3:              APFS Snapshot com.apple.os.update-... 8.8 GB     disk3s3s1
   4:                APFS Volume Preboot                 1.8 GB     disk3s4
   5:                APFS Volume Recovery                1.1 GB     disk3s5
   6:                APFS Volume VM                      1.1 MB     disk3s6

But there are 1 Windows EFI, I don't know if it can interfere somehow.

Lovely-XPP commented 1 year ago

Wait a minute, I will try to fix this bug.

Lovely-XPP commented 1 year ago

I just uploaded the latest code, it may solve the problem, but when meeting more than 2 EFI, it will automatically choose the first one.

Lovely-XPP commented 1 year ago

Thanks for you feedback, I only tested it on my PC before, so there will be some bugs. By the way, I will add feature on selecting EFIs when meeting more than 2 EFI disks.

perez987 commented 1 year ago

Thanks, I’ll try and comment.

perez987 commented 1 year ago

Ok, now OCUpdater.command runs fine but, as the Windows EFI on my system is the first detected EFI, it doesn't find OpenCore. I have Windows 11 in a different disk, probably is the first disk seen on the motherboard.

######################################################################################
#                               OpenCore Updater V1.28                               #
######################################################################################

[Info] Preparing for running...
[Info] Data File not Found, Downloading...
[Info] Downloading Done
[Info] Data File Found...
[Info] Reading Data File...
[Error] Not OpenCore Detected, please check EFI patition
[Info] The script is terminated.

Without wishing to give you more work, there must be some way to know what the EFI of the booted macOS system is. Or it might be easier to create the EFI with the updated OpenCore in a different location by acting over an EFI folder that the user has previously saved to a folder on disk.

After all, they are just ideas. Tell me if you need to try any changes that I will gladly do. My programming knowledge is small and I am not able to help you with the source code :-(

Lovely-XPP commented 1 year ago

Thanks a lot. Would you provide the whole EFI partition folder including OpenCore for debugging. I have an idea to change current way to identify OpenCore.

perez987 commented 1 year ago

I’ll do it later, not at home now.

perez987 commented 1 year ago

This is the structure of the EFI folder, it's the same in both macOS disks.

% /Volumes/EFI/EFI > tree -A
.
├── BOOT
└── OC
    ├── ACPI
    ├── Drivers
    ├── Kexts
    ├── OpenCore.efi
    ├── Resources
    ├── Tools
    └── config.plist
efi
Lovely-XPP commented 1 year ago

okey, thanks. I will update codes soon.

Lovely-XPP commented 1 year ago

I just uploaded the latest code, it add the feature of detecting OC of EFIs, if more than 1 EFI detected, user may choose one.

perez987 commented 1 year ago

Perfect!!! Thanks.

Stage 1

[Warn] Detect More than 1 EFI Patition with OC Folder, Please choose one!
0. /dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk3         499.9 GB   disk1s2

0. /dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk4
   1:                        EFI EFI                     209.7 MB   disk4s1
   2:                 Apple_APFS Container disk5         499.9 GB   disk4s2

Please input 0 ~ 2 :1

Stage 2

Current Status:
     EFI: mounted
     OpenCore: Detected, 0.8.6 [Update Available]
     Kexts: 4 Update Available
     Network: Online
     Remote Data: loaded
     Local Data: loaded
     Update Type: Release

A. Show All Kexts Information
B. Backup EFI
C. Change Update Type to Debug
D. Download and Update Remote Database
L. Reload Data
R. Refresh Network Status
S. Show Update Information
UO. Update OpenCore (Automatically Backup EFI)
UK. Update Kexts (Automatically Backup EFI)

Q. Quit

Please select your option: uo

Stage 3

> Update OpenCore

[Info] EFI folder is backing up...
[Info] EFI is successfully backup to: /Users/yo/Downloads/OCUpdater-main/backup_EFI/2022_11_10_20_38_58.zip
[Info] EFI back up Done
[Info] OpenCore Update Begin
[Info] Downloading OpenCorePkg...

[Info] Download Done
[Info] Extract OpenCorePkg...
[Info] Extract Done
[Info] Updating OpenCorePkg Core...
[Info] Update Core Done
[Info] Updating OpenCorePkg Drivers...
[Warning] Driver HfsPlus.efi is not in Official Drivers folders, update skipped
[Info] Update Drivers Done
[Info] Updating OpenCorePkg Tools...
[Info] Update Tools Done
[Info] **** Config plist check Done, No issues Found! ****
[Info] Cleaning cache...
[Info] Clean Done
Press [Enter] to continue...

Stage 4

All Kext Packages Update Successfully:
   Lilu
   VirtualSMC
   AppleALC
   IntelMausi
   RestrictEvents
   NVMeFix
   WhateverGreen
   CPUFriend

[Info] OpenCore Update Done
[Info] Updating data...
[Info] Update data Done

Press [Enter] to back...
perez987 commented 1 year ago

Good work!!! And good night.

Lovely-XPP commented 1 year ago

That's great. Thanks for your feedback again!😁