06 January 2010

Resume from Sleep Without Verbose Mode

How my EFI /Extra folder looks after the successful experiment

If you installed using the HP Mini 311 Darwin Project installers, you'd notice that your default boot mode is verbose mode; i.e. white text flashing on your screen on a black background. Wherefore hath thou included a Themes folder in thy EFI/Extra/ partition if you weren't gonna be seeing it the entire boot time (which in my case is a nice 00:00:36.7 seconds)?

The reason for that, as documented at the thread, is that the 311 cannot resume properly from sleep if it doesn't boot in verbose. Looks like dynamics of power management and sleep problems we've got here.

Actually the 311 like most hackintoshes, I believe, is not able to use the vanilla AppleIntelCPUPowerManagement.kext. It kernel panics so we have to tell OS X not to use that kext via using Disabler.kext or NullCPUPowerManagement.kext (just choose between the two). However, it is that same kext (AppleIntelCPUPowerManagement.kext) that takes care of sleep/resume and all power related stuff in real Macs. And since hackintoshes are allergic to it, they utilize a different method in lieu of AICPUPM - in the 311 we have VoodooPowerMini +SleepEnabler + dsdt.

More specifically, via the HP Mini 311 Darwin Project, VoodooPowerMini is placed in /System/Library/Extensions, on grounds that the kext is unable to load when placed in EFI/Extra/Extensions where the rest of the kexts are hence it's labeled as "tainted". Another kext, the ApplePS2Controller used to drive the (nasty) Alps GlidePoint trackpad, is reported to behave similarly; it's also "tainted".

Now I, amazed by the ease of EFI configuration brought about by the project installer, wanted to see the marvelous handiwork and decided to take a peep inside the EFI partition. This is what I found:
No kextcache (Extensions.mkext) in /Extra. This I found weird since I've always had Extensions.mkext /Extra. So I decided to do a little experiment.

Question: Would having VoodooPowerMini and ApplePS2Controller included in the kextcache inside EFI make a difference in how these two kexts are loaded by Chameleon during boot up?

(1) I moved ApplePS2Controller and VoodooPowerMini from /System/Library/Extensions
(2) Repaired systems permissions using Onyx. (This could also be done via Disk Utility which is in Applications > Utilities, it's just that my personal fave is Onyx).
(3) Put ApplePS2Controller.kext and VoodooPowerMini.kext in EFI/Extra/Extensions and did a kextcache for the system. I did this using UpdateEFI made by Dalton from the insanelywind forums. (If you don't have an account in insanelywind, you can use this link to get UpdateEFI but I strongly recommend subscribing to that forum). This app integrates in a user-friendly GUI the famous script for updating EFI kexts and which also creates Extensions.mkext cache from the old Vanilla EFI method started by a hackintosher named munkey (I believe).
(4) Took out the "-v" entry in the string for Kernel Flag key in my boot.plist inside EFI/Extra and restarted.

Result: Yes, it does. Having an Extensions.mkext that cached VoodooPowerMini and ApplePS2Controller means they are loaded even when they reside in Extra/Extensions inside EFI. My HP Mini 311 resumes fine from sleep without verbose mode.

Notes on using UpdateEFI:
- When you launch the app, you have two (2) options: (1) Basic Changes and (2) OS Update.
- Basic Changes makes EFI partition readily accessible so you can edit its contents (drag & drop, delete) and also rebuilds an Extensions.mkext which it puts in EFI /Extra/ folder.
- OS Update will do the same BUT it'll patch video graphics card kexts in the /Extra/Extensions folder. (It will look for 27aeAppleIntelGMA950 and 27aeAppleIntelIntegratedFramebuffer kexts, which are NOT used in the 311 because it's on Ion not GMA950 and so this option is irrelevant for the 311).
- When you choose an option, the app will ask for you to authenticate (ask you to input your password) and it will mount the EFI partition so you can access it. While it is mounted, aside from adding or removing kexts, you can also do changes in other EFI elements like the com.apple.Boot.plist, smbios.plist, dsdt.aml, themes.

No comments: