Contribute
Register

[Guide] Lenovo u310/u410 Yosemite using Clover

Status
Not open for further replies.
Try previous version of ACPIBacklight.kext.

My methodology was as follows (please correct if incorrect - never uninstalled a kext before):
- Deleted 2015/07/15 ACPIBacklight.kext from systems/library/extensions
- Rebuilt kernel cache via kext wizard
- Installed 2014/10/16 ACPIBacklight.kext
- rebuilt kernel cache
- rebooted

Works with brightness control as per this guide.

As always, thank you very much Rehabman.
 
My methodology was as follows (please correct if incorrect - never uninstalled a kext before):
- Deleted 2015/07/15 ACPIBacklight.kext from systems/library/extensions
- Rebuilt kernel cache via kext wizard
- Installed 2014/10/16 ACPIBacklight.kext
- rebuilt kernel cache
- rebooted

Works with brightness control as per this guide.

As always, thank you very much Rehabman.

Since you can reproduce this problem... please test new version, attached.

diffs:
Code:
Speedy-OSX:backlight.git RehabMan$ git diff
diff --git a/ACPIBacklight/ACPIBacklight.cpp b/ACPIBacklight/ACPIBacklight.cpp
index beca3a6..3896344 100644
--- a/ACPIBacklight/ACPIBacklight.cpp
+++ b/ACPIBacklight/ACPIBacklight.cpp
@@ -280,11 +280,16 @@ void ACPIBacklightPanel::free()
     super::free();
 }
 
-void ACPIBacklightPanel::setBacklightHandler(BacklightHandler *handler, BacklightHandlerParams* params)
+bool ACPIBacklightPanel::setBacklightHandler(BacklightHandler *handler, BacklightHandlerParams* params)
 {
+    if (!(_options & kWaitForHandler))
+        return false;
+
     _backlightHandler = handler;
     if (params)
         *params = _handlerParams;
+
+    return true;
 }
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -1339,7 +1344,12 @@ bool IntelBacklightHandler::start(IOService *provider)
     _fbtype = num->unsigned32BitValue();
 
     // now register with ACPIBacklight
-    panel->setBacklightHandler(this, &_params);
+    if (!panel->setBacklightHandler(this, &_params))
+    {
+        // setBacklightHandler will return false for old PNLF patches
+        _baseMap->release();
+        return false;
+    }
     _panel = panel;
     panel->retain();
 
diff --git a/ACPIBacklight/ACPIBacklight.h b/ACPIBacklight/ACPIBacklight.h
index 89e8541..ca0d647 100644
--- a/ACPIBacklight/ACPIBacklight.h
+++ b/ACPIBacklight/ACPIBacklight.h
@@ -100,7 +100,7 @@ public:
     virtual bool doUpdate( void );
 
     // ACPIBacklightPanel
-    virtual void setBacklightHandler(BacklightHandler* handler, BacklightHandlerParams* params);
+    virtual bool setBacklightHandler(BacklightHandler* handler, BacklightHandlerParams* params);
     
 private:
     BacklightHandler* _backlightHandler;
 

Attachments

  • RehabMan-Backlight-2015-0813.zip
    34.1 KB · Views: 86
Since you can reproduce this problem... please test new version, attached.

diffs:
Code:
Speedy-OSX:backlight.git RehabMan$ git diff
diff --git a/ACPIBacklight/ACPIBacklight.cpp b/ACPIBacklight/ACPIBacklight.cpp
index beca3a6..3896344 100644
--- a/ACPIBacklight/ACPIBacklight.cpp
+++ b/ACPIBacklight/ACPIBacklight.cpp
@@ -280,11 +280,16 @@ void ACPIBacklightPanel::free()
     super::free();
 }
 
-void ACPIBacklightPanel::setBacklightHandler(BacklightHandler *handler, BacklightHandlerParams* params)
+bool ACPIBacklightPanel::setBacklightHandler(BacklightHandler *handler, BacklightHandlerParams* params)
 {
+    if (!(_options & kWaitForHandler))
+        return false;
+
     _backlightHandler = handler;
     if (params)
         *params = _handlerParams;
+
+    return true;
 }
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -1339,7 +1344,12 @@ bool IntelBacklightHandler::start(IOService *provider)
     _fbtype = num->unsigned32BitValue();
 
     // now register with ACPIBacklight
-    panel->setBacklightHandler(this, &_params);
+    if (!panel->setBacklightHandler(this, &_params))
+    {
+        // setBacklightHandler will return false for old PNLF patches
+        _baseMap->release();
+        return false;
+    }
     _panel = panel;
     panel->retain();
 
diff --git a/ACPIBacklight/ACPIBacklight.h b/ACPIBacklight/ACPIBacklight.h
index 89e8541..ca0d647 100644
--- a/ACPIBacklight/ACPIBacklight.h
+++ b/ACPIBacklight/ACPIBacklight.h
@@ -100,7 +100,7 @@ public:
     virtual bool doUpdate( void );
 
     // ACPIBacklightPanel
-    virtual void setBacklightHandler(BacklightHandler* handler, BacklightHandlerParams* params);
+    virtual bool setBacklightHandler(BacklightHandler* handler, BacklightHandlerParams* params);
     
 private:
     BacklightHandler* _backlightHandler;

Uninstalled the 2014 version using same method as above post and installed this new version of the kext. Rebooted and brightness control works as per above post.

I don't know what the "diffs" thing is, so I didn't do anything with that.

Later today I plan to do a full reinstall. I will use this new version of the kext in conjunction with this guide (ie. do the DSDT patch and install the kext at the same time, rather than different 'reboots'). If it does not work during this second reinstall I will let you know, otherwise assume it works perfectly.



UNRELATED: During all this I discovered that my wifi no longer works (I have removed the original card and installed an AR5BHB92 / AR9280).

On originally installing the card, it was working natively even before installing OSX; I was able to connect to wireless networks whilst clicking through the install process on the USB. Once OS X was installed, the card still worked perfectly.

Just now, although the wifi card is detected by OS X, it cannot detect any wireless networks. It is forever 'searching for wireless networks'. Windows also detects the card but cannot find any networks.

I fear that my motherboard antenna has 'broken', although I find this implausible given that it is unlikely to have just randomly 'broken' when I picked the laptop up or something.
 
Uninstalled the 2014 version using same method as above post and installed this new version of the kext. Rebooted and brightness control works as per above post.

Great. Thanks for the test. The fix will be in the next build.

I don't know what the "diffs" thing is, so I didn't do anything with that.

Just me documenting the changes in the code for the fix.

UNRELATED: During all this I discovered that my wifi no longer works (I have removed the original card and installed an AR5BHB92 / AR9280).

AR9280 is supported natively.

Perhaps you have the radio turned off. Some laptops have dedicated keys/buttons for that. Macs do not, so the drivers are unaware of it.
 
Perhaps you have the radio turned off. Some laptops have dedicated keys/buttons for that. Macs do not, so the drivers are unaware of it.

If this is the same problem I had, it's a bugger to fix. Do you also have Windows of some flavor installed? Since there is no hardware switch, you have to turn the radio on with software. But the only tool I found that could successfully do this was an old version of wifi management from Lenovo for Windows 7. Nothing in OS X or Linux can tell the card to be turned on. What turned it off in the first place I have no idea. Once I turned it on in Windows it stayed on.

If you have Windows let me know, and I can track down the application when I get home.
 
If this is the same problem I had, it's a bugger to fix. Do you also have Windows of some flavor installed? Since there is no hardware switch, you have to turn the radio on with software. But the only tool I found that could successfully do this was an old version of wifi management from Lenovo for Windows 7. Nothing in OS X or Linux can tell the card to be turned on. What turned it off in the first place I have no idea. Once I turned it on in Windows it stayed on.

If you have Windows let me know, and I can track down the application when I get home.

Taping pin 20 might be a reliable method too.
 
1. Wifi Issue

Perhaps you have the radio turned off. Some laptops have dedicated keys/buttons for that. Macs do not, so the drivers are unaware of it.

If this is the same problem I had, it's a bugger to fix. Do you also have Windows of some flavor installed? Since there is no hardware switch, you have to turn the radio on with software. But the only tool I found that could successfully do this was an old version of wifi management from Lenovo for Windows 7. Nothing in OS X or Linux can tell the card to be turned on. What turned it off in the first place I have no idea. Once I turned it on in Windows it stayed on.

If you have Windows let me know, and I can track down the application when I get home.

All signs point to the radio being turned off (eg. greyed out 'Turn wifi on' button in 'Windows Mobility Centre'). I think the trigger was me plugging in an ethernet connection whilst already being on wifi, but don't know why that would turn the radio off. It's comforting that you (Lazarus) have faced this issue as my repeated bashing of Fn+F5/F7 was not proving fruitful and I was fearing for my mobo antenna. Fortunately I am dual booting OS X and Windows 7, so if you could let me know the name of the program it would be appreciated.


EDIT: Problem solved. Brilliant! Downloaded 'Lenovo Energy Management' for Windows 7. Once installed, Fn+F7 will bring up an option to turn the radio back on.

Thank you, that's a relief. EDIT END

Taping pin 20 might be a reliable method too.

If the above does not work I will look into this, but I hope to avoid opening the case up again if possible. [I had to use a drill to break out the screw that I had caused to be stripped/threadless (as a result of my poking it with a screwdriver) to remove the original card and then stick down the A9280 with insulating tape - it's a mess in there].


2. ACPIBacklight.kext

Note: Pushed a new build to bitbucket...

As previously hinted, I have since reinstalled OS X (Trying to perfect the technique). I tried each ACPIBacklight.kext to see if the results experienced earlier were replicated. The results were indeed the same:-
2014/10/16 - Boots to desktop. Brightness control as per this guide.
2015/07/15 - Illuminated black screen midway through booting. Does not reach desktop.
2015/08/13 - Boots to desktop. Brightness control as per this guide.


3. Fixing sound with DummyHDA.kext

Lazarus, you give a very detailed explanation of how to create the DummyHDA.kext as part of fixing sound for the Lenovo u310/u410. Excerpt:

Sound
Download but don’t install AppleHDA.kext from http://www.tonymacx86.com/yosemite-...novo-u410-u310-yosemite-guide.html#post906637 Attached to this post you're reading as well.

Download DummyHDA.kext from here: Also attached to this post.

Go to the patched AppleHDA that you downloaded earlier but didn’t install. Unzip it, and right click on AppleHDA.kext and choose Show Package Contents. Navigate to AppleHDA.kext/Contents/Resources/ and copy Layout12.xml.zlib, and Platforms.xml.zlib. Now unzip DummyHDA.kext and navigate to DummyHDA.kext/Contents/Resources/ and paste them in there.

Next you need to edit the info.plist in DummyHDA.kext. Open info.plist in the patched AppleHDA.kext with TextEdit. It’s at: AppleHDA.kext/Contents/Plugins/AppleHDAHardwareConfigDriver.kext/Contents/info.plist. Search for <key>HDA Hardware Config Resource</key> . Then copy everything from there down through the next </array> (should stop right before <key>IOClass</key>). Now open config.plist in DummyHDA.kext/Contents/Info.plist in TextEdit. Again search for <key>HDA Hardware Config Resource</key>, highlight the corresponding section to what you just copied and delete it, then replace with what you copied. Save.

Install DummyHDA.kext to S/L/E with kext wizard. Rebuild/Repair permissions. Restart. That should get you an upgrade-proof working sound.

I was wondering, would it not be worthwhile to upload the already modified DummyHDA.kext, as created here? From these instructions, it seems that everyone that follows your guide will be using the same DummyHDA.kext, so someone may benefit from the modified DummyHDA.kext perhaps being offered as a download as part of this thread? However, this may just lead to confusion with many versions of DummyHDA.kext flying around.

If this is indeed useful, I attach my (which should be the same as yours), modified DummyHDA.kext.



4. Finally, what purpose does patchmatic serve in this guide? Do I need to place it in /usr/bin or something before beginning with the DSDT patching?



Thanks
 

Attachments

  • DummyHDA.kext.zip
    11 KB · Views: 101
Status
Not open for further replies.
Back
Top