Contribute
Register

[Guide] Lenovo Z50-70/Z40-70/G50-70/G40-70 using Clover UEFI

Sure, as long as you show credit to original source.
Hello RehabMan,
So I've been writing my own script to create a Lilu Friend kext. However, I cannot understand how your script is setting
'OSBundleLibraries:as.vit9696.Lilu' to 1.2.0 since different Lilu plugins require different versions. Can you please explain?
 
Hello RehabMan,
So I've been writing my own script to create a Lilu Friend kext. However, I cannot understand how your script is setting
'OSBundleLibraries:as.vit9696.Lilu' to 1.2.0 since different Lilu plugins require different versions. Can you please explain?

Only the OSBundleCompatibleVersion from Lilu.kext Info.plist matters for the as.vit9696.Lilu entry.
The script uses OSBundleCompatibleVersion if it exists, otherwise CFBundleVersion.
It is the logic here:
Code:
function add_dependency
# $1 kext path with Lilu dependency
# $2 LiluFriend kext path
{
    local plist="$1"/Contents/Info.plist
    local version=$(get_plist_property "$plist" ":OSBundleCompatibleVersion")
    if [[ "$version" == "__property_not_found__" ]]; then
        version=$(get_plist_property "$plist" ":CFBundleVersion")
    fi
    if [[ "$version" != "__property_not_found__" ]]; then
        local bundleid=$(get_plist_property "$plist" ":CFBundleIdentifier")
        if [[ "$bundleid" != "__property_not_found__" ]]; then
            echo " $kext: $bundleid $version"
            set_plist_string_property "$2/Contents/Info.plist" ":OSBundleLibraries:$bundleid" "$version"
        fi
    fi
}
 
Only the OSBundleCompatibleVersion from Lilu.kext Info.plist matters for the as.vit9696.Lilu entry.
The script uses OSBundleCompatibleVersion if it exists, otherwise CFBundleVersion.
It is the logic here:
Code:
function add_dependency
# $1 kext path with Lilu dependency
# $2 LiluFriend kext path
{
    local plist="$1"/Contents/Info.plist
    local version=$(get_plist_property "$plist" ":OSBundleCompatibleVersion")
    if [[ "$version" == "__property_not_found__" ]]; then
        version=$(get_plist_property "$plist" ":CFBundleVersion")
    fi
    if [[ "$version" != "__property_not_found__" ]]; then
        local bundleid=$(get_plist_property "$plist" ":CFBundleIdentifier")
        if [[ "$bundleid" != "__property_not_found__" ]]; then
            echo " $kext: $bundleid $version"
            set_plist_string_property "$2/Contents/Info.plist" ":OSBundleLibraries:$bundleid" "$version"
        fi
    fi
}
I added new _lilu_helper.sh, create_lilu_helper.sh to my macos-tools repo. Please take a look and tell me what you think.
 
I added new _lilu_helper.sh, create_lilu_helper.sh to my macos-tools repo. Please take a look and tell me what you think.

Looks ok, but your script won't work if you're on 10.10.x and older as the Lilu kexts will not be found in /L/E, since they are installed to /S/L/E instead.

And for utility subroutine .sh files, you should probably avoid using short function names like 'add' (better would be plistAdd, or plist_add_entry).
 
Looks ok, but your script won't work if you're on 10.10.x and older as the Lilu kexts will not be found in /L/E, since they are installed to /S/L/E instead.
Yeah I know, but my whole repo expects 10.11 and higher.
 
Some of my guides can still be used for old as 10.9, so I deal with it by checking the version that is running.
I added option to manually specify kexts directory for those still running 10.10 and older.
 
I added option to manually specify kexts directory for those still running 10.10 and older.

BTW, I was thinking of doing a _plist_subs.sh as you did, and then use it in the various places that use plistbuddy. But some of those places are not even used anymore (_hda_subs.sh) due to the transition to AppleALC, and I'm reluctant to "cleanup" code that works now, but is not being used, and might not get tested well after a "cleanup".
 
BTW, I was thinking of doing a _plist_subs.sh as you did, and then use it in the various places that use plistbuddy. But some of those places are not even used anymore (_hda_subs.sh) due to the transition to AppleALC, and I'm reluctant to "cleanup" code that works now, but is not being used, and might not get tested well after a "cleanup".
You're right. It might not be worth it in your case. I also plan to transition to AppleALC soon.

However, in my repo, _plist_utils.sh is used in _installed.sh to log all the installed kexts to a plist file at ~/Library/the-braveknight. It's not a big deal but I like to keep my code as clean and as reusable as possible.
 
So I tried the new repo, but the command which should get the patches couldn’t finish and after restarting the macOS couldn’t boot up. I had backup so I loaded High Sierra for now. Although I would like to know what’s wrong. There is the error I got after typing in that command which is also in 1st post-install post. Do you know what did I do wrong? @RehabMan
 

Attachments

  • 8C16CE30-12D6-4683-827F-A74120EE0910.jpeg
    8C16CE30-12D6-4683-827F-A74120EE0910.jpeg
    248.2 KB · Views: 96
Last edited:
Back
Top