I have been struggling with setting up two serial ports on an HP/Compaq D512S (Intel P4) under CentOS-5. I am not at all sure why these things were not auto-configured when I initially installed the CentOS system from CDs but they were not.
I have found various resources on the web and from them uncovered the setserial utility. What I need from somebody is guidance on how to use this utility to properly configure the ports.
Currently in /dev/ I have:
crw------- 1 uucp uucp 4, 64 Dec 21 12:14 ttyS0 crw------- 1 root root 4, 65 Dec 20 17:36 ttyS1 crw------- 1 root root 4, 66 Dec 20 17:36 ttyS2 crw------- 1 root root 4, 67 Dec 20 17:36 ttyS3
When I run setserial -g ttyS* I get this:
# setserial -g ttyS* Cannot get serial info: Invalid argument ttyS1: No such device or address ttyS2: No such device or address ttyS3: No such device or address
Can someone walk me through this? I setup hylafax previously on our existing CentOS-4.5 server and never had this difficulty nor had to use setserial, so far as I can recall.
Sincerely,
On Dec 21, 2007 1:16 PM, James B. Byrne byrnejb@harte-lyne.ca wrote:
When I run setserial -g ttyS* I get this:
try setserial -g /dev/ttyS*
BTW, what does dmesg | grep tty show?
HTH, -Bob
# setserial -g /dev/ttyS* Cannot get serial info: Invalid argument /dev/ttyS1: No such device or address /dev/ttyS2: No such device or address /dev/ttyS3: No such device or address # # dmesg | grep tty Xen virtual console successfully installed as ttyS0 #
On Dec 21, 2007 12:35 PM, James B. Byrne byrnejb@harte-lyne.ca wrote:
# setserial -g /dev/ttyS* Cannot get serial info: Invalid argument /dev/ttyS1: No such device or address /dev/ttyS2: No such device or address /dev/ttyS3: No such device or address # # dmesg | grep tty Xen virtual console successfully installed as ttyS0
Well my primary guess is that you are running a Xen kernel which disables the serial tty's for its own 'tty' devices and so that guests can grab 'real' serial ports. Other items it could be is that the BIOS has them disabled or that the BIOS has a 'bug' that needs a patch.
http://wiki.xensource.com/xenwiki/InstallationNotes
Looking at threads referencing this.. you can either have a kernel where Xen machines can have virtual serial access or you can have external serial ports.. in the later case you may need to rebuild the kernel, but you should try first booting with
xencons=off
to see if it lets the other serial ports be seen. If it doesnt then you will need to rebuild the kernel as per installation notes.
I am not sure but this seems to refer to a similar problem. If so, can someone tell me how to configure around this:
Bugzilla Bug 204825: CONFIG_SERIAL_8250 not set to "y" in xen0 kernel
Taking a suggestion from the discussion regarding the aforementioned bug I altered /boot/grub/grub.conf and added this entry:
title CentOS (2.6.18-53.1.4.el5xen-com1) root (hd0,0) kernel /xen.gz-2.6.18-53.1.4.el5 com1=38400,8n1 module /vmlinuz-2.6.18-53.1.4.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet xencons=xvc console=xvc module /initrd-2.6.18-53.1.4.el5xen.img
Which explicitly sets the console for the xen root to com1 and bypasses the module altogether. This works as can be seen by:
# setserial -g /dev/ttyS* /dev/ttyS0, UART: unknown, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
However, since this fix will get clobbered on the very next kernel update the recommended method seems to be to add these rules to udev:
ACTION=="add", SUBSYSTEM=="pnp", RUN+="/bin/sh -c 'while read id; \ do /sbin/modprobe pnp:d$$id ; done < /sys/$devpath/id'"
Can somebody tell me how to do that? Where do I do this. I have very little experience with this sort of thing. As this bug is reported upstream and is more than a year old I have some difficulty understanding how it persists in CentOS-5.
Regards,
On Dec 21, 2007 1:38 PM, James B. Byrne byrnejb@harte-lyne.ca wrote:
Taking a suggestion from the discussion regarding the aforementioned bug I altered /boot/grub/grub.conf and added this entry:
title CentOS (2.6.18-53.1.4.el5xen-com1) root (hd0,0) kernel /xen.gz-2.6.18-53.1.4.el5 com1=38400,8n1 module /vmlinuz-2.6.18-53.1.4.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet xencons=xvc console=xvc module /initrd-2.6.18-53.1.4.el5xen.img
Which explicitly sets the console for the xen root to com1 and bypasses the module altogether. This works as can be seen by:
# setserial -g /dev/ttyS* /dev/ttyS0, UART: unknown, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
However, since this fix will get clobbered on the very next kernel update the recommended method seems to be to add these rules to udev:
ACTION=="add", SUBSYSTEM=="pnp", RUN+="/bin/sh -c 'while read id; \ do /sbin/modprobe pnp:d$$id ; done < /sys/$devpath/id'"
Can somebody tell me how to do that? Where do I do this. I have very little experience with this sort of thing. As this bug is reported upstream and is more than a year old I have some difficulty understanding how it persists in CentOS-5.
If upstream does not fix it, CentOS does not fix it. Bug for bug compatible. Also I am not sure it is a true bug as much as an optional system setting. Most of Xen documentation assumes your ttyS0 is being run by Xen .. so turning it off from that way would be thought of people as being bug who were going by the Xen docs.
I fixed the UART assignment for ttyS0 with
# setserial /dev/ttyS0 UART 16550A
and now my modem's TR signal is high as desired. My question, am I condemned to manually editing the grub.conf file after every kernel update or is their a way to configure the system so that I get access to ttyS0 with the grub entries as distributed via yum?
Sincerely,
On Fri, 2007-12-21 at 16:03 -0500, James B. Byrne wrote:
I fixed the UART assignment for ttyS0 with
# setserial /dev/ttyS0 UART 16550A
and now my modem's TR signal is high as desired. My question, am I condemned to manually editing the grub.conf file after every kernel update or is their a way to configure the system so that I get access to ttyS0 with the grub entries as distributed via yum?
Add the command to /etc/rc.d/rc.local
Sincerely,
On Dec 21, 2007 2:03 PM, James B. Byrne byrnejb@harte-lyne.ca wrote:
I fixed the UART assignment for ttyS0 with
# setserial /dev/ttyS0 UART 16550A
and now my modem's TR signal is high as desired. My question, am I condemned to manually editing the grub.conf file after every kernel update or is their a way to configure the system so that I get access to ttyS0 with the grub entries as distributed via yum?
grubby should be smart enough to pull a well formated syntax on a kernel upgrade. It seems to work for me.. but thats on a limted set of changes in /etc/grub.conf
Ok, I can now configure ttyS1 with faxaddmodem, which I could not do before these changes, so that is progress. However, faxaddmodem reports that it cannot detect a modem on ttyS0. Since the modem and cable are the same for both, I am simply physically switching the port that the cable connects to in order to carry out the configuration, obviously something else is wrong.
Does anyone have any pointers on how to get the primary serial port back from xen so that it can be of some use? can I configure the irq for com1 to use ttyS2? Will that work?
Seizing one of just two available serial devices for a console port strikes me as a dubious design choice. I venture that the vast majority of ES5/CentOS5 installations do not even configure xen doms other than 0 and of those that do, only a vanishingly small percentage actually employ a serial console interface.
Regards,
James B. Byrne wrote:
Ok, I can now configure ttyS1 with faxaddmodem, which I could not do before these changes, so that is progress. However, faxaddmodem reports that it cannot detect a modem on ttyS0. Since the modem and cable are the same for both, I am simply physically switching the port that the cable connects to in order to carry out the configuration, obviously something else is wrong.
Does anyone have any pointers on how to get the primary serial port back from xen so that it can be of some use? can I configure the irq for com1 to use ttyS2? Will that work?
Seizing one of just two available serial devices for a console port strikes me as a dubious design choice. I venture that the vast majority of ES5/CentOS5 installations do not even configure xen doms other than 0 and of those that do, only a vanishingly small percentage actually employ a serial console interface.
First stupid question by me :D
1. Do you really need to be running xen? (ie, are you doing a DomU also on that machine) If not, boot the real kernel and you will be set :D
2. If you really do NEED xen then I assume you are trying to do this serial stuff on Dom0 (where the serial port has a special purpose) ... why not do it on a DomU instead?
Thanks, Johnny Hughes
First stupid question by me :D
- Do you really need to be running xen? (ie, are you doing a DomU
also on that machine) If not, boot the real kernel and you will be set :D
There are no silly questions, only silly walks....
No. I do not require, or desire, a Xen VM or HVM machine. This is what the install of CentOS-5 from CD gave me and as far as I can recall I did not have an option to do otherwise. I will gladly boot to the "real" kernel to bypass this nonsense if some kind soul will tell me how to do this. I do not see any non-xen images in /boot, how do I get them?
In the meantime, I revised my grub.conf to meet the documented options of and set it thusly:
title CentOS (2.6.18-53.1.4.el5xen-cons-vga) root (hd0,0) kernel /xen.gz-2.6.18-53.1.4.el5 module /vmlinuz-2.6.18-53.1.4.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet console=vga xencons=off module /initrd-2.6.18-53.1.4.el5xen.img
This gives me a working ttyS1 but no ttyS0
Regards,
On Sat, 22 Dec 2007, James B. Byrne wrote:
First stupid question by me :D
- Do you really need to be running xen? (ie, are you doing a DomU
also on that machine) If not, boot the real kernel and you will be set :D
There are no silly questions, only silly walks....
No. I do not require, or desire, a Xen VM or HVM machine. This is what the install of CentOS-5 from CD gave me and as far as I can recall I did not have an option to do otherwise. I will gladly boot to the "real" kernel to bypass this nonsense if some kind soul will tell me how to do this. I do not see any non-xen images in /boot, how do I get them?
Most likely "yum install kernel" will get you a regular kernel. If you do "yum list kernel*" you will see a list of all of the available kernel packages.
From there you can pick the one you want. Once you have the regular kernel
running I would do "yum erase kernel-xen" if you are not going to use the xen stuff. Warning, only erase the xen kernel AFTER you have the machine running the normal kernel, otherwise you will have a machine that will not boot.
In addition you should edit /etc/grub.conf to make the normal kernel the default. That way you will not have to select it each time you reboot.
Regards,
I added this ti /etc/yum.repos.d/CentOS-Base.repo:
[base] name=CentOS-$releasever - Base ... exclude=kernel
[centosplus] name=CentOS-$releasever - Plus ... includepkgs=kernel
and then ran yum install kernel
This seems to have done something, for good or bad I am not yet sure. Is this the correct procedure?
Sincerely,
On Sat, 22 Dec 2007, James B. Byrne wrote:
I added this ti /etc/yum.repos.d/CentOS-Base.repo:
[base] name=CentOS-$releasever - Base ... exclude=kernel
[centosplus] name=CentOS-$releasever - Plus ... includepkgs=kernel
and then ran yum install kernel
This seems to have done something, for good or bad I am not yet sure. Is this the correct procedure?
NO!!
Now you most likely have the centosplus kernel. I doubt that you need that either. That might get your serial ports working but.....
Now you need to show the output of "yum list kernel*" and uname -r so that we can tell what you need to remove and install.
Regards,
I had to modify grub.conf so that "default=0" (one of the most irritating affectations of the computer age is the promotion of zero to an ordinal number) was set instead of default=1 and then the new kernel came up and ttyS0 is available for use. Thank you for the pointer.
Sincerely,
On Dec 22, 2007 1:44 PM, James B. Byrne byrnejb@harte-lyne.ca wrote:
I had to modify grub.conf so that "default=0" (one of the most irritating affectations of the computer age is the promotion of zero to an ordinal number) was set instead of default=1 and then the new kernel came up and ttyS0 is available for use. Thank you for the pointer.
Sincerely,
Hint: Look at /etc/sysconfig/kernel
Akemi
Thank you for all of the hints and advice. I have modified /etc/sysconfig/kernel and again altered the CentOS-Base.repo to fetch the kernel from the mainline repository rather than from Plus. I cleared out the rmp database kernel entry and installed the "real" kernel via yum, checked that grub.conf was ok, rebooted and all seems good.
Can someone point me towards a document detailing the function, settings, and syntax of /etc/sysconfig/kernel. I tried to locate this via google and apropos but came up with just a few oblique references and no substantive documentation.
Regards,