Linux 如何在yocto中为raspberry pi使用自己的内核配置?

Linux 如何在yocto中为raspberry pi使用自己的内核配置?,linux,linux-kernel,raspberry-pi,yocto,Linux,Linux Kernel,Raspberry Pi,Yocto,我想为我的RPI2+自定义板删除一些未使用的驱动程序。为此,我正在通过以下方式创建自己的配置: bitbake linux-raspberrypi -c menuconfig 并将新的内核预设保存到文件defconfig 在此之后,我为linux raspberryp配方创建了一个附加文件 所以我创建了这个文件 linux-raspberrypi%.bbappend 并填上: FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"

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

bitbake linux-raspberrypi -c menuconfig
并将新的内核预设保存到文件
defconfig

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

所以我创建了这个文件

linux-raspberrypi%.bbappend
并填上:

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

SRC_URI += "file://defconfig"

PACKAGE_ARCH = "raspberrypi2"
我将defconfig文件放在:

<meta-mylayer>/recipes-kernel/linux/linux-raspberrypi/raspberrypi2/defconfig
采用标准RPI2配置

你知道如何克服这个问题吗?
我正在研究meta raspberrypi和yocto的“实际”pyro分支。

请了解如何使用devtool修改jethro的源代码:

我将首先在它正在使用的git存储库中设置一个fork;

在Yocto中使用
devtool
; 在构建目录中:创建一个MyLinuxRaspberry文件夹

mkdir linux-raspberry-test
devtool modify -x linux-raspberry ./my-linux-raspberry
这将把源代码解包到
MyLinuxRaspberry
中,供您修改;它还在其中创建git存储库

然后,在
MyLinuxRaspberry
中修改代码;要测试构建,请运行
devtool build linux-raspberry
;一旦您满意了,就将这个git存储库添加到您的fork中

git add .
git commit -m "my-linux-raspberry"
devtool update-recipe linux-raspberry

可选:运行
devtool reset linux-raspberry
删除bbappend文件

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

meta raspberrypi
层在他们的内核配方中做了一些不幸的事情,尽管这已经随着时间的推移而变得更好,但它们仍然不是很好

如果您查看
recipes kernel/linux/linux raspberrypi.inc
,以下几行解释了该问题:

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

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

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
覆盖内核树中的树

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