You are not logged in.

#1 2006-03-29 06:50:17

sodface
Member
Registered: 2005-12-26
Posts: 38

Serial Startup Display Wonky

The output of the "stty size" command in /etc/rc.d/functions returns "0 0" when using a serial console,  resulting in a bad value for $STAT_COL and subsequently deltext().

This produces output like:

functions.old.jpg

Changing the code to something like:

STAT_COL=$(stty size)
STAT_COL=${STAT_COL##* }
        if [ "$STAT_COL" = "0" ]; then
                STAT_COL=80
        fi
STAT_COL=$[ $STAT_COL - 13 ]

Produces output like:

functions.new.jpg

Code modified from LFS bugfix.

Offline

#2 2006-03-31 12:39:18

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Serial Startup Display Wonky

What's a serial console?


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#3 2006-03-31 20:13:43

sodface
Member
Registered: 2005-12-26
Posts: 38

Offline

#4 2006-03-31 20:34:50

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Serial Startup Display Wonky

Post a bug report, sodface, including your fix. You can be sure the devs will see it that way.

Offline

#5 2006-03-31 22:24:55

sodface
Member
Registered: 2005-12-26
Posts: 38

Re: Serial Startup Display Wonky

tomk wrote:

Post a bug report, sodface, including your fix. You can be sure the devs will see it that way.

I actually already did, tomk, it's Bug 4316.

I wasn't sure whether I should or not so I post this thread first.  I didn't get a response after a day or so and then I pacman'd something that upgraded the /etc/functions file and my fix got overwritten so my display was messed up again - that's when I went ahead and did the bug report.

But thanks for the reaffirmation, I'm sure that frivolous bug reports drive the devs nuts  tongue

Offline

#6 2006-04-01 08:14:45

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Serial Startup Display Wonky

Frivolous, yeah - but this one isn't, AND it provides the fix. That's the best kind of bug report. smile

Offline

#7 2006-04-01 08:27:44

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Serial Startup Display Wonky

Holy hell, you actually use a real terminal?  That's awesome.

This fix could be better if you can determine how to detect wide terminals to, to flip the COLS from 80 to 132.

Offline

#8 2006-04-01 17:31:58

sodface
Member
Registered: 2005-12-26
Posts: 38

Re: Serial Startup Display Wonky

phrakture wrote:

Holy hell, you actually use a real terminal?  That's awesome.

I like being able to see everything from grub to login - I just wish my mobo would output to serial port also so I could see POST, BIOS etc.

This fix could be better if you can determine how to detect wide terminals to, to flip the COLS from 80 to 132.

I agree, it's not a very flexible fix.

Another thing about using a serial console with Arch is that the stock kernel config on at least one kernel version left out support for it.  The next version re-enabled it.

The current 2.6.15 Arch kernel works and I'm pretty sure these are the relavent entries from the .config:

CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_CS=m

The 2.6.16 kernel in testing doesn't work.  I get grub output, lose kernel output, and then get it back at login.

The current .config seems to be missing the CONFIG_SERIAL_8250_CONSOLE=y entry completely:

#
# Serial drivers
#
CONFIG_SERIAL_8250=m
CONFIG_SERIAL_8250_CS=m
# CONFIG_SERIAL_8250_ACPI is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

And modularizing 8250 support kind of hurts too doesn't it, as far as when the serial port becomes available for use?

Offline

#9 2006-04-01 17:45:20

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Serial Startup Display Wonky

You can load the module in initrd. If it's not there at all, either module or built-in, it's a feature request.

Offline

#10 2006-04-02 00:32:02

sodface
Member
Registered: 2005-12-26
Posts: 38

Re: Serial Startup Display Wonky

phrakture wrote:

This fix could be better if you can determine how to detect wide terminals to, to flip the COLS from 80 to 132.

Calling 'tset -Q' just prior to defining STAT_COLS results in the 'stty size' command returning a valid window size, so everything then works normally as written. Unfortunately, tset takes ~ 1 second to return and ends up being called 5 times on shutdown and 6 times on startup, obviously adding 5 and 6 seconds to each process respectively.

So I adjusted the suggested code a bit as seen below.  This should adjust for different size terminals?

STAT_COL=$(stty size)
STAT_COL=${STAT_COL##* }
        if [ "$STAT_COL" = "0" ]; then
                tset -Q
                STAT_COL=$(stty size)
                STAT_COL=${STAT_COL##* }
        fi
STAT_COL=$[ $STAT_COL - 13 ]

Offline

Board footer

Powered by FluxBB