码迷,mamicode.com
首页 > 系统相关 > 详细

如何设置ubuntu系统的串口输出(二)

时间:2014-12-27 00:20:10      阅读:240      评论:0      收藏:0      [点我收藏+]

标签:

解决之前遗留问题:

(1)开机后VGA上有"linux login:"登录提示,而串口侧没有

解决方法:将ttyS0.conf改为如下内容:

linux@linux:~$ cat /etc/init/ttyS0.conf 
# ttyS- getty
#
# This service maintains a getty on tty1 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
linux@linux:~$ 

(2)VGA上开机时是乱码的,但是选择第一个Ubuntu菜单开机时正常的

解决方法:修改/boot/grub/grub.conf,仅保留如下内容:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-2c604c33-d631-4440-b0fc-697bd6f32749' {
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  2c604c33-d631-4440-b0fc-697bd6f32749
        else
          search --no-floppy --fs-uuid --set=root 2c604c33-d631-4440-b0fc-697bd6f32749
        fi
        linux   /boot/vmlinuz-3.16.0-23-generic root=UUID=2c604c33-d631-4440-b0fc-697bd6f32749 ro  text console=tty0 console=ttyS0,115200n8
        initrd  /boot/initrd.img-3.16.0-23-generic
}

(3)这样会引入一个问题:VGA上会停在ubuntu 引导界面,这里需要设置一个超时时间来倒计时

在grub.cfg中加上set timeout=10,即:

linux@linux:~$ cat /boot/grub/grub.cfg
set timeout=10
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-2c604c33-d631-4440-b0fc-697bd6f32749' {
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  2c604c33-d631-4440-b0fc-697bd6f32749
        else
          search --no-floppy --fs-uuid --set=root 2c604c33-d631-4440-b0fc-697bd6f32749
        fi
        linux   /boot/vmlinuz-3.16.0-23-generic root=UUID=2c604c33-d631-4440-b0fc-697bd6f32749 ro  text console=tty0 console=ttyS0,115200n8
        initrd  /boot/initrd.img-3.16.0-23-generic
}




如何设置ubuntu系统的串口输出(二)

标签:

原文地址:http://blog.csdn.net/xiangpingli/article/details/42179541

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!