Can I manage/modify console baud rates from userspace?
Hi all. I need some advice on an issue that just cropped up. We have a Linux embedded image (current kernel is 2.6.31-based) that we are booting up on blade systems using PXE to obtain the kernel image, the kernel boot line parameters, and an initrd from a server.
On these systems we REALLY need to be able to watch the console, even after deployment into the field (e.g., not just during development/internally).
We currently run this image on various hardware platforms, one of which uses serial-over-LAN, where the console is connected to a dedicated vlan from the blade to the chassis management module, which you can ssh into and from there connect to the console on any blade in the chassis. The vlan configuration on these blades doesn't support any baud rate over 19200, so in order to get this working we use the PXE configuration file to add "console=ttyS1,19200" to the kernel boot line. Works great!
Here's the problem. The vendor has released a new version of the blade hardware for this platform, and while the old hardware didn't support any baud rate above 19200 for serial-over-LAN, the new hardware doesn't support any baud rate at 19200 or below, so there's no single baud rate that will work for both types of blades.
These blades are interchangeable in the chassis and since the current ones are end-of-life we have to start to support the new blade, and we have to support combinations of new and old blades in the same chassis (due to replacements).
So I _have_ to find a way to get the console working in this configuration. Even if I lose the early boot messages but then managed to configure the console properly from userspace after the kernel booted, that would be less than ideal but at least it would be progress. Is there some way to do this? Is there some way in the kernel to handle this kind of situation?
I've looked at setserial and it supports a baud_base parameter but that doesn't appear to be what I want (I tried it anyway: changing it didn't work, my console output was still screwed up).
Trying to do something like creating customized PXE configs on the server based on the MAC addresses of the blades that are "new" (or old) would be an absolute nightmare as people swap blades between chassis, add new ones, etc. all the time.
Please help me find a better way... :-(
Quoted 4 lines · Paul Smith
I've looked at setserial and it supports a
baud_baseparameter but that doesn't appear to be what I want (I tried it anyway: changing it didn't work, my console output was still screwed up).
Quoted 8 lines
Trying to do something like creating customized PXE configs on the server based on the MAC addresses of the blades that are "new" (or old) would be an absolute nightmare as people swap blades between chassis, add new ones, etc. all the time.
Please help me find a better way... :-(
It's strange that it's not possible to change the baud rate, but I'm not an expert of tty layer. A naive implementation could be patch the kernel to choose a well-known baud rate for your hw reading a revision register or something like that.
Marco
Quoted 11 lines · Marco Stornelli
Quoted 10 lines · Paul Smith
I've looked at setserial and it supports a
baud_baseparameter but that doesn't appear to be what I want (I tried it anyway: changing it didn't work, my console output was still screwed up).Trying to do something like creating customized PXE configs on the server based on the MAC addresses of the blades that are "new" (or old) would be an absolute nightmare as people swap blades between chassis, add new ones, etc. all the time.
Quoted 7 lines
Quoted 2 lines
Please help me find a better way... :-(
It's strange that it's not possible to change the baud rate, but I'm not an expert of tty layer. A naive implementation could be patch the kernel to choose a well-known baud rate for your hw reading a revision register or something like that.
I guess; I'd hate to have to modify the kernel like that though. Plus, as far as I'm aware at the moment the only way to tell these blades apart is through querying IPMI which would be a serious bummer to try to do via the kernel, I believe. Maybe there's some other way to do it that's simpler.
Still hoping someone will say "all you have to do is XYZZY..." Anyone?
Quoted 20 lines · Paul Smith
Quoted 11 lines · Marco Stornelli
Quoted 10 lines · Paul Smith
I've looked at setserial and it supports a
baud_baseparameter but that doesn't appear to be what I want (I tried it anyway: changing it didn't work, my console output was still screwed up).Trying to do something like creating customized PXE configs on the server based on the MAC addresses of the blades that are "new" (or old) would be an absolute nightmare as people swap blades between chassis, add new ones, etc. all the time.
Quoted 7 lines
Quoted 2 lines
Please help me find a better way... :-(
It's strange that it's not possible to change the baud rate, but I'm not an expert of tty layer. A naive implementation could be patch the kernel to choose a well-known baud rate for your hw reading a revision register or something like that.
Quoted 7 lines
I guess; I'd hate to have to modify the kernel like that though. Plus, as far as I'm aware at the moment the only way to tell these blades apart is through querying IPMI which would be a serious bummer to try to do via the kernel, I believe. Maybe there's some other way to do it that's simpler.
Still hoping someone will say "all you have to do is XYZZY..." Anyone?
I would suggest asking Alan Cox - he if anyone would know. I lost the original mail and context above is missing some details. Anyway added to this mail.
Sam
Quoted 3 lines · Sam Ravnborg
I would suggest asking Alan Cox - he if anyone would know. I lost the original mail and context above is missing some details. Anyway added to this mail.
Thanks Sam. Alan, hope you don't mind a direct email. I'll cut down the original request to just (I hope) the important details.
I have an environment in which a number of (Intel-based) blades in one or more blade chassis boot from a host using PXE to download a Linux kernel (2.6.31-based ATM) and a ramdisk root partition. These blades provide access to the console via serial-over-LAN, where the chassis provides a special vlan connection to the blades' ttyS1 port. You can then connect to the chassis management module via SSH, and from there connect to the console of any of the blades.
We require this capability in our deployed systems, not just during development, so I need to make sure this is working at all times and that it's easy to configure and maintain in the field.
Today, all the blades we ship use a maximum baud rate of 19200 so in my PXE config, I have "console=ttyS1,19200" added to the kernel boot line. Works great.
The vendor is providing a newer version of these blades and the current version is end-of-lifed. The new blades are drop-in replaceable, individually, with the current blades, which is nice. Unfortunately these new blades do not support any overlapping baud rate with the old blades, so there's no single value I can provide in the PXE configuration on my host that will work with all blades in a heterogeneous blade deployment.
So I'm stuck here and don't have a good idea how to move forward. I tried using setserial to modify the baud rate (it supports a parameter baud_base which didn't seem like it would do what I wanted--and it didn't) but no joy.
Trying to customize the PXE config would be virtually impossible: we'd have to map all the MAC addresses and figure out which ones were for newer blades, and maintain that mapping as blades were swapped in and out and even moved between chassis or between slots in the same chassis. A nightmare!
Is there some other way to modify the baud rate of the console device from userspace once I figure out the right one? It would definitely be less than ideal since we'd lose all the boot output, except what we can get from dmesg _if_ the system boots, but it would be something.
Any other thoughts or ideas?
Thanks for reading!
Quoted 4 lines
Is there some other way to modify the baud rate of the console device from userspace once I figure out the right one? It would definitely be less than ideal since we'd lose all the boot output, except what we can get from dmesg _if_ the system boots, but it would be something.
stty 57600 < /dev/ttyS1
etc. The console baud rate and settings should behave exactly as any other serial port if set from user space.
Quoted 1 line
Any other thoughts or ideas?
If you don't mind doing some small private kernel tweaks then I guess you could set the default console baud rate based on the dmi strings which would hopefully differ between the blade types.
Alan