操作步骤:
@H_403_10@1、修改/etc/default/grub
## Modify this line by leekwen @H_403_10@GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8" @H_403_10@ @H_403_10@## Modify this line by leekwen @H_403_10@GRUB_TERMINAL=serial @H_403_10@ @H_403_10@## Add this line by leekwen @H_403_10@GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" @H_403_10@ @H_403_10@2、运行update-grub命令
@H_403_10@3、增加配置文件/etc/init.d/ttyS0.conf
@H_403_10@leekwen@leekwen:/etc/default$ cat /etc/init/ttyS0.conf @H_403_10@# Add those lines @H_403_10@# ttyS0 - getty @H_403_10@# @H_403_10@# This service maintains a getty on ttyS0 from the point the system is @H_403_10@# started until it is shut down again. @H_403_10@ @H_403_10@ @H_403_10@start on stopped rc RUNLEVEL=[2345] and ( @H_403_10@ not-container or @H_403_10@ container CONTAINER=lxc or @H_403_10@ container CONTAINER=lxc-libvirt) @H_403_10@ @H_403_10@ @H_403_10@stop on runlevel [!2345] @H_403_10@ @H_403_10@ @H_403_10@respawn @H_403_10@exec /sbin/getty -L 115200 ttyS0 vt100 @H_403_10@ @H_403_10@ @H_403_10@# Add those lines End
@H_403_10@
# cat /proc/cmdlineBOOT_IMAGE=/boot/vmlinuz-3.13.0-32-generic root=/dev/sda1 ro console=tty0 console=ttyS2,115200n8
# who