如何在yocto中为树莓派使用自己的内核配置?

编程入门 行业动态 更新时间:2024-10-19 06:22:46
本文介绍了如何在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中为树莓派使用自己的内核配置?

本文发布于:2023-11-28 15:24:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642945.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自己的   内核   中为   如何在   yocto

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!