解决之前遗留问题:
(1)开机后VGA上有"linux login:"登录提示,而串口侧没有
解决方法:将ttyS0.conf改为如下内容:
[email protected]:~$ 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 [email protected]:~$
(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,即:
[email protected]:~$ 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 }
时间: 2024-10-08 10:27:48