Jump to content
1 post in this topic

Recommended Posts

I recently undertook the steps described in this guide, the steps are included in the quote box:

 

http://www.digitmemo.com/articles/734/howt...-in-hackintosh/

 

 

in an attempt to install the EFI patch.

 

Because the guide will place the vanilla kernel in OSX before the EFI patch is installed, some users have experienced that OSX will keep rebooting itself(osx reboots shortly after Darwain appears),as said in some of the comments.

 

I have also encountered this problem,so I undertook the steps as shown below from the terminal on my Toh OSX installation disk:

 

cd /iamefi

./startupfiletool /dev/rdiskXsY ./boot_v5

 

At first it seemed to work as it said "HFS+ partition detected, write xxx bytes"

 

After this, I also rebooted only to find my osx will keep rebooting itself. I went back into the terminal in my Toh OSX installation disk in an attempt to remove it and I ran the command. To my knowledge,booti386 was the old kernel:

./startupfiletool /dev/rdiskXsX ./booti386 

 

Again, it said "HFS+ partition detected, write xxx bytes" so I assumed it worked.

 

After I rebooted from Toh instllation disk, my OSX will keep rebooting itself (same as before).

 

So what possibly went wrong? How could I replace the original kernel?

 

Is my osx beyond rescue?

 

 

 

 

Prepare the Installation

 

Actual installation is really fast and easy, but before that, lets get all the necessary files in place.

 

1. Get the EFI patch

 

Download pc_efi_v51.zip. This is a repack of the original EFI patch and two necessary kext: AppleSMBIOS and dsmos.

 

2. Get the original kernel and modules

 

Here is the original kernel and some original kexts, please note that they are for Leopard 10.5.0 only(Download Leopard_Vanilla_Kernel_Kexts.zip). Tiger users may use Pacifist to extract them from System/Installation/Pacages/BaseSystem.pkg in original DVD.

 

3. Place the EFI patch:

 

Extract pc_efi_v51.zip to your desktop, let's say, a folder named pc_efi_v51 and launch Terminal.app from Application->Utilities in Finder, then type:

 

sudo mkdir /iamefi sudo cp /Users/xxx/Desktop/pc_efi_v51/* /iamefi/ when promoted, input your password, and don't forget to replace xxx with your user name.

 

This will copy all the necessary files for EFI patch in /iamefi directory.

 

4. Restore vanilla kernel:

 

For Leopard, there are currently two popular releases, namely BrazilMac and ToH. They all should work with the EFI patch. Anyway, let try to use the vanilla kernel first:

 

Extract Leopard_Vanilla_Kernel_Kexts.zip on Desktop and again, do this in the terminal:

 

sudo mv /mach_kernel /mach_kernel.patched After back up the patched kernel(comes with your installation), type

 

sudo cp /Users/xxx/Desktop/Leopard_Vanilla_Kernel_Kexts/mach_kernel / to install the new kernel. Don't forget to repair permissions:

 

sudo chmod 644 /mach_kernel && sudo chown root:wheel /mach_kernel sudo chmod 644 /mach_kernel.patched && sudo chown root:wheel /mach_kernel.patched Optional but highly recommend: Get the latest ToH kernel as well, as it works with or without EFI. Download and place it in root directory,

 

sudo cp /Users/xxx/Desktop/mach_sleep/mach_sleep /mach_kernel.toh sudo chmod 644 /mach_kernel.toh && sudo chown 0:0 /mach_kernel.toh 5. Add necessary kexts:

 

Speak of necessary, I mean the minimal requirement to boot off the EFI+vanilla kernel. Some installation might miss dsmos.kext(an EFI module for page decryption, also made by Netkas), as its not necessary for patched kernel. But it's a must for vanilla kernel. The dsmos.kext is included in pc_efi_v51.zip. So install it if its not in your system:

 

sudo cp -R /Users/xxx/Desktop/pc_efi_v51/dsmos.kext /System/Library/Extensions/ repair permissions:

 

sudo chmod -R 755 /System/Library/Extensions/dsmos.kext sudo chown -R root:wheel /System/Library/Extensions/dsmos.kext Optional: the newest efi patch is supposed to work with AppleEFIRuntime.kext but some users still have trouble there. So just remove(back it up) for safety. Do the same for AppleIntelCPUManagement.kext

 

cd /System/Library/Extensions/ sudo mv AppleEFIRuntime.kext AppleEFIRuntime.kext.vanilla sudo mv AppleIntelCPUPowerManagement.kext AppleIntelCPUPowerManagement.kext.vanilla Delete kext cache so the change will take effect on next boot.

 

sudo rm /System/Library/Extensions.mkext.* you might want to put more vanilla kexts back but let's install EFI patch and get it working first.

 

6. Find your disk id

 

You'll need this shortly, type

 

diskutil list and check the output. Write down the disk id matching your installation, its in the format of diskXsY and can be easily identified by volume name.

 

Install EFI Patch

 

 

 

There are two approach for EFI installation, the "old good" startuptool and grub(since v4 and later come with multiboot support)

 

1. Use startuptool

 

By using startuptool, we alternative the boot loader comes with OS X to the EFI patched one. It's easy and most time, should be safe.

 

Reboot the OS X and press F8 during boot up which will take you to the Darwin loader option, select the destination OS X partition, type

 

 

 

kernel.patched -s and press enter to boot into single user mode using the old patched kernel. Type the following commands right after system loads, don't run "mount -uw /" as it will mount the target partition on read-write mode and startupfiletools will fail. Just proceed to the EFI installation straight:

 

cd /iamefi There are several files you can choose from, booti386, boot_v3, boot_v4(and boot_v5), booti386 is original Darwin loader and can be used to reverse the installation. The rest are various versions of efi loaders. Just use the latest here:

 

./startupfiletool /dev/rdiskXsY ./boot_v5 replace rdiskXsY with disk id you get in previous step. For example, you get disk0s2, so put rdisk0s2 here, don't forget the leading r

 

You'll get prompt like "HFS+ partition detected, write xxx bytes", which means that the EFI loader is successfully installed(hopefully). Now type reboot and enjoy the new EFI.

 

2. Use grub

 

By during this, the OS X installation keeps untouched and the EFI patch process is done before the actual Darwin loader. This is what "multiboot" for.

 

If you have grub setup already, just copy boot_v5 to any place on fat32/reiserfs/xfs/ext2/ext3/ntfs/any partition supported by grub. To make life easier, just put it in the root directory. And add entry to your menu.lst like this one

 

title Darwin

 

kernel (hd0,0)/boot_v5

 

where hd0,0 is a partition where your boot_v5 resides(not the OSX partition!)

 

after that, load grub and will choose Darwin and press enter - you have 5 secs to choose the hard drive with OS X , 80 - first, 81 - second, 82 - third and etc , if you will not press any key during 5 sec, it will start working with default drive.

 

For those Windows-only user, you can use grub4dos to load the boot_v5. Download this grldr.zip, extract, put it to your C:\(yes, do this in Windows). Then add an entry for this grldr in your XP or Vista loader. Please refer to my previous installation guide, the last part about install tboot. Use exactly the same way to install this grldr, then create a file name menu.lst with following content:

 

find –set-root /bootmgr

 

timeout 10

 

default 0

 

title Leopard

 

kernel (hd0,0)/boot_v5

 

If you don't have Vista installed, change the first line to "find –set-root /ntldr" instead.

 

Trouble Shooting

 

The EFI patch is still in early stage so it's a big YMMV. The most common error is, EFI and vanilla kernel don't work together.

 

1. Restore old patched kernel

 

Again, press F8 when Darwin loads, and type the kernel name in option line, in our case, is "mach_kernel.patched"(without quotes). And you might want to further locate the issue, so type

 

mach_kernel.patched -v If you have ToH kernel backup, use it instead

 

mach_kernel.toh -v This will boot OS X with patched kernel and in verbose mode. After that, remove the vanilla kernel and restore the old one.

 

sudo mv /mach_kernel /mach_kernel.vanilla && sudo mv /mach_kernel.patched /mach_kernel repair permissions:

 

sudo chmod 644 /mach_kernel && sudo chown root:wheel /mach_kernel sudo chmod 644 /mach_kernel.vanilla && sudo chown root:wheel /mach_kernel.vanilla 2. Verify if EFI actually works

 

If the system boot up with vanilla kernel, you're quite confident that EFI is working and the system is running the SAME kernel as those genuine MACs. As said before, EFI patch also works with some patched kernels. So to be sure, just download Geekbench and if EFI works, it will detect the system as "Mac" instead of "Hackintosh".

 

3. Vanilla kext "compatibility"

 

If your hardware supports, the current EFI patch does work with vanilla kernel and all vanilla kexts, but there is still something worth mention:

 

  1. Don't forget to put dsmos.kext if you use vanilla kernel. In fact, it's never hurt to just leave it there even you're about to use patched ones. Also, you still need Natit/NVinject for your video card and ALCinject for sound card etc. since EFI patch wouldn't take care of them.
  2. You can't expect a system with all vanilla, unmodified kexts, as we always need to edit some(Info.plist) and add device id, which is safe and wouldn't affect system stability or anything. So get to know the kext before you restore it.
  3. Power management(reboot/shutdown/sleep) is YMMV. For most users, three items matters: the kernel, AppleACPIPlatform.kext and AppleSMBIOS.kext.I highly suggest to use the AppleSMBIOS.kext comes with the efi patch(in pc_efi_v51.zip) as it fix the error/crash on "About This Mac" and system profile. And for the rest two, you may need to try and find the working combination(patched vs. vanilla).
    Also, depends on the video cards, NVidia and GMA950 users are reported to have better luck here.
  4. Using vanilla AppleACPIPlatform.kext will lost all PS2 ports but if you're on an all USB setup, that's fine.
  5. Optional: A new IONetworkingFamily.kext fix is also available which enables the time machine as well as address the infamous "_CFGetHostUUIDString: unable to determine UUID for host. Error: 35″ bug. This is Leopard only and you can get it here.

Remove the EFI Patch

 

If you don't like it, just boot into single user mode(-s) and restore the vanilla boot loader and/or the old (patched) kernel. Refer to the previous installation/trouble shooting part for more info.

 

./startupfiletool /dev/rdiskXsY ./booti386

Link to comment
https://www.insanelymac.com/forum/topic/166804-botched-efi-patchpatching/
Share on other sites

×
×
  • Create New...