[PATCH] Fix for getty console stair stepping

Antti Seppälä ajhseppa at niksula.hut.fi
Thu Aug 24 16:04:57 UTC 2006


Rob Landley wrote:
> On Wednesday 23 August 2006 11:40 am, Antti Seppälä wrote:
>> Hello.
>>
>> Current busybox getty sets all termios modes to zero in function
>> termio_init.
> 
> Isn't it supposed to?  (Susv3 hasn't got getty.)
> 
>> This has the effect of treating newlines as plain newlines instead of NL
>> + CR which causes console output to be stair-stepped while getty is
>> waiting for login.
>>
>> If I boot my busybox and use another login (via ssh for example) and do:
>>
>> ~ # echo step > /dev/console
>> ~ # echo step > /dev/console
>> ~ # echo step > /dev/console
>> ~ # echo step > /dev/console
>> ~ # echo step > /dev/console
>> ~ #
>>
>>
>> I get on the console:
>>
>> busybox login: step
>>                    step
>>                        step
>>                            step
>>                                step
> 
> I fired up ubuntu and did "echo blah > /dev/tty1" from tty2, and got a similar 
> stair-step.  This seems to be reasonably expectable behavior.
>  
>> The included patch fixes this by leaving OPOST and ONLCR alone when
>> clearing c_oflag in termio_init.
>>
>> What do you think, is this the right approach to fixing this?
> 
> Copying the same big assignment line into both the if and the else cases is 
> unnecessary bloat, and if ONCLR was set but OPOST was off, this will set 
> OPOST.
> 
> What actual problem are you trying to solve?
> 
> Rob


Well I'll be darned.
I used mingetty when I tried the stair-steps and it worked like I
expected (no stairs when doing the echo) so I assumed that this feature
exists only in Busybox getty. Apparently I was wrong.

Anyway, the problem I am having is that if I want to launch a program
when Busybox starts (e.g. from inittab with respawn -directive) and the
application prints some startup or debug messages, they all will be
stair-stepped after getty displays its login prompt.

This is especially annoying if the application in question takes a
little while to start (then getty has time to display its prompt and
enable the "stair-stepping mode" before the app does its printing). If
the application prints more than just a few lines of messages the output
starts to look ugly and becomes very difficult to read.

Here are two lines to /etc/inittab which can be used to demonstrate the
problem:

tty1::respawn:/sbin/getty 38400 tty1
console::respawn:/bin/ping 127.0.0.1


The application I am having most problems with is vdr, but I could
imagine that this bothers other applications too.

I couldn't find a way of definitely fixing this without patching getty.
If there is one, please let me know. :)

-- 
Antti Seppälä



More information about the busybox mailing list