Compiling IOGraphicsFamily.kext from source…

I need to compile IOGraphicsFamily.kext from source code and I am looking for a script that makes life easier. It should download the latest source code, and other required sub-projects, and then compile it. Not that I am lazy, but can you help me out? I don’t like to re-invent the wheel 😉

15 thoughts on “Compiling IOGraphicsFamily.kext from source…

  1. You can modify this script to download & compile from latest tarball Pike


    #!/bin/bash
    # MTOC.NEW
    # @cecekpawon Fri Dec 16 22:21:10 2016
    # thrsh.net
    SRC=$HOME/Desktop/mtoc
    gCctoolsVer="949.0.1"
    uCctools="https://opensource.apple.com/tarballs/cctools/"
    dLLVM="LLVM"
    gLLVMRev="289949"
    dLLVMInc="include/llvm-c"
    uLLVM="https://llvm.org/svn/llvm-project/llvm/trunk/"
    gDisassembler="Disassembler.h"
    gMTOC="MTOC.NEW"
    #gTmp=$(curl -s $uCctools | xmllint –html –xpath '//tr[last()-1]/td/a' – 2>/dev/null | sed -nE 's/^.*\-([0-9]+)\.tar\.gz.*$/\1/p')
    gTmp=$(curl -s $uCctools | xmllint –html –xpath '//tr[4]/td/a' – 2>/dev/null | sed -nE 's/^.*\-([0-9.]+)\.tar\.gz.*$/\1/p')
    if [[ $gTmp =~ ^[0-9]+$ ]]; then
    gCctoolsVer=$gTmp
    fi
    echo gCctoolsVer: ${gCctoolsVer}
    gTmp=$(curl -s $uLLVM | xmllint –html –xpath '//title' – 2>/dev/null | tr -cd '0-9')
    if [[ $gTmp =~ ^[0-9]+$ ]]; then
    gLLVMRev=$gTmp
    fi
    echo gLLVMRev: ${gLLVMRev}
    fCctools="cctools-${gCctoolsVer}"
    gCctools="${fCctools}.tar.gz"
    mkdir -p "${SRC}" && cd "${SRC}"
    [[ ! -e $gCctools ]] && curl -O -L "${uCctools}${gCctools}"
    tar xvfz $gCctools
    mv "${fCctools}/${dLLVMInc}/${gDisassembler}" "${fCctools}"
    svn checkout -r $gLLVMRev "${uLLVM}${dLLVMInc}" "${dLLVM}"
    cp "${dLLVM}/"*.* "${fCctools}/${dLLVMInc}"
    cd "${fCctools}" && mv $gDisassembler $dLLVMInc && make
    cd "efitools" && make
    [[ -e $gMTOC ]] && mv $gMTOC "${SRC}"
    cd "${SRC}" && find . ! -name $gMTOC -mindepth 1 -maxdepth 1 -exec rm -rf "{}" \;
    echo "done: ${SRC}"

    view raw

    mtoc.new.sh

    hosted with ❤ by GitHub

  2. Hi Pike, is there a way to solve an nvme data corrupted issue on Dell XPS (Skylake) series? When sleep the laptop for just a while, the filesystem corrupted and we cannot boot macOS. We tried to use Disk Utility to fix the file system, but failed. It’s a very known issue on XPS (Skylake), could you please show some light on this issue?

    P.S. One of my friend with XPS 15 9550 has successfully snapped verbose photos after data corrupted:






    Again, thanks for the nvme patches you’ve invented, which make impossible into possible. Thank you!

    syscl

    • I don’t see a single debug message related to the IONVMe driver. How do you know that this is caused by the NVMe driver? What NVMe SSD module is installed? Has anyone installed the module in another PC, to see if it works there?

      • Hi Pike,

        Here’s some Dell XPS laptops that experienced data corrupted:
        1. XPS 15(9550) + Samsung PM951
        2. XPS 15(9550) + Toshiba XG3
        3. XPS 13(9350) + Toshiba XG3
        4. XPS 13(9350) + Sk Hynix

        5. And some are in https://www.tonymacx86.com/threads/guide-dell-xps-13-9350-macos-10-12-1.204730/page-8 and https://github.com/syscl/XPS9350-macOS/issues/26
        6. Some data corrupt examples were in tonymacx86 in XPS 15 9550 thread, but the author has sadly been banned

        We tried to find out what cause the problem by:
        1. We first disabled HWP then reinstall the macOS 10.12.2 with ssdtPRGen.sh – data corrupted someday
        2. We installed 10.11.6 and 10.12.2 to see if it’s related to latest system – data corrupted on both El Captain and Sierra

        We have no idea what’s wrong. But we summary all this data corrupted occurred after sleep:
        – Data lose on both short period or long period of sleep
        – But not every sleep causes data lose.
        – One of the signal that the partition of macOS corrupted is a lot of applications report crash, when we reboot, the worst thing happen, we can’t boot into the system anymore(verbose: MACH Reboot)
        – …

        @darkhandz(https://github.com/darkhandz/XPS15-9550-Sierra/commit/72f63339ff088dabe2bc9281b5f1a3dbe181ad31) is the one that successfully captured this log after data corrupted(because the reboot progress is too fast for us to capture something). And we can’t boot into the system to see the log anymore, which like macOS play with us.

        Tell me if you need any other information:) Thank you!

        syscl

      • Ok, but his first image is made during a boot, and then anything may have happened already.

        What I would do in this case is to write the log to: /var/log/system.log (or whatever path/filename you like) on another drive (with –debug and –info) with the patched IONVMeFamily.kext from a developer Beta version. The latter writes errors to the log. Stuff that I need to know about. But this should be done before it goes to sleep, and when it boots.

        Edit: Don’t use Disk Utility to fix errors. Try DiskWarrior. Worked for me when I needed it (during development of the patches).

  3. Hi Pike,

    Do you mean before sleep, use log command in terminal to log out the information?

    I will let people with XPS (Skylake model) to do what you suggest and give feed back you want. And, I will let use DiskWarrior instead.

    Thank you!
    syscl

    • Sorry. I wasn’t clear enough in my previous comments. What you want is a script that writes the log data to a file, just like there is one to write the NVRAM contents to a file.

      You can use: date "+%Y-%m-%d %H:%M:%S" to set a filename and use it for log argument –start

      Adding: -v -5M will show the log from the actual time, minus 5 minutes. That should be enough.

      • Hi, I’ve wrote a program to log the mac’s log(https://github.com/syscl/maclog), and inside the program, this program actually calls

        log show –predicate ‘process == “kernel” OR eventMessage CONTAINS “kernel”‘ –style syslog –source –info –start $(date “+%Y-%m-%d”)

        Is this command line OK?

        Thanks you!
        syscl

  4. Hi Pike, I have boot glitch on startup. I tried for IOGraphicsFamily kext to patch but it doesn’t help me? Last one Rehabman gives me and he said this is the correct one but I am still getting glitch. How should I correct one? I attached my ioreg and Clover Folder could you please help me with that?

    [img]http://i.imgur.com/dI0Y6gm.png[/img]
    [img]http://i.imgur.com/pc7FMss.png[/img]

    This is the last one I tired;

    Comment: Boot graphics glitch, 10.12.dp1 (credit denskop)
    Find:
    Replace:

    https://app.box.com/s/lyuaq5zr10wx3hpwhulvez2sdyz3mfnw

Leave a comment