linux怎样去除串口打印_嵌入式Linux关闭串口打印-屏蔽串口打印

本文介绍了如何在Linux中通过修改bootargs和文件系统配置来去除串口打印,具体包括在bootargs中移除console参数以及注释掉/etc/inittab中的相关getty条目,从而实现嵌入式Linux系统启动时的串口打印屏蔽。
摘要由CSDN通过智能技术生成

bootargs修改

修改前:

setenv bootargs 'mem=64M console=ttyAMA0,115200 root=/dev/sda1 rootwait rw mtdparts=hi_sfc:256k(boot),64k(env),4M(kernel),7M(rootfs)'

修改后:

setenv bootargs 'mem=64M root=/dev/sda1 rootwait rw mtdparts=hi_sfc:256k(boot),64k(env),4M(kernel),7M(rootfs)'

将console去掉

文件系统修改

在文件系统 /etc/inittab

#::askfirst:-/bin/sh

# Start an "askfirst" shell on /dev/tty2-4

# tty2::askfirst:-/bin/sh

# tty3::askfirst:-/bin/sh

# tty4::askfirst:-/bin/sh

# /sbin/getty invocations for selected ttys

# tty4::respawn:/sbin/getty 38400 tty5

# tty5::respawn:/sbin/getty 38400 tty6

# Example of how to put a getty on a serial line (for a terminal)

::respawn:/sbin/getty -L ttyS000 115200 vt100 -n root -I "Auto login as root ..."

#::respawn:/sbin/getty -L tt

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值