如何在yocto中为树莓派使用自己的内核配置? [英] How to use an own kernel configuration for a raspberry pi in yocto?

查看:114
本文介绍了如何在yocto中为树莓派使用自己的内核配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的RPI2 +自定义板删除一些未使用的驱动程序.为此,我通过以下方式创建自己的配置:

I like to remove some unused drivers for my RPI2 + custom board. For that I am creating an own configuration via:

bitbake linux-raspberrypi -c menuconfig

并将新的内核预设保存到文件 defconfig.

and save the new kernel preset to the file defconfig.

此后,我为linux-raspberryp配方创建了一个附加文件.

After this I created an append file for the linux-raspberryp recipe.

所以我创建了文件

linux-raspberrypi%.bbappend

并用以下内容填充:

FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"

SRC_URI += "file://defconfig"

PACKAGE_ARCH = "raspberrypi2"

我将defconfig文件放到:

I put the defconfig file to:

<meta-mylayer>/recipes-kernel/linux/linux-raspberrypi/raspberrypi2/defconfig

通过以下方式重新编译内核时:

When recompiling the kernel via:

bitbake linux-raspberrypi -c clean
bitbake linux-raspberrypi

采用标准RPI2配置.

The standard RPI2 configuration is taken.

任何想法如何克服这个问题?我正在研究meta-raspberrypi和yocto的实际" pyro分支.

Any idea how to overcome this problem? I am working on the "actual" pyro branch of meta-raspberrypi and yocto.

推荐答案

不幸的是,最简单的方法可能是修补内核源代码……或将defconfig复制到内核树中.

Well, unfortunately, the easiest way is probably to patch the kernel source... Or copy your defconfig over the in kernel-tree one.

meta-raspberrypi 层在其内核配方中做了一些不幸的事情,尽管随着时间的流逝它变得越来越好,但它们仍然不是很好...

The meta-raspberrypi layer does some unfortunate things in their kernel recipes, and even though this has become better with time, they're still not really nice...

如果您查看 recipes-kernel/linux/linux-raspberrypi.inc ,则以下几行说明了该问题:

If you take a look at recipes-kernel/linux/linux-raspberrypi.inc, the following lines explains the issue:

KERNEL_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig"

do_kernel_configme_prepend() {
    install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available."
}

因此,他们正在将树内defconfig复制到 $ {WORKDIR}/defconfig ,从而覆盖了您自己的defconfig.

Thus,they're copying the in-tree defconfig to ${WORKDIR}/defconfig, thereby overwriting your own defconfig.

您在您的 .bbappend 中,可以尝试添加:

You in you .bbappend, you could try to add:

do_kernel_configme_prepend() {
    install -m 0644 ${WORKDIR}/defconfig ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available."
}

因此,首先用您自己的 defconfig 覆盖内核树.

Thus, first overwriting the in-kernel-tree one with your own defconfig.

这篇关于如何在yocto中为树莓派使用自己的内核配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆