take over kernel baudrate for getty

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 12 13:08:21 UTC 2009


On Monday 06 April 2009 21:06, Guenter wrote:
> Hi Stuart,
> Stuart Hughes schrieb:
> > FWIW, I wrote a hack to busybox to do this a while ago, you can find it
> > here (it's part of LTIB):
> > http://www.bitshrine.org/gpp/busybox-1.11.2-getty-nobaud-1.patch
> thank you very much!! That's exactly what I was after; I did just test
> the patch, and can confirm that it works also great for my usage.
> Attached the slightly modified patch based on Mike's comments.

The patch is buggy.

parse_speeds is called from parse_args. parse_args is called before this:

        open_tty(options.tty);
        ndelay_off(0);
        debug("duping\n");
        xdup2(0, 1);
        xdup2(0, 2);

therefore parse_speeds uses wrong fd 1 here:

                if (op->speeds[op->numspeed] == 0) {
                        struct termios tio;
                        if (tcgetattr(1, &tio) != 0)
                                bb_error_msg_and_die("auto baudrate detection failed");
                        op->speeds[op->numspeed] = cfgetospeed(&tio);
                }

fd 1 is not open to tty we are interested in at this moment.


Please try attached alternative patch.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6.patch
Type: text/x-diff
Size: 2208 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090412/ac4dd0fe/attachment-0001.bin>


More information about the busybox mailing list