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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Splashes aren't just shown for "boot" so including "boot" in
the name isn't right. Also, right now we link against libpng
even if we don't have any splash that uses it. This is the first
step toward making libpng only get linked to graphical splashes.
We'll need to move the graphical bits to their own library to
complete the process.
This merges the "man-page" branch to master.
Thanks to Adrian Glaubitz we now have a man page for plymouth.
This is a good start to documenting the basics of plymouth.
We'll eventually need more comprehensive reference documentation
before 1.0 is released, and now we have some of the ground work
(a docs/ directory) for that.
They weren't completely accurate, you don't need to reinstall
grub after editing its config, since it has built-in filesystem
drivers. Also, those details very from system to system, so we
should probably just leave it out.
We don't want to provide a history of what distributions
used before plymouth, because that history could get long,
isn't super relevant, and will add noise for a users looking
for help (they probably only care about their distributions,
not others).