这套引导参数从何而来? [英] Where is this set of boot arguments coming from?

查看:95
本文介绍了这套引导参数从何而来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Yocto将 EVL核心移植到iMX6 Saber SD板上.

I'm using Yocto to port the EVL Core to an iMX6 Sabre SD board.

我有一个内核的核心映像最小值(显然不是主线),它在启动前显示了以下启动参数,可以正确启动:

I had an core-image-minimal of a kernel (apparently not mainline) that booted correctly with the following boot arguments being displayed before boot:

[    0.000000] Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk2p2 rootwait rw 

然后,我将内核更改为EVL内核(这是主线内核)(两个内核均为5.4).在对新内核的设备树进行一些更改之后,我验证了它正在使用以下命令进行引导:

I then proceeded to change the core for that of the EVL core (which is a mainline kernel) (both Kernels are 5.4). After making some changes to the device tree, of the new kernel, I verified that it is booting with the following:

[    0.000000] Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk2p2 r

也就是说,rootwait rw仅由r代替.不用说这会在启动过程中引起问题,我想更改它.

That is, the rootwait rw was replaced by just r. Needless to say this is causing problems during boot and I want to change it.

但是,我不知道这条线是从哪里来的.我搜索了内核源代码,找不到特定的行,甚至找不到其中的某些部分.我认为,它不是由脚本编写的,而是由一系列 append 命令的序列构成的.

However, I can't figure out where is this line coming from. I searched the kernel source code and couldn't find the specific line, not even some parts of it. I reckon that instead of just being written in a script, it is being formed by a sequence of some sort of append command.

作为参考,我正在其中搜索的文件为

For reference, the files in which I am searching for this are here.

问题:这条线是如何形成的,论点从何而来?

Question: How is this line being formed, where are the arguments coming from?

我检查了大多数主板上是否有"bootargs".设备树中的一行直接给出了要传递的参数.但是,对于Sabre SD的特定情况,这似乎有所不同,该行是通过另一个脚本形成的(我无法确定哪个行).

I checked that most boards have a "bootargs" line in their device tree that gives in directly the arguments to be passed. However, for the specific case of the Sabre SD this seems to be different, with the line being formed via another script (That I failed to identify which).

注意:据我所知,可以将这个问题与本网站的主题相联系.如果是这样,我可以转到Unix/Linux SE.

Note: I understand that this question could arguably be considered tangent to the topic of this site. If that is the case I can move to the Unix/Linux SE.

其他信息:我正在使用U-boot进行引导,并尝试通过SD卡进行引导.缺少rootwait rw引起的问题是,启动期间内核无法看到SD分区之一,因此无法继续启动,从而导致内核崩溃.

Additional Info: I am booting using U-boot, and trying to boot via an SD card. The problem being caused by the absence of rootwait rw is that during boot the kernel fails to see one of the SD partitions and thus cannot continue to boot, resulting in a Kernel Panic.

推荐答案

因此,在获得一些帮助后,我找到了答案.在我的bootenv环境中,没有bootargs变量.这是因为人们可以看到,作为printenv *输出的一部分:

So after some help received I found the answer. In my bootenv environment there is no bootargs variable. That is because one can see, as part of the output of printenv*:

bootcmd=run findfdt;run findtee;mmc dev ${mmcdev};if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi

前两个命令是成功的测试.之后,输入一个嵌套的ifs序列.在这些ifs中,我们可以看到它运行MMC引导(因为我是从SD卡引导). 然后,此命令在引导时在运行时定义 bootargs变量,这就是为什么我在源代码中找不到它的原因.

The first two commands are tests that succeeded. After that, in enters in a sequence of nested ifs. In these ifs we can see that it runs MMC boot (since I am booting from a SD card). This commands then defines the bootargs variable on-the-run during boottime, that's why I couldn't find it in the source code.

*我在这个问题中没有提供.这个细节很重要.

*Which I failed to provide in this question. This detail was fundamental.

这篇关于这套引导参数从何而来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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