How to switch linux kernel console after boot process?

前端 未结 1 1839
栀梦
栀梦 2021-02-05 12:35

On my embedded system I usually use /dev/ttyS0 as a main console. This is achieved by passing kernel parameter console=/dev/ttyS0 and when init takes i

相关标签:
1条回答
  • 2021-02-05 12:43

    It seems that perhaps you don't actually want the console log messages on another device, but are only proposing to redirect them there to stop them from interfering with binary transfers on the primary serial device.

    If that is the case, you may be able to solve your problem by dynamically adjusting the console log level.

    http://tuxthink.blogspot.com/2012/07/printk-and-console-log-level.html

    Suggests that you can do this by writing to a proc node:

    echo "6" > /proc/sys/kernel/printk
    

    Would set it to 6 in their example. I suspect setting it to 0 or 1 would work for your purposes - if something goes that wrong, your binary transfer is probably failed anyway.

    Log entries should still be retrievable by dmesg regardless of this setting.

    0 讨论(0)
提交回复
热议问题