【问题标题】:Buildroot - how to customise an existing kernel defconfigBuildroot - 如何自定义现有的内核 defconfig
【发布时间】:2019-10-21 00:21:58
【问题描述】:

我想知道如何使用 Buildroot 的 ncurses 接口构建自定义内核 defconfig(以标准 bcmrpi defconfig 为起点)。

我目前在 Buildroot 菜单配置中选择了 Kernel configuration -> Using an in-tree defconfig filebcmrpiDefconfig name

我尝试使用 make linux-menuconfig 对内核进行一些更改,但是当我尝试使用 make clean 编译它时,这些更改没有构建,并且当我检查 linux-menuconfig 之后它们已被重置回 @ 987654328@设置。

我想从这些默认值中更改一些设置,然后将结果设置保存到新的 defconfig 中,类似于 Buildroot 所做的make savedefconfig,但用于内核。我使用什么命令?

【问题讨论】:

    标签: kernel buildroot


    【解决方案1】:

    Buildroot 确实提供了 make linux-update-defconfig,如 manual 中所述 - 但请注意,您需要先配置 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE 以便它知道存储配置文件的位置。

    您也可以使用片段文件,例如 E.G.附加到 bcmrpi_defconfig 的 kconfig 的 sn-p。有关此示例,请参见 configs/orangepi_zero_defconfig。

    【讨论】:

    • 另外,如果设置了BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILEmake linux-update-defconfig必须在重新编译内核之前运行否则你的配置更改将会丢失
    【解决方案2】:

    我通过制作包装脚本make-linuxmenuconfig.sh 来解决这个问题:

    #/bin/bash
    make linuxmenuconfig
    cp output/build/linux-XYZ/.config ../br-external/configs/kernel_config
    

    这样我的更改会在使用配置编辑器后自动保存。 然后我添加了

    BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="../br-external/configs/kernel_config"
    

    到 Buildroot 配置。

    您可能需要更改目录以适合您的项目布局。

    【讨论】:

    • 可以,但是不需要脚本。一旦你指向BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE,启动make linux-update-defconfig,Buildroot 将根据@Peter Korsgaard 的回复更新你的文件。
    猜你喜欢
    • 2011-05-18
    • 2016-09-10
    • 2017-06-26
    • 2015-08-24
    • 2019-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多