对linux os进行更改 [英] make changes to linux os

查看:71
本文介绍了对linux os进行更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为嵌入式板构建Linux内核.

I Build Linux kernel for my embedded board.

我想自定义板子的功能.

I want to customize the features of my board.

我该怎么做?

谢谢.

推荐答案

在您的图层元自定义中创建以下树:

Create the following tree in your layer meta-custom:

recipes-kernel/
└── linux
    ├── linux-at91
    │   ├── 0001-my-custom-dt.patch
    └── linux-at91_%.bbappend

linux-at91 _%.bbappend 中,放入

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-my-custom-dt.patch"

要生成 0001-my-custom-dt.patch ,可以使用以下步骤:

To generate 0001-my-custom-dt.patch, you can use the following steps:

git clone https://github.com/linux4sam/linux-at91.git
cd linux-at91/
quilt new 0001-my-custom-dt.patch
quilt add arch/arm/boot/dts/at91-sama5d27_som1_ek.dts 
vim arch/arm/boot/dts/at91-sama5d27_som1_ek.dts

# modify DT

quilt refresh

您应该获得类似的内容:

You should obtain something like:

Index: linux-at91/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
===================================================================
--- linux-at91.orig/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ linux-at91/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -538,7 +538,7 @@
        compatible = "gpio-leds";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_led_gpio_default>;
-       status = "okay"; /* Conflict with pwm0. */
+       status = "disabled"; /* Conflict with pwm0. */

        red {
            label = "red";

最后在 recipes-kernel/linux/linux-at91 中复制补丁,然后重新启动Yocto构建.

Finally copy patch in recipes-kernel/linux/linux-at91 and relaunch Yocto build.

注意:您还可以使用

Note: you could also create an entire custom device-tree by using KERNEL_DEVICETREE bitbake variable.

这篇关于对linux os进行更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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