V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
liyongjun0803
V2EX  ›  问与答

buildroot 如何重新编译 kernel

  •  
  •   liyongjun0803 · 2021-07-30 23:16:37 +08:00 · 1064 次点击
    这是一个创建于 972 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用 buildroot 编译系统镜像,我修改了 output/build/linux-4.18.12/ 中的 dts 文件,请问怎么重新编译 kernel?

    我试了几种办法都不行,如下:
    make linux-dirclean
    make linux-rebuild
    这样会把 output/build/linux-4.18.12/ 整个目录删掉,我修改的部分也就被删掉了。

    有没有大佬熟悉 buildroot 的,支个招。

    2 条回复    2021-07-31 10:45:08 +08:00
    t123yh
        1
    t123yh  
       2021-07-31 08:47:14 +08:00 via Android   ❤️ 1
    修改源码的话,建议用 Buildroot 的 OVERRIDE_SRCDIR 功能,在 Buildroot 以外修改源码,具体可以搜一下官方文档。如果直接在 output 里面修改,哪天不小心 clean 了,修改就没了。

    修改代码后,不用运行 linux-dirclean,只用 linux-rebuild 即可。Buildroot 会影 rsync 将你外部的源码同步到 output/build 并且编译,并且不会删掉上次编译的缓存文件,自动只编译你修改的部分。
    signalyc
        2
    signalyc  
       2021-07-31 10:45:08 +08:00   ❤️ 1
    buildroot 的源码基本都是从网上 pull 的,所以,找到 kernel 那一部分,修改为取代码方式为本地,然后把 pull 下来的 kernel 的 tar 包里的文件修改了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1420 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:28 · PVG 01:28 · LAX 10:28 · JFK 13:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.