build-goo: link libudev with libply-splash-core instead of plymouthd
The libply-splash-core library provides functions for controlling the
input and output of the splash screen.
Recently it gained support for device enumeration from udev using the
libudev library. When that support was added, the linker and compiler
flags of the plymouthd binary were augmented, instead of the the
libply-splash-core library directly. That broke the build on some
systems.
This commit moves the linker and compiler flags to the correct place.
Ray Strode [Wed, 11 Dec 2013 17:53:38 +0000 (12:53 -0500)]
device-manager: protect against local console seat getting created more than once
We watch for udev events even after forcing fall back, so we need to
make sure we don't allocate two seats for the local console if we
fallback then get a late event.
Ray Strode [Tue, 10 Dec 2013 21:07:01 +0000 (16:07 -0500)]
main: reconsolidate loading and showing of splashes
Recently, loading a splash was separated from showing the
splash. This ends up breaking fall back to the text splash,
because we don't know if we need to fall back until after
the default splash fails to show.
Ray Strode [Tue, 10 Dec 2013 18:38:41 +0000 (13:38 -0500)]
device-manager: handle text fallback better
Right now, we'll wait indefinitely for graphics devices to show up
before showing the splash screen.
This means text splashes don't get shown, at all.
This commit changes the initial scan for graphics devices, to
include uninitialized ones. If there aren't any, then we fall
back. If there are some, we know an add event will be coming, so
we don't fall back. We still handle already initialized devices
right away.
Ray Strode [Wed, 11 Dec 2013 17:10:08 +0000 (12:10 -0500)]
systemd-units: ensure udevd is started before plymouthd
We need to make sure udevd is started before plymouthd since we
need to know that "queue is empty" means "coldplug complete" not
"coldplug hasn't started yet".
Ray Strode [Tue, 10 Dec 2013 06:29:30 +0000 (01:29 -0500)]
branch-merge: land udev support
A certain class of machines don't work in plymouth because
they draw the kernel console to /dev/dri/card1 instead of
/dev/dri/card2.
This branch fixes that, by adding support for querying udev
to determine the available drm devices.
As part of this effort, some clean up was performed:
1) a bunch of bit rotted tests were removed
2) large chunks of code were moved from main.c to helper
objects implemented in other files.
3) Other parts of main.c were moved around or refactored
so they were easier to read.
Based on work from Kevin Murphy <kemurphy.cmu@gmail.com>
Ray Strode [Mon, 9 Dec 2013 18:13:38 +0000 (13:13 -0500)]
device-manager: add support for udev device enumeration
At the moment, we hardcode /dev/dri/card0 for the DRM device.
This works well enough in the lion's share of cases, but there are cases
where it falls over. Namely, machines with multiple GPUs, such as
optimus hardware, sometimes end up with the kernel fb console going to
/dev/dri/card1.
Rather than trying /dev/dri/card0 then /dev/dri/card1 etc in succession,
this commit, instead, adds support for querying udev for the
information.
Ray Strode [Tue, 10 Dec 2013 02:13:13 +0000 (21:13 -0500)]
renderer: add way to get device_name that was passed to constructor
It's useful to be able to figure out which renderer a given renderer
is, by examining the device that is associated with it.
This commit adds and accessor function to return the device that
was passed to ply_renderer_new.
At the moment, it does not return the device name if NULL was passed
to the constructor and the device was figured out automatically. A
future commit may add that ability if it becomes necessary.
Ray Strode [Mon, 9 Dec 2013 19:28:42 +0000 (14:28 -0500)]
drm: support activating without terminal
If there are multiple DRM devices, only one
can really be reading from the terminal at a time.
We currently punt this issue by ignoring all but
the first drm device.
In preparation for supporting more than one DRM device,
we need to come up with a solution.
This commit changes the DRM renderer plugin to allow getting
a NULL terminal. In this way, we can assign the terminal to
one of the DRM cards, but still output to the others.
Note, we never pass NULL for a terminal yet, that comes later.
Ray Strode [Mon, 9 Dec 2013 02:09:15 +0000 (21:09 -0500)]
main: use new device manager class
Now that we have a class for managing our seats, let's use it.
This gets a lot of the nitty gritty logic out of main.c and
paves the way for us to do smartcard device management going
forward.
Ray Strode [Mon, 9 Dec 2013 02:03:46 +0000 (21:03 -0500)]
splash-core: add device manager class
There's quite a bit of logic for managing input and output in
main.c right now. That code is already a bit too complicated,
but will get even more complicated going forward if we want
to add udev support, etc.
In an effort to keep things from getting too unwieldly, this
commit breaks out a lot of the logic into a new
ply-device-manager class.
A subsequent commit will make main.c use the new class.
Ray Strode [Tue, 3 Dec 2013 03:37:30 +0000 (22:37 -0500)]
boot-splash: strip out old api
Now that main.c is attaching seat objects to the boot splash,
instead of the seat's individual components, we can drop the
apis that allow doing things piecewise.
Ray Strode [Fri, 29 Nov 2013 16:28:52 +0000 (11:28 -0500)]
boot-splash: add support for seat objects
ply_boot_splash_t currently gets notified about displays and keyboard
objects to pass along to the splash plugins.
Now that we have a ply_seat_t object that can encapsulate display
and keyboard objects, we should add support to ply_boot_splash_t for
using it.
This commit does that. For now, it does it without changing the plugin
interface (which is still in terms of displays and keyboards).
Note, this commit only adds support for seat objects to
ply_boot_splash_t. It doesn't actually change any of the calling code
to use that support. That will come in a subsequent commit.
Ray Strode [Thu, 5 Dec 2013 20:02:35 +0000 (15:02 -0500)]
main: get rid of start_boot_splash
start_boot_splash is a convenience function that's going to
get in the way in the future. It also has the annoying
"boolean argument" problem that load_theme had.
This commit gets rid of start_boot_splash entirely.
Ray Strode [Thu, 5 Dec 2013 19:39:50 +0000 (14:39 -0500)]
main: split start_boot_splash up into two functions
Right now start_boot_splash loads the theme, then
shows it.
It's going to be useful in the future to preload the
theme, so this commit breaks the two operations out
into two functions, load_theme and show_theme,
and makes start_boot_splash just call those two
functions.
Ray Strode [Tue, 3 Dec 2013 03:07:37 +0000 (22:07 -0500)]
boot-splash: set KD_TEXT from main instead of boot_splash object
Now that debugging keybindings are gone, ply-boot-splash is really
just a wrapper around splash plugins. As such, it doesn't really
make sense to be mucking with terminal objects from it.
This commit moves that mucking to main until I can find a better
destination for it.
Ray Strode [Sun, 1 Dec 2013 01:34:24 +0000 (20:34 -0500)]
terminal: add new get_name() method
The name is passed in at construct time, but it gets canonicalized.
This commit adds api to get the final name. The api is also useful,
since it prevents callers that need the mapping from having to maintain
it separately, which will be good for a future clean up.
Ray Strode [Wed, 27 Nov 2013 05:07:54 +0000 (00:07 -0500)]
main: drop parameters for check_for_consoles function
both the default tty and whether or not displays should be added
are available in the global state object (as state->default_tty
and state->is_shown respectively), so they don't need to be parameters.
The latter one was a boolean, so having it as a parameter was confusing
at the call sites.
Ray Strode [Tue, 22 Oct 2013 23:24:14 +0000 (19:24 -0400)]
two-step: add support for tiled background image
If there's a file named background-tile.png in the theme
then it will get used as the background behind the other
content in place of the background gradient.
Ray Strode [Tue, 15 Oct 2013 13:52:46 +0000 (09:52 -0400)]
scripts: make plymouth-update-initrd somewhat more useful
plymouth-update-initrd is a script that should probably be eventually
dropped. It was originally created to unpack and initrd and graft
plymouth in. Later, it just became a thin wrapper around mkinitrd.
These days, very few (any?) distros use mkinitrd. Change it to call
dracut instead.
Relevant irc log:
<newfo> this is SO WRONG:
http://cgit.freedesktop.org/plymouth/tree/scripts/plymouth-update-initrd
<newfo> it won't work on any distro
<newfo> would you mind updating that please?
<newfo> replace the mkinitrd line in
/usr/libexec/plymouth/plymouth-update-initrd to dracut -f
/boot/initramfs-$(uname -r).img $(uname -r)
<-- newfo has quit (Client Quit)
Ray Strode [Mon, 23 Sep 2013 19:21:30 +0000 (15:21 -0400)]
main: force tty to /dev/tty if $DISPLAY is set
the X11 renderer is useful for testing themes without rebooting,
but it really only functions if the user puts --tty=/dev/tty or
similar. Furthermore, if a user neglects to do that really bad
stuff happens since plymouth will try to take over VT1.
This commit makes --tty=/dev/tty implied if $DISPLAY is set.
Steve Langasek [Fri, 28 Jun 2013 22:53:40 +0000 (15:53 -0700)]
Miscellaneous fixes for compiler warnings
Fix various warnings turned up with -Wall. After fixing these remaining
issues, plymouth now builds successfully with gcc 4.8 using
"-Werror -Wno-error=unused-result -Wno-error=sign-compare".
Steve Langasek [Fri, 28 Jun 2013 17:52:59 +0000 (10:52 -0700)]
script: include head with prototype of ply_get_timestamp()
ply_get_timestamp() returns a double, but the compiler assumes it will
return an int if ply-utils.h isn't #included. This disparity between
what gets returned and what the compiler is expecting will be returned
causes astonishing knock-on effects (the label plugin fails to display
any text). See:
Jeff Mahoney [Mon, 15 Apr 2013 04:27:16 +0000 (01:27 -0300)]
plymouth: Add line numbers to tracing output
The plymouth tracing output lists the function but there are many
cases in which the same message is issued from multiple places in the same
function, which makes debugging more difficult. This patch adds the line
number to the output to uniquely identify each site.
Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Ray Strode [Wed, 13 Mar 2013 14:24:14 +0000 (10:24 -0400)]
systemd: add plymouth-start.service to initrd-switch-root.target
<haraldh> halfline, can you add plymouth-start.service to
plymouth-populate-initrd ??
<halfline> haraldh: sure, can you give me details on the bug its fixing?
<haraldh> except, if you put yourself out of the plymouth cgroup
<haraldh> and the "@" in argv[0][0]
<haraldh> better put plymouth-start.service in the
initrd-switch-root.target
<haraldh> easier
<halfline> well we already do the "@" in argv[0][0]
<halfline> and we already put KillMode=none SendSIGKILL=no in the
service file
<halfline> but will add the change
<haraldh> hmm, ok
Ray Strode [Tue, 12 Mar 2013 15:57:15 +0000 (11:57 -0400)]
animation,throbber: go back to frame dropping
Right now we figure out which animation frame to use
based on a static counter variable. Since it's static
instead of per-object, if there are multiple instances
it ends up counting up too fast.
We could:
1) make it per-object state
2) drop it and use the ifdef'd out alternative implementation
that potentially drops frames if the machine is sluggish
This commit chooses 2, but we may end up going to one if the
frame dropping turns out to be problematic.
Ray Strode [Tue, 11 Dec 2012 19:37:16 +0000 (14:37 -0500)]
utils: don't create pipes non-blocking
The daemonizing code depends on its pipe io being
blocking. The other user of ply_open_unidirectional_pipe
will work with blocking or non blocking io.
This commit changes ply_open_unidirectional_pipe to create
blocking pipes. This started causing failures with
commit 9ec69929 since it replaced broken code (passing
O_NONBLOCK to fcntl(fd, F_SETFD.. instead of F_SETFL)
with working code.
Will Woods [Thu, 29 Nov 2012 15:25:03 +0000 (10:25 -0500)]
populate-initrd: If PLYMOUTH_THEME_NAME is set, write it into plymouthd.conf
You can set PLYMOUTH_THEME_NAME when building initramfs to get a
different theme into initramfs, but this doesn't change the default
theme, so the resulting initramfs won't actually use the theme we
installed.
This patch makes plymouth-populate-initrd rewrite the 'Theme=XXX' line
in plymouthd.conf, so plymouth will use the theme we install.