Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1722377
  • 博文数量: 234
  • 博客积分: 4966
  • 博客等级: 上校
  • 技术积分: 3322
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-13 01:03
文章分类

全部博文(234)

文章存档

2017年(2)

2016年(1)

2015年(8)

2014年(11)

2013年(44)

2012年(27)

2011年(22)

2010年(30)

2009年(37)

2008年(6)

2007年(45)

2006年(1)

分类: LINUX

2012-06-09 00:22:37

   交换机上架前经常是要配置,联想下,LINUX系统如果不需要显示器,那就在某些时候方便很多了,其实稍微配置一下,也能达到同样的效果
1.检查系统是不是支持,主板上COM口必须还是要有的吧
proxy ~ # dmesg | grep tty
console [tty0] enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0a: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
这就表示机器上有serial console口的,而且是两个^_^

2.配置inittab支持serial console登录
修改/etc/inittab,启用以下两行
# SERIAL CONSOLES
s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100
s1:12345:respawn:/sbin/agetty 115200 ttyS1 vt100
如果想在用COM口登录时会显示很多花哨的提示,也可以按以下的方式作
# SERIAL CONSOLES s0:2345:respawn:/sbin/agetty -L -f /etc/issueserial 115200 ttyS0 vt100 s1:2345:respawn:/sbin/agetty -L -f /etc/issueserial 115200 ttyS1 vt100
其实就是给agetty加上-L -f等参数,具体情况可以看最后面的链接

3.修改完inittab文件后,要做的事是强制读取此文件,另外再重启agetty进程
# init q # pkill agetty
另外还不要忘了检查/etc/securetty文件里面是否有ttyS0这一行,没的话,记得加上,不然会不允许登录系统

4.最后一步就是配置grub,让它也支持serial console就行了,先在grub.conf配置中添加这两行
serial --unit=0 --speed=115200
terminal --timeout=10 serial console
然后再单个内核启动项后添加 console=tty0 console=ttyS0,115200
如下所示:
default 0
timeout 3
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
password --md5 $1$.FUig0$zxcvhKhxluNg4GZcf46lG/

serial --unit=0 --speed=115200
terminal --timeout=10 serial console

title Gentoo Linux 3.2.11-hardened
root (hd0,0)
kernel /boot/kernel-genkernel-x86-3.2.11-hardened dolvm rootfstype=ext4 root=/dev/ram0 real_root=/dev/proxy/system console=tty0 console=ttyS0,115200
initrd /boot/initramfs-genkernel-x86-3.2.11-hardened

差不多就可以了,只等测试…………

一些具体情况可以参考以下链接:






阅读(1603) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~