Site icon Home

Configuring the Linux Kernel from MacOS

I use a beefy build server to do my Linux Kernel compiles. I use github workflows to do the compile in an unattended fashion. I don’t want to SSH into the server to run make menuconfig. What do I do?

I use a Macbook as my daily driver. It would be nice if I could generate the .config file on my laptop. But,.. there’s no way that would work, right? Right?

Turns out, it does. You just need to do the bare minimum hackery. It took me 2 minutes to figure out and do. Here it is:

  1. First, you’ll probably run into this error:
    ld: unknown option: --version
    ld: unknown linker
    scripts/Kconfig.include:56: Sorry, this linker is not supported.
    make[2]: *** [menuconfig] Error 1
    make[1]: *** [menuconfig] Error 2
    make: *** [__sub-make] Error 2
    Just remove the offending line (56) from scripts/Kconfig.include
    In this case, remove this:
    $(error-if,$(success,test -z "$(ld-info)"),Sorry$(comma) this linker is not supported.)
  2. Next, you’ll probably run into:
    init/Kconfig:53: syntax error
    init/Kconfig:52: invalid statement
    init/Kconfig:53: invalid statement
    init/Kconfig:61: syntax error
    init/Kconfig:60: invalid statement
    init/Kconfig:61: invalid statement
    make[2]: *** [menuconfig] Error 1
    make[1]: *** [menuconfig] Error 2
    make: *** [__sub-make] Error 2
    Just remove those lines also. In this case, remove these:
    default $(ld-version) if LD_IS_BFD
    default 0
  3. Now run make menuconfig and amazingly, it’ll work.

Exit mobile version