您的位置:首页 > 其它

如何将ubuntu控制台输出到串口?

2014-07-11 13:45 218 查看

操作步骤:

1、修改/etc/default/grub

## Modify this line by leekwen

GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"

## Modify this line by leekwen

GRUB_TERMINAL=serial

## Add this line by leekwen

GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

2、运行update-grub命令

3、增加配置文件/etc/init.d/ttyS0.conf

leekwen@leekwen:/etc/default$ cat /etc/init/ttyS0.conf

# Add those lines

# ttyS0 - getty

#

# This service maintains a getty on ttyS0 from the point the system is

# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345] and (

not-container or

container CONTAINER=lxc or

container CONTAINER=lxc-libvirt)

stop on runlevel [!2345]

respawn

exec /sbin/getty -L 115200 ttyS0 vt100

# Add those lines End

参考地址:

https://help.ubuntu.com/community/SerialConsoleHowto

https://help.ubuntu.com/community/Grub2
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: