Jump to content

LiluFriend - Fixing Lilu does not function correctly under system locations


30 posts in this topic

Recommended Posts

Hello,

 

This is going to be a general discussion thread of LiluFriend on InsanelyMac Forum.

LiluFriend is an open-source kernel extension that fixes Lilu does not function correctly under system locations like /System/Library/Extensions or /Library/Extensions.

 

Note: LiluFriend needs configuring properly, otherwise it will fail to load. For more details, check here.

 

Everything including binaries, detailed instructions, is available on GitHub:

https://github.com/PMheart/LiluFriend

 

Also, it's better to report issues on GitHub. :)

  • Like 9

You like to clog system folders with third-party files?  :)

Hi. For now, yes. I haven't found a better solution yet.

Installing everything to /L/E uses Apple's native way, otherwise no. Clover's kext injection can be just for necessary and convenience. (installer/recovery)

Also, it's simply wrong to leave lots of kexts outside kernel cache (Using the current way to inject kexts). A kernel cache should be the right eventual place where all kexts should go into.

 

If you really want to place your 3rd-party kexts outside /L/E or /S/L/E, then you should inject code to kernel cache, instead of something Clover now does... It's somewhat complex and I don't tend to do so, and I just put everything inside /L/E, it works like a charm.

POC: https://pikeralpha.wordpress.com/2015/07/28/apples-kext-signing-bypassed/

  • Like 2
  • 3 weeks later...

Hello PM heart, this only works for Lilu. And I can also add the three Lilux kext that I use in E / C / (ApleAlc, Lilu and NvidiaGraphicsFixup.kext) in the lilufriend InfoPlist.

Thks.

Hello PM heart, this only works for Lilu. And I can also add the three Lilux kext that I use in E / C / (ApleAlc, Lilu and NvidiaGraphicsFixup.kext) in the lilufriend InfoPlist.

Thks.

Hi.

Yes, actually you may even need to add all Lilu related kexts' bundle id.

By the way, what does E / C mean? I assume that it refers to Clover's kext folder, if so, then LiluFriend is simply not required.

Yeah, I mean Efi / Clover / kext. What I want to do is put all kexts in S / L / E and try not to use the Clover folder. That's why the question.
Thank you for your response, your help is appreciated.

Yeah, I mean Efi / Clover / kext. What I want to do is put all kexts in S / L / E and try not to use the Clover folder. That's why the question.

Thank you for your response, your help is appreciated.

Nah, I saw what you wanted. Sorry for the misunderstanding before.

Well, I think the README of LiluFriend has already contained all you need, so please read it carefully, and, if you still have some unsolved questions, feel free to ask for any help. :)

  • Like 1

I have put all the kexts in S / L / E and all have been loaded except LiluFriend. This is normal or should be loaded.

 

Attached liluFriend edited.

What does the following command say?

sudo touch /System/Library/Extensions && sudo kextcache -u /
For some reason, it says LiluFriend depends on CoreDisplayFixup. If you install CoreDisplayFixup then it will load.
  • Like 1

I have put all the kexts in S / L / E and all have been loaded except LiluFriend. This is normal or should be loaded.

 

Attached liluFriend edited.

Hi, you must remove all kexts that you don't need for LiluFriend to work.

For some reason, it says LiluFriend depends on CoreDisplayFixup. If you install CoreDisplayFixup then it will load.

No, it's just an example. LiluFriend does not even depend on Lilu. Only the "com.apple.security" signature prefix tricks kernel to load it at an early stage, and then it indicates its plugins (Lilu and plugins) to be loaded at the same time. ;)

  • Like 1

Hi, you must remove all kexts that you don't need for LiluFriend to work.

 

No, it's just an example. LiluFriend does not even depend on Lilu. Only the "com.apple.security" signature prefix tricks kernel to load it at an early stage, and then it indicates its plugins (Lilu and plugins) to be loaded at the same time. ;)

I'm sorry, I didn't read the readme carefully enough. In other words, the LiluFriend's info.plist should be modified to include in OSBundleLibraries the OSBundleIdentifier and OSBundleCompatibleVersion of all the kexts that you want to load early with LiluFriend.

 

Here's a script to find all the installed Lilu plugins:

echo "# Add the following to OSBundleLibraries of $( find /System/Library/Extensions /Library/Extensions \( -type f -name Info.plist -path '*/LiluFriend.kext/*' \) )"
IFS=$'\n'
for thefile in $( find /System/Library/Extensions /Library/Extensions \( -type f -name Info.plist -not -path '*/Lilu.kext/*' -not -path '*/LiluFriend.kext/*' -print0 \) | xargs -0 grep -l '<key>as.vit9696.Lilu</key>' ); do
	plutil -convert json -r "${thefile}" -o /tmp/converted.plist
	sed -n -E '/^  "CFBundleIdentifier" : "(.*)",?/s//		<key>\1<\/key>/p' /tmp/converted.plist
	version="$(sed -n -E '/^  \"OSBundleCompatibleVersion\" : "(.*)",?/s//\1/p' /tmp/converted.plist)"
	if [[ -z "${version}" ]]; then
		version=$(sed -n -E '/^  "CFBundleVersion" : "(.*)",?/s//\1/p' /tmp/converted.plist)
	fi
	echo "		<string>${version}</string>"
done
The output looks like this:

# Add the following to OSBundleLibraries of /System/Library/Extensions/LiluFriend.kext/Contents/Info.plist
		<key>as.vit9696.AppleALC</key>
		<string>1.0</string>
		<key>org.vanilla.driver.CoreDisplayFixup</key>
		<string>1.0</string>
		<key>as.lvs1974.HibernationFixup</key>
		<string>1.0</string>
		<key>as.lvs1974.IntelGraphicsFixup</key>
		<string>1.0</string>
		<key>as.lvs1974.NvidiaGraphicsFixup</key>
		<string>1.0</string>
But maybe not all of them require to be loaded early? Does it matter for any of those or is only Lilu required to be loaded early? I wonder because you included the org.vanilla.driver.CoreDisplayFixup example in LiluFriend already.
  • Like 1

I'm sorry, I didn't read the readme carefully enough. In other words, the LiluFriend's info.plist should be modified to include in OSBundleLibraries the OSBundleIdentifier and OSBundleCompatibleVersion of all the kexts that you want to load early with LiluFriend.

 

Here's a script to find all the installed Lilu plugins:

echo "# Add the following to OSBundleLibraries of $( find /System/Library/Extensions /Library/Extensions \( -type f -name Info.plist -path '*/LiluFriend.kext/*' \) )"
IFS=$'\n'
for thefile in $( find /System/Library/Extensions /Library/Extensions \( -type f -name Info.plist -not -path '*/Lilu.kext/*' -not -path '*/LiluFriend.kext/*' -print0 \) | xargs -0 grep -l '<key>as.vit9696.Lilu</key>' ); do
	plutil -convert json -r "${thefile}" -o /tmp/converted.plist
	sed -n -E '/^  "CFBundleIdentifier" : "(.*)",?/s//		<key>\1<\/key>/p' /tmp/converted.plist
	version="$(sed -n -E '/^  \"OSBundleCompatibleVersion\" : "(.*)",?/s//\1/p' /tmp/converted.plist)"
	if [[ -z "${version}" ]]; then
		version=$(sed -n -E '/^  "CFBundleVersion" : "(.*)",?/s//\1/p' /tmp/converted.plist)
	fi
	echo "		<string>${version}</string>"
done
The output looks like this:

# Add the following to OSBundleLibraries of /System/Library/Extensions/LiluFriend.kext/Contents/Info.plist
		<key>as.vit9696.AppleALC</key>
		<string>1.0</string>
		<key>org.vanilla.driver.CoreDisplayFixup</key>
		<string>1.0</string>
		<key>as.lvs1974.HibernationFixup</key>
		<string>1.0</string>
		<key>as.lvs1974.IntelGraphicsFixup</key>
		<string>1.0</string>
		<key>as.lvs1974.NvidiaGraphicsFixup</key>
		<string>1.0</string>

Great script! Really appreciated.

 

But maybe not all of them require to be loaded early? Does it matter for any of those or is only Lilu required to be loaded early? I wonder because you included the org.vanilla.driver.CoreDisplayFixup example in LiluFriend already.

According to @vit9696, all plugins need loading early.

  • 9 months later...
5 hours ago, telepati said:

I am using my kexts on L/E on readme section you are saying add LiluFriend to L/E and S/L/E? Should I add LiLuFriend to S/L/E even I am not using my kexts there?

Hi,

No. Either of them is enough. (In my opinion you may create LiluFriend.kext/Contents/PlugIns folder and put Lilu + plugins there)

  • Thanks 1
  • 3 weeks later...
On 3/26/2018 at 2:22 AM, PMheart said:

Hi,

No. Either of them is enough. (In my opinion you may create LiluFriend.kext/Contents/PlugIns folder and put Lilu + plugins there)

Hi, finally I created my LiluFriend.kext. Could you please check my .kext did I right? Just like you said I create a Plugins folder and put all kexts and the Lilu there. But I am not sure did I set the setting right?

 

 

LiluFriend.kext.zip

Edited by telepati
9 hours ago, telepati said:

Hi, finally I created my LiluFriend.kext. Could you please check my .kext did I right? Just like you said I create a Plugins folder and put all kexts and the Lilu there. But I am not sure did I set the setting right?

 

 

LiluFriend.kext.zip

Hi, looks like you are!

  • 9 months later...

Good Evening @PMheart :)

 

Unfortunately I can't find any information about an issue I have so I though I should ask you here.

I wanna add a driver to LiluFriend but I don't understand how it should look like in the end.

 

Could you maybe help me in creating it ?

 

I attached the info.plist of the driver which I wanna insert to LiluFriend.

 

How the final LiluFriend kext would look like with this data ? 

 

 

Info.plist

12 minutes ago, DSM2 said:

Good Evening @PMheart :)

 

Unfortunately I can't find any information about an issue I have so I though I should ask you here. 

I wanna add a driver to LiluFriend but I don't understand how it should look like in the end. 

 

Could you maybe help me in creating it ?

 

I attached the info.plist of the driver which I wanna insert to LiluFriend. 

 

How the final LiluFriend kext would look like with this data ? 

 

 

Info.plist

Hi,

 

Does it have to be installed in /L/E or /S/L/E instead of Clover/kexts/ ? If not, then I'd highly recommend you installing it to Clover and use kext injection for higher priority.

 

Anyway, if you do need it, here you go:

	<key>OSBundleLibraries</key>
	<dict>
		<key>com.apple.kpi.bsd</key>
		<string>12.0.0</string>
		<key>com.apple.kpi.iokit</key>
		<string>12.0.0</string>
		<key>com.apple.kpi.libkern</key>
		<string>12.0.0</string>
		<key>com.apple.kpi.mach</key>
		<string>12.0.0</string>
		<key>com.apple.kpi.unsupported</key>
		<string>12.0.0</string>
		<key>net.egosys.driver.VRS8Audio</key>
		<string>1.03</string>
	</dict>

 

  • Like 1

Thanks! Will test it asap! :)

The kext has to be in L/E but I will also try via Kext Injection.

 

Unfortunatly doesn't fix my issue... hmm...

 

This is my problem: 

 

2019-02-03 00:33:29.252097+0100 0x38d0     Default     0x0                  0      0    kernel: (VRS8AudioDriver) AEsiAudioEngine[]::CreateAudioStream() failed to allocate IOBufferMemoryDescriptor

2019-02-03 00:33:29.252099+0100 0x38d0     Default     0x0                  0      0    kernel: (VRS8AudioDriver) AEsiAudioEngineIn[]::initHardware(), failed to create all streams.

2019-02-03 00:33:29.252100+0100 0x38d0     Default     0x0                  0      0    kernel: (VRS8AudioDriver) AEsiAudioEngineIn: failed to create analogInputStream!

2019-02-03 00:33:29.252103+0100 0x38d0     Default     0x0                  0      0    kernel: (IOAudioFamily) - IOAudioEngine[<private>]::start(<private>, <private>)

2019-02-03 00:33:29.252104+0100 0x38d0     Default     0x0                  0      0    kernel: (IOAudioFamily) - IOAudioEngine[<private>]::start(<private>) returns 0

2019-02-03 00:33:29.252108+0100 0x38d0     Default     0x0                  0      0    kernel: (IOAudioFamily) - IOAudioDevice[<private>]::activateAudioEngine(<private>, 1) returns 0x<private>

2019-02-03 00:33:29.252109+0100 0x38d0     Default     0x0                  0      0    kernel: (IOAudioFamily) + IOAudioEngine[<private>]::free()

2019-02-03 00:33:29.252124+0100 0x38d0     Default     0x0                  0      0    kernel: (IOAudioFamily) - IOAudioEngine[<private>]::free()

2019-02-03 00:33:29.252124+0100 0x38d0     Default     0x0                  0      0    kernel: (VRS8AudioDriver) AEsiAudioDevice[<private>]::initHardware: failed!

2019-02-03 00:33:29.256646+0100 0x38d0     Default     0x0                  0      0    kernel: (IOAudioFamily) - IOAudioDevice[<private>]::start(<private>)

 

Maybe you have an idea what I could try...

Edited by DSM2
  • Like 1
  • 3 months later...
7 hours ago, CoBrA2168 said:

@PMheart do you still recommend using your LiluFriend Kext with the latest versions of Lilu and its plugins with the latest Clover as of today?

Depends on how you install them, if you are still putting them into /L/E, why not...

OpenCore has a much decenter way for kext injection, by the way.

1 hour ago, PMheart said:

Depends on how you install them, if you are still putting them into /L/E, why not...

OpenCore has a much decenter way for kext injection, by the way.

Yes I had read about that project.  I think it's too new for me to switch over right now, but I think I will once it garners more support.

 

I put all of my kexts in /L/E (including Lilu) so I suppose I'll add this to ensure Lilu and the plugins are loaded appropriately.  Sometimes my AppleALC kext is loaded incorrectly, causing my audio to randomly not work on boot.  Usually a sleep cycle fixes it.  I think installing to Clover/Kexts (or installing LiluFriend) will fix that.

  • 1 year later...

I don't think this works in Big Sur. I can get Lilu and Whatevergreen to load but LiluFriend cannot be loaded. "kmutil -p" does not return any errors for LiluFriend.kext but it won't get added.

 

Edited by joevt
  • 2 weeks later...
On 7/29/2020 at 3:24 PM, joevt said:

I don't think this works in Big Sur. I can get Lilu and Whatevergreen to load but LiluFriend cannot be loaded. "kmutil -p" does not return any errors for LiluFriend.kext but it won't get added.

 

I guess LiluFriend is no longer needed with OpenCore… It is now considered as legacy.

×
×
  • Create New...