【问题标题】:How to disable messages to console during boot of Coral Dev Board?如何在 Coral 开发板启动期间禁用控制台消息?
【发布时间】:2020-02-07 07:18:53
【问题描述】:

我购买了一个珊瑚开发板。引导期间向控制台输出消息似乎增加了大约 1 秒的引导时间,因此我想禁用控制台或减少写入控制台的消息数量。为此,我尝试了两种不同的方法。

我已经在 U-Boot 中设置了 bootargs 参数,以将 quiet 作为内核参数传递,以使用以下命令使控制台静音:

setenv bootargs quiet
saveenv

我还在 U-Boot 配置文件 imx8mq_phanbell.h 中添加了以下几行:

CONFIG_SILENT_CONSOLE
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
CONFIG_SYS_DEVICE_NULLDEV

然后我重建了 u-boot 并将其刷到板上并将 u-boot 变量静默设置为 1。

这些更改都没有对引导期间控制台的输出产生任何影响。 你能帮我解决这个问题吗?

【问题讨论】:

  • "我已经设置了 bootargs 参数..." -- 你需要确认到底是用什么命令行来引导内核的。检查您抱怨的引导日志(或转储 /proc/cmdline),以了解所使用的实际内核命令行。检查内核配置以帮助确定该命令行来自何处​​(例如来自设备树?)。见stackoverflow.com/questions/48801998/…
  • 您可以通过 mdt shell 使用 OTG 电缆登录,而不会看到日志。使用串行控制台,您可以运行 sudo dmesg -D 禁用内核日志,但您不应该永久禁用它。
  • @NamVu @sawdust Dump of /proc/cmdline: console=ttymxc0,115200 console=tty0 earlycon=ec_imx6q,0x30860000,115200 root=PARTUUID=70672ec3-5eee-49ff-b3b1-eb1fbd406bf5 rootfstype=ext4 rw rootwait init=/sbin/init net.ifnames=0 pci=pcie_bus_perf 使用 sudo dmesg -D 不会为我禁用内核日志。

标签: u-boot google-coral


【解决方案1】:

我通过首先将quiet 参数添加到文件boot.txt 中定义的cmdline 变量解决了我的问题:https://coral.googlesource.com/build/+/refs/heads/docker/boot.txt

然后我用mkimage工具将boot.txt编译成脚本镜像文件,并用这个文件替换了/boot中U-Boot使用的boot.scr

这确实减少了启动时间。

【讨论】:

    【解决方案2】:

    感谢 Fredrik 的回复,重申一下,但这适用于任何需要添加的内核参数:

    • 下载boot.txt:
    $ curl https://coral.googlesource.com/build/+/refs/heads/docker/boot.txt\?format\=TEXT | base64 --decode | tee boot.txt > /dev/null
    
    • 安装 mkimage:
    $ sudo apt install u-boot-tools
    
    • 在 cmdline="" 行中进行必要的更改,对于本示例,我们需要添加“quiet loglevel=0”:
    cmdline=<preexsisting> + quiet loglevel=0
    
    • 编译为boot.scr:
    $ mkimage -A arm -T script -O linux -d boot.txt boot.scr
    
    • 替换启动镜像文件
    $ mv boot.scr > /boot
    

    重新启动并加载新的内核参数。

    【讨论】:

      猜你喜欢
      • 2022-06-18
      • 2022-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-29
      • 1970-01-01
      • 2010-09-27
      • 1970-01-01
      相关资源
      最近更新 更多