You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

编译LineageOS15.1时提示INSTALLED_KERNEL_HEADERS缺失求助

Fixing "INSTALLED_KERNEL_HEADERS missing" When Building LineageOS 15.1

Hey there, I’ve seen this exact issue pop up when working on older LineageOS builds, and since reinstalling your host Ubuntu kernel headers didn’t help, the problem is almost certainly tied to your device’s kernel setup rather than your system’s headers. Let’s walk through the fixes that usually resolve this:

  • First, manually install device-specific kernel headers
    The build system might not be correctly pulling headers from your device’s kernel tree. Navigate to your kernel source directory and run this command, replacing <your-rom-out-path> with the actual path to your LineageOS output directory (looks like out/target/product/<your-device>):

    make headers_install INSTALL_HDR_PATH=<your-rom-out-path>/usr
    

    This forces the kernel headers to be placed exactly where the ROM build expects them.

  • Verify your BoardConfig.mk settings
    Head to your device’s tree directory (usually device/<vendor>/<device>) and open BoardConfig.mk:

    • Check if there’s a line defining TARGET_KERNEL_HEADERS. It should point to the include directory in your kernel source, like:
      TARGET_KERNEL_HEADERS := kernel/<vendor>/<device>/include
      
      If this line is missing or incorrect, add or fix it.
    • Also confirm TARGET_KERNEL_SOURCE is correctly set to your kernel’s directory path—this ensures the build system knows where to find the kernel source in the first place.
  • Clean stale build artifacts and restart
    Old cached files can cause weird header detection issues. Run these commands to wipe the build cache and reinitialize the environment:

    make clean
    source build/envsetup.sh
    breakfast <your-device-codename>
    

    Then try compiling again with brunch <your-device-codename>.

  • Compile the kernel first
    Sometimes the error happens because the kernel hasn’t finished compiling (so headers aren’t generated yet). Try building the kernel alone first:

    make bootimage
    

    Once that completes successfully, proceed with the full ROM build.

These steps should get past the INSTALLED_KERNEL_HEADERS missing error. Let me know if you hit any snags along the way!

内容的提问来源于stack exchange,提问作者Oveno

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:04:12