Send plymouth mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freedesktop.org/mailman/listinfo/plymouth
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of plymouth digest..."
Today's Topics:
1. Keyboard input / init + questions (Jerome Martin)
2. Re: Keyboard input / init + questions (Jerome Martin)
3. Re: Keyboard input / init + questions (Ray Strode)
----------------------------------------------------------------------
Message: 1
Date: Sat, 25 Sep 2010 12:50:54 +0200
From: Jerome Martin <[email protected]>
Subject: Keyboard input / init + questions
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hello list,
I am using plymouth for a project of mine. Basically, using the script
modules, I have done a theme that among other things displays boot logs in a
pager, and also can display an help screen. When testing, everything works
fine. I can scroll up or down in my pager with the keys 'u' and 'd' and
toggle my help screen with the keypress 'h'.
However, during an actual boot sequence, it seems that my keyboard input
hook does not get any keypress anymore after init switches runlevels. I
tried various ways to debug this, but it really seems to happen in init
itself. Pausing at the begin and end of /etc/init.d/rc proves that
everything still works just before the script exits after rcS.d scripts have
been run, and are already gone sour before rc executes the rc2.d scripts.
I have tried disabling every getty in runlevel 2 from inittab, but this does
not help.
I am resorting to use only a single runlevel for my project (not a big deal,
it is an embedded OS with only a read-only live filesystem) in order to
circumvent this, but it would be nice if someone more used to plymouth code
could take a look at this. The problem is reproductible with debian squeeze
packages. If you need more details, please just ask.
I also have a couple of questions regarding plymouth features:
- Is there a way to check the keypress callback function argument for
non-string keys like arrows ? When trying to get their value, I always get
errors that seem to indicate the contents are not string, but I do not have
any other type/predefs values to check them against.
- Is there a way to call up an external binary from plymouth, like a
system() function ? If not, I guess this would not be much to add, I can do
it if you give me a proper pointer in your code (hints on the proper parse
token to use, etc.).
- I desperately miss a couple of possibilities regarding strings, like
determining a string length, and addressing strings as lists (a="foobar";
c=a[2]), thus making it possible to do strings transformations, iterate on
strings, etc. Did I miss something ? Would that be hard to implement ?
- Last, but related to the previous, I currently keep an index on lists I
create to knopw their length before iterating on them, but it would be nice
to have a mylist.Len() method.
Can any of the two previous points be done with a "list | []" method of
sorts ?
Best Regards,
--
J?r?me Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.freedesktop.org/archives/plymouth/attachments/20100925/f991a136/attachment-0001.html>
------------------------------
Message: 2
Date: Sat, 25 Sep 2010 13:52:39 +0200
From: Jerome Martin <[email protected]>
Subject: Re: Keyboard input / init + questions
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Just a quick note, setting the KBD handler again in the refresh hook does
not work either, although something along those lines miht be a solution if
setting the keyboard handler actually overrode the handler set in place by
init. Actually the single-runlevel workaround is not that trivial, because
even in single mode, init does reset the kbd handlers after rcS completes.
The only (ugly) solution for now is a neverending script at the end of rcS.d
:-(
On Sat, Sep 25, 2010 at 12:50 PM, Jerome Martin <[email protected]>wrote:
> Hello list,
>
> I am using plymouth for a project of mine. Basically, using the script
> modules, I have done a theme that among other things displays boot logs in a
> pager, and also can display an help screen. When testing, everything works
> fine. I can scroll up or down in my pager with the keys 'u' and 'd' and
> toggle my help screen with the keypress 'h'.
>
> However, during an actual boot sequence, it seems that my keyboard input
> hook does not get any keypress anymore after init switches runlevels. I
> tried various ways to debug this, but it really seems to happen in init
> itself. Pausing at the begin and end of /etc/init.d/rc proves that
> everything still works just before the script exits after rcS.d scripts have
> been run, and are already gone sour before rc executes the rc2.d scripts.
>
> I have tried disabling every getty in runlevel 2 from inittab, but this
> does not help.
> I am resorting to use only a single runlevel for my project (not a big
> deal, it is an embedded OS with only a read-only live filesystem) in order
> to circumvent this, but it would be nice if someone more used to plymouth
> code could take a look at this. The problem is reproductible with debian
> squeeze packages. If you need more details, please just ask.
>
> I also have a couple of questions regarding plymouth features:
>
> - Is there a way to check the keypress callback function argument for
> non-string keys like arrows ? When trying to get their value, I always get
> errors that seem to indicate the contents are not string, but I do not have
> any other type/predefs values to check them against.
> - Is there a way to call up an external binary from plymouth, like a
> system() function ? If not, I guess this would not be much to add, I can do
> it if you give me a proper pointer in your code (hints on the proper parse
> token to use, etc.).
> - I desperately miss a couple of possibilities regarding strings, like
> determining a string length, and addressing strings as lists (a="foobar";
> c=a[2]), thus making it possible to do strings transformations, iterate on
> strings, etc. Did I miss something ? Would that be hard to implement ?
> - Last, but related to the previous, I currently keep an index on lists I
> create to knopw their length before iterating on them, but it would be nice
> to have a mylist.Len() method.
>
> Can any of the two previous points be done with a "list | []" method of
> sorts ?
>
> Best Regards,
> --
> J?r?me Martin
>
--
J?r?me Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.freedesktop.org/archives/plymouth/attachments/20100925/765ac60b/attachment.htm>
------------------------------
Message: 3
Date: Sat, 25 Sep 2010 13:32:02 -0400
From: Ray Strode <[email protected]>
Subject: Re: Keyboard input / init + questions
To: Jerome Martin <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Hi,
On Sat, Sep 25, 2010 at 6:50 AM, Jerome Martin <[email protected]> wrote:
> I am using plymouth for a project of mine. Basically, using the script
> modules, I have done a theme that among other things displays boot logs in a
> pager, and also can display an help screen. When testing, everything works
> fine. I can scroll up or down in my pager with the keys 'u' and 'd' and
> toggle my help screen with the keypress 'h'.
Sounds interesting.
> However, during an actual boot sequence, it seems that my keyboard input
> hook does not get any keypress anymore after init switches runlevels.
Some init implementations forcefully steal the tty away from plymouth.
What version of plymouth are you using? There have been a few
workarounds added to the code to lock the tty so nothing can muck with
the attributes and reopen it if it ever gets stolen away. If you try
the latest snapshot in git does it work okay for you? I want to get a
0.8.4 release out soonish. It's a little overdue.
> tried various ways to debug this, but it really seems to happen in init
> itself.
Right, i've seen it in the past from a TIOCSCTTY ioctl in sysvinit,
for instance.
> - Is there a way to check the keypress callback function argument for
> non-string keys like arrows ? When trying to get their value, I always get
> errors that seem to indicate the contents are not string, but I do not have
> any other type/predefs values to check them against.
So an example of non-printable input are control keys. These keys are
the letter xored with \100
e.g. '\100' ^ 'G'
would be ctrl-g. Alternatively, if you run
man ascii
and trace your finger across the line for any given capital letter on
the right side of the screen, all the way to the left side of the
screen, you'll see the ascii number associated with the control
character associated with that letter (so ctrl-g is 0x7). Arrows are
a little different because they are a sequence of bytes, not just one
byte.
If you run the "cat' command at a terminal and then press the arrow
keys you'll see something like:
^[[A
^[[B
^[[C
^[[D
with the '^[" being a control character (the "escape" character
(ctrl-[ , i.e. '\100' ^ '[')) and the next two characters '[' and a
letter. This is called an escape sequence.
So if you want to read the arrow keys you need to start buffering the
input stream as soon as you see a ctrl-[ and latch from there. I
realize this is a little groaty. We should probably do this inside
the core of the plymouth daemon automatically under the hood and then
pass this to the plugins as actual ARROW events via a new callback or
something similar. Given that I've never tried to use arrow keys in
a plymouth plugin before, you may run into gotchas trying to do the
above. For instance, since the first character in any escape sequence
is "escape", the plymouth daemon will probably interpret that as the
user htting the escape key and toggle to "details mode" instead of
relaying the key to the plugin. Plymouth is implemented in a sort of
"needs based", organic way, and we've never needed support for arrow
keys before, so it hasn't been given a lot of thought. I can look
into making the experience better if you like. Give me a few days to
experiment, i'll know more after I've actually tried to get it work.
Hopefully, as we get closer to 1.0 we can get details like this (and
better documentation, etc) in better shape.
> - Is there a way to call up an external binary from plymouth, like a
> system() function ?
One thing to watch out for is plymouth is normally started within the
initrd, before the root filesystem (and its available programs) are
accessible. You shouldn't try to run anything until after the
on_root_mounted callback has been called.
> If not, I guess this would not be much to add, I can dorr
> it if you give me a proper pointer in your code (hints on the proper parse
> token to use, etc.).
> - I desperately miss a couple of possibilities regarding strings, like
> determining a string length, and addressing strings as lists (a="foobar";
> c=a[2]), thus making it possible to do strings transformations, iterate on
> strings, etc. Did I miss something ? Would that be hard to implement ?
> - Last, but related to the previous, I currently keep an index on lists I
> create to knopw their length before iterating on them, but it would be nice
> to have a mylist.Len() method.
> Can any of the two previous points be done with a "list | []" method of
> sorts ?
As far as questions about and tips for extending the feature set of
the script plugin go, I'll let Charlie chime in there. He wrote the
script plugin and knows its details a lot better than I do.
--Ray
------------------------------
_______________________________________________
plymouth mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/plymouth
End of plymouth Digest, Vol 23, Issue 3
***************************************