SOL的补充

之前写过一些关于远程安装系统的文档,但是对于SOL还是糊涂不清。

Serial Console 可以将输入输出转发到串行接口(com1, com2), 假如你有串行读取设备,就可以看到显示,控制输入。不过串行读取设备不太好找,怎么办?
SOL(Serial over LAN)一种机制,将串行接口的通讯转到ip地址,这样我们无须串行设备,通过网络就可以了。

串行接口设备名
COM1: /dev/ttyS0 /dev/tts/0 0
COM2: /dev/ttyS1 /dev/tts/1 1
COM3: /dev/ttyS2 /dev/tts/2 2
COM4: /dev/ttyS3 /dev/tts/3 3

以 Supermicro X10SL7-F 主板为例

首先将服务器安装系统,然后查看哪个串行接口生效,如下
dmesg | grep ttyS

console [ttyS1] enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
serial8250: ttyS2 at I/O 0x3e8 (irq = 5) is a 16550A
00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0b: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:0e: ttyS2 at I/O 0x3e8 (irq = 5) is a 16550A

可以看到目前生效的是ttyS1

BIOS配置

串口输出重定向LAN
Serial Port Console Redirection -> SOL Console Redirection -> enabled
Serial Port Console Redirection -> Legacy Console Redirection -> COM2

GRUB配置

GRUB输出重定向到串口
1) centos6
/etc/grub.conf
serial --unit=1 --speed=115200
terminal --timeout=5 serial console
kernel /boot/vmlinuz-2.6.32-642.el6.x86_64 ro root=UUID=2cf9c0e4-2334-4bf7-9a06-caeae461ba77 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto console=ttyS1,115200 console=tty0 rd_NO_LVM rd_NO_DM

2)centos7
/etc/default/grub
GRUB_TERMINAL="serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=1 --word=8 --parity=no --stop=1"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet console=ttyS1,115200 console=tty0"

然后执行grub2-mkconfig -o /boot/grub2/grub.cfg

KERNEL配置

一般用于安装系统时使用,pxe配置文件
APPEND initrd=centos-7/initrd.img ip=dhcp BOOTIF=78:2b:cb:69:10:f3 inst.ks=http://install.localhost/kickstart/78:2b:cb:69:10:f3 ramdisk_size=102400 console=ttyS1,115200 console=tty0
则kernel会将输出信息同时输出到串口(ttyS0即COM2)和终端tty0

原文地址:https://www.cnblogs.com/liujitao79/p/6993249.html