Keyboard input / init + questions

Jerome Martin jxm at risingtidesystems.com
Tue Sep 28 15:02:29 PDT 2010


On Tue, Sep 28, 2010 at 11:45 PM, Ray Strode <halfline at gmail.com> wrote:

> Hi,
>
> On Tue, Sep 28, 2010 at 5:23 PM, Jerome Martin
> <jxm at risingtidesystems.com> wrote:
> >> Can you post the output of
> >> sudo stty -a --file=/dev/tty1
> >
> > root at 000c29af1815:~# stty -a --file=/dev/tty1
> > speed 38400 baud; rows 30; columns 80; line = 0;
> > intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
> eol2 =
> > <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
> > rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
> > -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
> > -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon
> > -ixoff -iuclc -ixany -imaxbel iutf8
> > opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0
> vt0
> > ff0
> > isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop
> -echoprt
> > echoctl echoke
> Okay, so this is all wrong.  This is called "cooked" mode, and
> plymouth requires "raw" mode.
> (-icanon among other things).
>

When you speak of raw vs cooked, it takes me back to the 80's, writing some
asm to use int16h to setup the keyboard. That makes me nostalgic :-)


>
> plymouth explicitly locks the terminal with a TIOCGLCKTRMIOS ioctl
> call, so other programs can't change it.
> That means that either
>
> a) plymouth is setting the wrong mode before locking the terminal
> b) plymouth is failing to lock the terminal correctly
> c) something else is unlocking the terminal and then setting the wrong
> mode.
>

Any idea how I can help debug that ?


>
> At any rate, this is what's causing your problem.
>
> > And tty1 after exiting plymouth:
> > root at 000c29af1815:~# plymouth quit
> > root at 000c29af1815:~# stty -a --file=/dev/tty1
> > speed 38400 baud; rows 30; columns 80; line = 0;
> > intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
> eol2 =
> > <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
> > rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
> > -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
> > -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon
> > -ixoff -iuclc -ixany -imaxbel iutf8
> > opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0
> vt0
> > ff0
> > isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop
> -echoprt
> > echoctl echoke
> So that's exactly the same as before plymouth quit.  When plymouth
> quit's, it's supposed to restore the attributes to what it found them
> as when it was started.
>
> So either,
>
> 1) Those are the settings it found the tty in originally (which is
> plausible actually)
> 2) The tty is locked by something else so plymouth can't restore the
> settings it found the tty in
>

Find attached a screenshot taken with break=bottom.
One weird thing is that sh says "can't access tty; job control turned off",
but the tty devs do exist in /dev...
Hope it helps.


>
> > root at 000c29af1815:~# ls -l /proc/250/fd
> > total 0
> > lrwx------ 1 root root 64 2010-09-28 21:19 0 -> /dev/console (deleted)
> > lrwx------ 1 root root 64 2010-09-28 21:19 1 -> /dev/console (deleted)
> > lrwx------ 1 root root 64 2010-09-28 21:19 10 -> /dev/tty1
> > lrwx------ 1 root root 64 2010-09-28 21:19 2 -> /dev/console (deleted)
> > lrwx------ 1 root root 64 2010-09-28 21:19 3 -> anon_inode:[eventpoll]
> > lr-x------ 1 root root 64 2010-09-28 21:19 4 -> pipe:[1922]
> > l-wx------ 1 root root 64 2010-09-28 21:19 5 -> pipe:[1922]
> > lrwx------ 1 root root 64 2010-09-28 21:19 6 -> /dev/ptmx
> > lrwx------ 1 root root 64 2010-09-28 21:19 7 -> /dev/tty1
> > lrwx------ 1 root root 64 2010-09-28 21:19 8 -> socket:[1927]
> > lrwx------ 1 root root 64 2010-09-28 21:19 9 -> /dev/fb0
> So this confirms that the tty is definitely getting reopened okay.  The
>
> /dev/console (deleted)
>
> suggests that
>
>
> http://cgit.freedesktop.org/plymouth/commit/?id=5b4ed8f35a1e9358d94df4b84ad49cea790f57e9
>
> isn't working like it should be (but it shouldn't really affect your
> present issue)
>

ok.


>
> > Mmhh. This is really going to be difficult. See, I have a live distro
> with
> > some proprietary software in, a lot of customs packages, in a prototype
> > form, that is built with a complex sequence of Makefiles and scripts...
> > Mostly is ressembles a debian squeeze and a debian-live initramfs. Also,
> it
> > lacks many packages and typical binaries found on a normal distro, the
> user
> > will never see a shell on it, it is mostly remote-controlled by a cluster
> > admin CLI.
> Okay, well I probably just need a distro that uses sysvinit.  So i
> could go with stock debian,
> opensuse, or mandriva i guess.  Let's try to do more
> debugging-by-proxy first though.
>
> I'll reply again after I've looked over the code a bit closer.
>

You know, after that sh complaint during initrd, I wonder if something is
not broken in my initramfs. What exactly is needed for proper tty setup ? I
might have broken something (or pasted a bug from debian-live scripts).

Best,
-- 
Jérôme Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/plymouth/attachments/20100929/215eee84/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clnode1 @ 2010-09-28 23:58:17.png
Type: image/png
Size: 8692 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/plymouth/attachments/20100929/215eee84/attachment-0001.png>


More information about the plymouth mailing list