osy / HaC-Mini

Intel NUC Hades Canyon Hackintosh support
MIT License
1.22k stars 159 forks source link

Patching OSX install usb fails at "Running Package Scripts" #63

Closed jonseppanen closed 5 years ago

jonseppanen commented 5 years ago

Describe the bug After following clean install directions while building a new install on another machine, the patcher failes at "Running Package Scripts". I notice that there is an efi drive mounted on the desktop with an ESP folder, that seems to be symlinked to itself, so it just keeps opening itself forever.

Expected behavior Patching should complete

Environment:

Additional context I can probably manually get the installer patched if I knew the manual steps to do so. Should they be documented somewhere just in case?

Logs The log states that install failed on postinstall.sh. It is likely efi related.

osy commented 5 years ago

Check diskutil list. You may not have a EFI partition. Did you format as directed? https://osy.gitbook.io/hac-mini-guide/installation-guide/installation#creating-osx-installer

jonseppanen commented 5 years ago

Formatted as directed, GUID partition map with MacOS extended journaled.

Redoing again. Im assuming following the guide creates the EFI partition on the USB?

osy commented 5 years ago

It's important that you're formatting the disk and not an existing volume on the disk. The latter way won't create the EFI partition.

jonseppanen commented 5 years ago

Got it. I'm sure I did that but I could have just blindly sped through. Will report back!

jonseppanen commented 5 years ago

Just tried twice more making sure the Device and not the volume was selected, same result. Do you think the official osx installer creator is somehow broken?

osy commented 5 years ago

It’s not the OS X creator that makes the EFI. It’s disk utility. Right after formatting do a diskutil list and make sure you see a 200MB partition as the first one and it should say GUID partition scheme.

jonseppanen commented 5 years ago

The partition definitely exists when I do diskutil list.

osy commented 5 years ago

Okay then you’ll have to attach install.log for me to see what the issue is.

jonseppanen commented 5 years ago

Just did the following on another machine (13" macbook pro touchbar)

Exact same error, exact same place. Maybe your script is making a symlink inside the efi partition incorrectly?

I have attached the log as well. install-truncated.log

jonseppanen commented 5 years ago

Attempting to run the installer results in no bootable partition found on the installer. Looks like the efi partition is being cleared out?

jonseppanen commented 5 years ago

Tried with yet another USB on another machine, same issue.

K-telj commented 5 years ago

just an fyi, I am off for a few days and was trying the opencore on a new install and got this issue here as well.

jonseppanen commented 5 years ago

Tried with an older version of Mojave installer on yet another machine, same problem. EFI folder ends up empty after the patching fails. Is there a pre-built efi folder I could download perhaps?

osy commented 5 years ago

There is, check the releases.

jonseppanen commented 5 years ago

Extracted to an EFI folder on the efi partition. Shows as bootable in bios, but only results in a black screen on boot.

zdaxie commented 5 years ago

Also encountered this problem. I wanna know do you have any solutions now? Very thanks!

osy commented 5 years ago

Sorry been super busy. You can use the EFI zip without the installer for now.

zdaxie commented 5 years ago

OK, I will try. Thanks again!

jonseppanen commented 5 years ago

As per my comment, extracting EFI zip doesnt work.

osy commented 5 years ago

Have you tried the troubleshooting tips from the guide?

jonseppanen commented 5 years ago

Which one?

  1. Get into boot picker menu: Usb wont boot in any way, black screen, no boot picker menu
  2. Reset NVRAM: See above. Its a fresh machine out of box nonetheless
  3. Reinstall Hac Mini: Cant install Hac Mini the first time from USB (this is what the issue is about)
  4. Disable Any Third Party Extensions: See above.
  5. Enable verbose boot: See above.
osy commented 5 years ago

When you press F10, do you see an entry for your USB drive?

jermafenser commented 5 years ago

I have run into a similar issue with the v2.1 installer. Usage of the v2.0 installer completed patching of the usb device successfully.

jonseppanen commented 5 years ago

Extracted to an EFI folder on the efi partition. Shows as bootable in bios, but only results in a black screen on boot.

jonseppanen commented 5 years ago

Using v2.0 of OC shows a boot entry but will not boot from it in any way, just skips on through to the existing installed linux os. An EFI folder is now present in the EFI partition when using the 2.0 patcher, fyi.

hepto commented 5 years ago

Also seeing this issue, and my installer log is the same as @jonseppanen's.

There is some good logging going on, and looks to me that it's PlistBuddy bombing out at line 46 of copy_serial.sh as they are the last two lines logged before failure ...

2019-09-25 13:21:06+10 MBAFUs-iMac installd[1192]: ./postinstall: Set: Entry, ":PlatformInfo:Generic:SystemSerialNumber", Does Not Exist
2019-09-25 13:21:06+10 MBAFUs-iMac installd[1192]: ./postinstall: File Doesn't Exist, Will Create: /Volumes/Install macOS Mojave/tmp/EFIROOTDIR/EFI/OC/config.plist

The very next line should simply echo $MLB which does not occur, so the script must exit with a failure code at that point, which causes postinstall.sh to fail, and thus the installer.

I will keep digging - I've not gone backwards far enough to see what has/hasn't occurred up to this point - maybe something simple like it can't write the file.

Also haven't gone forward enough yet to know what needs to be done after that - presumably more than just copying the EFI contents to the volume as doing that manually does not make a bootable drive.

osy commented 5 years ago

After failed installation on a freshly formatted USB, can you mount USB’s EFI partition and post the contents here? It appears that config.plist wasn’t installed properly.

hepto commented 5 years ago

No worries. With diskutil output also for completeness:

Before running installer:

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *64.2 GB    disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS Install macOS Mojave    63.8 GB    disk2s2

Contents of EFI:

ls -al /Volumes/EFIGH/
total 3
drwxrwxrwx@ 1 hepto  staff  512  2 Oct 20:37 .
drwxr-xr-x+ 6 root   wheel  192  2 Oct 20:37 ..
drwxrwxrwx  1 hepto  staff  512  2 Oct 20:37 .Spotlight-V100
drwxrwxrwx  1 hepto  staff  512  2 Oct 20:37 .fseventsd

After installer fails:

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *64.2 GB    disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS Install macOS Mojave    63.8 GB    disk2s2
ls -al /Volumes/ESP/
total 3
drwxrwxrwx@ 1 hepto  staff  512  2 Oct 20:37 .
drwxr-xr-x+ 6 root   wheel  192  2 Oct 20:39 ..
drwxrwxrwx  1 hepto  staff  512  2 Oct 20:37 .Spotlight-V100
drwxrwxrwx  1 hepto  staff  512  2 Oct 20:39 .fseventsd

So, empty :(

Where in the Installer does the copy take place?

hepto commented 5 years ago

Not sure if relevant, but in trying to rule out blocks of code, note that if I untick the backup option under Customise (as this is a virgin install), I then get the recursive symlink mentioned earlier:

ls -al /Volumes/ESP/
total 4
drwxrwxrwx@ 1 hepto  staff  512  2 Oct 20:43 .
drwxr-xr-x+ 6 root   wheel  192  2 Oct 20:39 ..
drwxrwxrwx  1 hepto  staff  512  2 Oct 20:37 .Spotlight-V100
drwxrwxrwx  1 hepto  staff  512  2 Oct 20:39 .fseventsd
lrwxrwxrwx  1 hepto  staff   12  2 Oct 20:43 ESP -> /Volumes/ESP
osy commented 5 years ago

Can you try this one? I found a bug in the install script. HaCMini.zip

hepto commented 5 years ago

I'm sorry, but identical results. Attached is the log.

Installer Log 2-Oct-2019.txt

osy commented 5 years ago

HaCMini.pkg.zip It seems like OSX installer has a bug. It assumes “/tmp” always points to “/private/tmp”. I’ve changed the path please try again.

hepto commented 5 years ago

Ok, give me an hour or so. Thanks for this - just started looking at this project but once I get familiar with it I'd be happy to help.

hepto commented 5 years ago

Bit further this time - EFI volume is now populated and the drive recognised by UEFI, but alas I now also get the black screen issue on boot. Have not troubleshot yet, probably needs a new issue.

Actually, the installer still failed as it could not unmount the EFI partition at the end of postinstall.sh as mds had hold of it (Spotlight). I was eager to try the USB so I ejected manually. Will try a couple more times to see if it is a persistent issue - probably the script should wait for the unmount to succeed.

osy commented 5 years ago

I think black screen should be bypassed by triggering opencore picker menu. See if you can find OS X installer as an entry.

hepto commented 5 years ago

How does one open the opencore picker menu?

osy commented 5 years ago

https://osy.gitbook.io/hac-mini-guide/post-installation/support#getting-into-boot-picker-menu

hepto commented 5 years ago

Ha! Sorry I should search. < slaps wrists >

Actually, I got it to come up by adding ShowPicker True to the OC plist.

So now installing! 👍🏻 Thanks

K-telj commented 5 years ago

Ive been encountering all the issues listed throughout this thread, and am stalled at getting anything to show up at f10 - boot menu, theres a OS X option but when I choose it repeatedly its goes back to menu, and this is with all sorts of alt key taps - hold - tap/holds. I am using the latest edited https://github.com/osy86/HaC-Mini/issues/63#issuecomment-537661798 version, it fails the install writing to the usb with the "Patch OSX installer" option, and succeeds with this option off. It never gets to the boot picker or install as of yet.

osy commented 5 years ago

The original issue described has been fixed in the latest installer. Anyone with additional problems should file a new ticket and fill in the requested information.