Commit graph

1339 commits

Author SHA1 Message Date
Scott James Remnant
48bba4f1cd [configure] allow boot and shutdown ttys to be changed
Allow distributions like Ubuntu to override the boot and shutdown
ttys from the configure script so they don't have to patch the
source.
2010-03-18 20:01:31 +00:00
Scott James Remnant
97b3d4d60d [main] add --tty command-line option
Add a command-line option to specify the TTY that plymouth should
use.  This is mostly useful for debugging, for example you can put
plymouth onto a TTY not used by the X server; or if you're feeling
particularly sneaky, plymouth into an xterm.
2010-03-18 20:01:31 +00:00
Scott James Remnant
faaa215e90 [terminal] guard open and close against repeated calls
Since we have a status flag whether or not the terminal fd is open,
use it in the open and close functions to guard against repeated
calls.
2010-03-18 20:01:31 +00:00
Scott James Remnant
b60eab0c4d [x11] default renderer to inactive
Change the renderer so that it defaults to inactive until we
map to the device.
2010-03-18 20:01:31 +00:00
Scott James Remnant
1165c4e16a [frame-buffer] default renderer to inactive
Change the renderer so that it defaults to inactive, then when we
map to the device, activate the renderer by activating the VT;
unless the VT is already active in which case activate the
renderer directly.
2010-03-18 20:01:31 +00:00
Scott James Remnant
5c011e00d3 [drm] default renderer to inactive
Change the renderer so that it defaults to inactive, then when we
map to the device, activate the renderer by activating the VT;
unless the VT is already active in which case activate the
renderer directly.
2010-03-18 20:01:31 +00:00
Scott James Remnant
96999a7321 [terminal,text,details] move activate vt into plugins
Move the responsiblity to activate the VT into the text and details
plugins; this not only matches the graphical renderers, but it also
ensures we activate the VT in all possible code paths.

Previously if we fell back to text.so because we couldn't activate
a renderer, this would not activate the VT.
2010-03-18 20:01:31 +00:00
Scott James Remnant
82494f6efd [x11] ignore terminal completely
The X11 renderer doesn't need a terminal at all, so we ignore it
completely.
2010-03-18 20:01:30 +00:00
Scott James Remnant
59eaa4db59 [frame-buffer] don't run on non-virtual terminals
We only need support DRM on virtual terminals, those that are not
such as serial consoles, can be trivially skipped.
2010-03-18 20:01:30 +00:00
Scott James Remnant
e54373efe4 [drm] don't run on non-virtual terminals
We only need support DRM on virtual terminals, those that are not
such as serial consoles, can be trivially skipped.
2010-03-18 20:01:30 +00:00
Scott James Remnant
a067e97f16 [terminal] move terminal opening into renderers/plugins
Move the responsibility to actually open the terminal to the renderers
and text/details plugin, this allows the X11 renderer to not actually
open the terminal - and thus not crash the X server.
2010-03-18 20:01:30 +00:00
Scott James Remnant
60402980bb [terminal] don't treat ttySx as VT
Only devices with TTY_MAJOR and minor from 0-63 are VTs, 64 onwards
are serial consoles.
2010-03-18 20:01:25 +00:00
Scott James Remnant
c7efc4f250 [terminal] drop next_active_vt
When we activate our VT, now we actually have it in VT_PROCESS not the
VT we started from, we get the proper signal so don't need an ioctl to
wait until its active.

If we were to leave our VT, we'd get the opposite signal as well and
we don't really care whether we actually get to the other VT, just
that we leave ours.

And this code was in the wrong place anyway.
2010-03-18 19:56:46 +00:00
Scott James Remnant
c51a141345 [terminal] don't keep track of active vt, just if vt is active
Trying to keep track of whatever VT is actually active is inherently
racy; instead just keep track of whether our VT is the active one.
Since we guarantee that's the VT in VT_PROCESS now, this is easy.

Rather simplifies the on_vt_changed functions in renderers too.
2010-03-18 19:56:46 +00:00
Scott James Remnant
4bbd0d9bc5 [terminal] drop support for opening the foreground terminal
This isn't used anywhere in plymouth, we should always open a named
terminal to avoid surprises due to VT switches we're not watching
for.
2010-03-18 19:56:46 +00:00
Scott James Remnant
e3f5a8bacd [terminal] only support vt-like operations on VTs
Now we can simply test whether a terminal is virtual or not, add
a guard in the mode and vt change functions that ensure they only
operate on virtual terminals.
2010-03-18 19:56:46 +00:00
Scott James Remnant
4febe5f355 [terminal] add ply_terminal_is_vt() function
We want to be able to query whether a terminal is an ordinary terminal
or a virtual terminal, rather than looking up the vt number and knowing
what the right numbers are, add a function that knows that.
2010-03-18 19:56:46 +00:00
Scott James Remnant
564220da0b [terminal] replace set_active_vt with activate_vt
Since a terminal already knows which VT number it is, there's no
need to accept a VT number for switching to this VT.
2010-03-18 19:56:46 +00:00
Scott James Remnant
7241b9af26 [console] remove console files
Now that everything's switched over to using ply_terminal_t, we
can remove the console files.
2010-03-18 19:56:46 +00:00
Scott James Remnant
b753e7423e [terminal] remove references to ply_console_t
Remove all of the references to ply_console_t from the code, now
we operate exclusively on the terminal object.  In some places
this means switching from one to the other, but in many it just
means dropping the console object and using the terminal object
we were already passed.
2010-03-18 19:56:46 +00:00
Scott James Remnant
d954b7c02a [terminal] merge console and terminal code
This removes the separation in code of "console" functions and
"terminal" functions; this never really made sense, and doesn't
particularly map to the behaviour of Linux virtual terminals.

The three principle operations that Plymouth was using "console"
for were:

 * changing the active VT
 * notification of changes to the active VT through VT_PROCESS
 * switching between text and graphics mode

And it was using the "foreground terminal" alias /dev/tty0 to do
this.  While this is fine for the first of those, since any console
device will do, it's always wrong for the latter two which should
always be on the actual VT we want Plymouth to run from.

If running on tty7, only tty7 should be in VT_PROCESS mode (since
we want to know when we enter this VT and leave this VT), and
certainly only tty7 should be in graphics mode.

Since you can use that same tty to obtain the current active VT,
and switch VT, you don't need another; so the need for a separate
"console" functionality goes away.
2010-03-18 19:56:45 +00:00
Scott James Remnant
56cccfc47f [main] unset keyboard if splash fails to show
Since script implements a set_keyboard function (the only plugin to
do so), the previous commit reveals a bug where set_keyboard is
called for the plugin but unset_keyboard isn't called if the plugin
fails to be loaded
2010-03-18 19:50:44 +00:00
Scott James Remnant
5e97b4ad2c [script] check that there are pixel displays
The script plugin only works on pixel displays, however there wasn't
any check for this, so if a script-based theme was your default
Plymouth would not fallback to using the text plugin instead.
2010-03-18 19:50:40 +00:00
Ray Strode
ea394383c5 [terminal] change fallback terminal settings
I think when I originally added the fallback case, I looked at the
tcgetattr man page, saw cfmakeraw()'s settings and just inverted them.

That's obviously wrong.  These settings should hopefully make a little
more sense.
2010-03-17 15:36:43 -04:00
Adrian Glaubitz
038d755e98 Spelling fix for manpage. 2010-03-11 13:38:18 -05:00
Richard Maw
9b3a1b672b [script] Add SubString function to the script string library
Adds the SubString function which returns a string segment. The two paramiters
are the sub-string start and end indicies. Negative start and end values return
a NULL, as does start index being beyond the end index. Start being beyond the
end of the string returns an empty string.
2010-03-10 20:28:09 +00:00
Ray Strode
bb96d5ad12 [drm] reconnect input source on disconnect
This is like 6f8d51c2cb2f46eac4c2040f5fc8512f65c8d2da
but for the drm renderer.
2010-03-05 13:54:36 -05:00
Ray Strode
a0de30c79e [frame-buffer] reconnect input source on disconnect
This is like 1425549885
but for the frame buffer renderer.
2010-03-05 13:53:21 -05:00
Scott James Remnant
17848a111a Merge branch 'scriptftbfs' 2010-03-02 20:41:02 +00:00
Scott James Remnant
c99db3f7a9 Merge branch 'scriptdirs' 2010-03-02 20:40:54 +00:00
Scott James Remnant
b29d3de6ae [main] replace tabs with spaces
Missed these in the clean-up pass.
2010-03-02 20:13:12 +00:00
Scott James Remnant
d35a13c44b [script] drop unused on_draw() function
The on_draw() function inside the script plugin isn't referenced
anywhere, but references a static function from script-lib-sprite.c;
if building without optimisation, it's possible that gcc won't elide
this code so will fail during linking.
2010-03-02 20:09:04 +00:00
Scott James Remnant
df26cfe6ed [scripts] Don't hardcode LIBEXECDIR and DATADIR paths
The scripts hard-coded the paths for LIBEXECDIR and DATADIR, unless
passed as environment variables.  Instead of doing this, which breaks
if plymouth is installed outside of /usr, set these derived from the
configure $libexecdir and $datadir variables just as we do for
pkg-config, etc.

Since we use so many variables, it makes more sense to generate these
scripts from config.status rather than having special Makefile rules
for them.
2010-03-02 20:08:22 +00:00
Scott James Remnant
03e58b3b43 [main] Write the pid of plymouthd to a file
Add a --pid-file option to plymouthd that will cause the daemon's
pid to be written to the named file.  Useful to avoid grovelling
through ps output to find it again.
2010-03-02 19:52:25 +00:00
Scott James Remnant
9795c9b561 [client] Install libply-boot-client library and headers
When communicating with Plymouth from another process, it's
inconvenient to have to keep spawning the plymouth client binary
and keeping track of it - not to mention slow.

It's far cleaner to be able to link to the same boot client code
that the plymouth binary does, and communicate directly.

Place that code in a new libply-boot-client library, and install
the headers along with it.
2010-03-02 15:16:33 +00:00
Ray Strode
1425549885 [keyboard] Handle tty hangup better
We currently reconnect the terminal object on tty disconnects,
but we don't rewatch the keyboard. A disconnect will invalidate
the fd watch, so we need to handle it to prevent crashes.
2010-02-25 15:37:43 -05:00
Ray Strode
e9cc26f5d5 [server] Add debugging statements 2010-02-15 15:39:39 -05:00
Ray Strode
3993504788 [libply-splash-core] Install to / instead of /usr
Since plymouthd links against this library, we should
probably move it to /lib if plymouthd is installed in
/sbin
2010-01-27 09:43:04 -05:00
Ray Strode
8ccb7f1754 [main] Defer password requests to client if daemon unavailable
There are times when plymouthd isn't in a position to ask for
the password (for instance, if the initramfs is about to run
init=/bin/bash or something).  In those cases, any password
requests need to be handled by the client.
2010-01-26 01:20:00 -05:00
Ray Strode
f57fc3dcc5 [main] Send CTRL-C instead of NULL for password cancel
We'll want to use NULL for "daemon can't ask"
2010-01-26 01:20:00 -05:00
Ray Strode
001a4b823c [client] add debugging statements 2010-01-26 01:20:00 -05:00
Ray Strode
33b761ebe0 [client] Run ask-for-password command unconditionally
Even if we can't contact the daemon, we should still run the
ask-for-password command.  This is because the command may
do things important for boot up to continue like unlocking
the root partition.
2010-01-26 01:20:00 -05:00
Ray Strode
6a9c534195 [client] Don't exit right away if daemon unavailable
We're going to want to be able to carry on in some cases
even if the daemon isn't there.
2010-01-26 01:20:00 -05:00
Ray Strode
e9c7b34fba [client] debug mode if plymouth:debug in /proc/cmdline
We currently do this for the daemon.  We should do it for
the client as well.
2010-01-26 01:19:59 -05:00
Charlie Brej
8066ee53ad [script] Add get functions for all sprite properties
Adds GetImage/X/Y/Z/Opacity to get the current values of the sprites.
This is for convenience of not having to store them in the script.
2010-01-25 23:10:24 +00:00
Charlie Brej
437be1c6db [script] Use floor when implementing Int
Previously the Math.Int function converted to int and back to double.
The floor function works larger than those represented by integers and it
correctly handles NaN and Inf.
2010-01-25 20:36:35 +00:00
Charlie Brej
bef862fa92 [script] Add a random number generator
Adds Math.Random() which returns a random number between 0 and 1.
2010-01-25 20:31:17 +00:00
Ray Strode
d34694c1b9 [daemon] drop libply-splash-graphics dependency 2010-01-14 17:26:26 -05:00
Ray Strode
306af2b933 [branch-merge] Drop libpng requirements from base install
Right now, plymouthd links against libplybootsplash which links
against libpng.  Only graphical splashes use libpng, but it's
always pulled in.

This merge splits libplybootsplash into two libraries: the core
bits, and the extractable graphical bits.  Only the graphical splashes
link against the latter library.  This way server installations can
get plymouth without pulling in libpng.  This will reduce the amount
of security errata deployed to those server installations.
2010-01-14 17:05:15 -05:00
Ray Strode
4f02890e05 [splash] Split out graphical parts of libply-splash-core
We now have a libply-splash-graphics for handling the
graphical bits.  In particular, this means plymouthd no
longer links against libpng.
2010-01-13 16:52:17 -05:00