Colin Watson [Tue, 7 Sep 2010 14:18:52 +0000 (15:18 +0100)]
main: Open /proc/cmdline by absolute path
Open /proc/cmdline, not proc/cmdline. (Technically this doesn't matter
in the daemon, since it's already done chdir ("/"), but the client does
need this and it's clearer to have them match.)
[script] Add font selection argument to text to image capability
Enables scripts to choose the font they want with a sixth argument to
Image.Text API:
new_image = Image.Text("Hello", 1, 1, 1, 1, "DejaVu Bold,Italic 18");
Ray Strode [Sun, 22 Aug 2010 21:13:45 +0000 (17:13 -0400)]
[drm] Add preliminary support for libkms
This commit adds most of the pieces in place to use libkms, a
library by Jakob Bornecrantz, that abstracts the drm drivers
behind a common api.
Right now, we only fallback to libkms if the existing
backends won't work for the configured hardware.
In theory, this will give us pretty boot in virtual
machines, since libkms has support for the vmwgfx drm driver.
Aside from vmwgfx, libkms also supports intel and nouveau right
now. When it supports radeon, too, I'll probably switch to
using libkms by default instead of as a fallback. Eventually,
I'd like to drop all the non-libkms backend bits and the whole
driver vtable abstraction thing from plymouth completely.
This commit is just a copy-and-paste of one of the existing
drm backend files, with changes made to accomodate the libkms
api. I haven't actually tested it, yet, so it will probably
need changes after I get a chance to do that.
Ray Strode [Sat, 21 Aug 2010 02:07:26 +0000 (22:07 -0400)]
[drm] free stored connector
For most connectors associating monitors with our virtual
'heads', we merely track their ids. This means we don't have
to bother freeing any client side state at deallocation time.
There's one exception, though. The main connector, connector0,
we keep an open reference to. We do this, because it owns the
mode object we use in SetCrtc calls.
This commit ensures that connector0 for each head is properly freed
when that head is deallocated.
Ray Strode [Thu, 19 Aug 2010 18:22:48 +0000 (14:22 -0400)]
[drm] Allow multiple monitors to share one controller
Some underpowered video cards will have multiple connectors
tied to one controller. In this case all connectors get
the same "cloned" output automatically.
This commit detects this situation and prevents plymouth from
wastefully trying to allocate several frame buffers. This
commit also prevents plymouth from constantly trying to switch
between those allocated frame buffers every frame of the animation.
Ray Strode [Wed, 18 Aug 2010 20:07:08 +0000 (16:07 -0400)]
[drm] Store color depth in buffers
We only really support full color layouts at the moment
for kernel modesetting drivers, but this commit adds a
"color_depth" member to the buffer structs so we can at
least recognize non-conforming buffers.
Ray Strode [Tue, 3 Aug 2010 22:29:48 +0000 (18:29 -0400)]
[main] Ignore duplicate serial consoles on kernel command line
Right now if a user erroneously puts, e.g., console=ttyS0 twice
on their kernel command line, plymouth will open that tty twice
and write to it twice, and read from it twice, etc.
Ray Strode [Tue, 27 Jul 2010 22:30:13 +0000 (18:30 -0400)]
[boot-splash] Add built-in plugin
There are times when plymouth is running that the filesystem isn't
accessible. For instance, if a user has /usr as a separate partition,
then when first leaving the initrd, plymouth won't have access to its
plugins.
In those cases we really need to survive if the user hits escape.
This commit compiles details into the binary. In this way, if the
plugins aren't available, we still have something to fall back to.
Ray Strode [Wed, 21 Jul 2010 04:21:16 +0000 (00:21 -0400)]
[main] Don't watch for keyboard input if no keyboard
In the event should_ignore_show_splash_calls () returns
true, we won't ever have a keyboard set. This commit
make sure that we don't try to use the keyboard if its
unavailable.
Ray Strode [Wed, 21 Jul 2010 03:02:54 +0000 (23:02 -0400)]
[main] Try to be smarter about init=/foo on kernel command line
Right now, we put plymouth into a sort of degraded mode when we
find init=/anything on the kernel command line. This is so if
the user does init=/bin/sh to get fix their system, we don't
get in the way.
This breaks plymouth for things like init=/sbin/bootchartd and even
init=/sbin/init. We've previously had a plymouth.override-splash
kernel command line option to force plymouth on in those cases.
This commit flips things around a bit. Now init=/sbin/bootchartd
will work by default and there's a new option
plymouth.ignore-show-splash which forces things back into degraded
mode. We also will implicitly do the degraded mode for e.g.
init=/foo/barsh
Ray Strode [Wed, 21 Jul 2010 02:45:21 +0000 (22:45 -0400)]
[main] Use plymouth.arg instead of plymouth:arg for kernel cmdline
Plymouth has historically used "plymouth:" to identify arguments destined
for it on the kernel command line. Most other things seem to the period
instead of colon, so this commit just makes plymouth conform.
Ray Strode [Tue, 13 Jul 2010 21:33:39 +0000 (17:33 -0400)]
[populate-initrd] don't croak when encountering broken symlink
Because of an apparent think-o in the script, if a custom theme
has a broken symlink in it, plymouth-populate-initrd would silently
stop processing files and ship an incomplete set of data files.
This commit changes "break" to "continue" so that broken symlinks
are ignored, which was probably the original intent.
Bruce Jerrick [Tue, 6 Jul 2010 15:13:38 +0000 (11:13 -0400)]
[set-default-theme] Properly quote arguments to basename
It's important to make sure the theme name is properly
quoted when passed to the basename command. This
is because, if the theme name is empty we want the empty
string returned, not the suffix that would otherwise be
stripped off.
Some discussion here:
https://bugzilla.redhat.com/show_bug.cgi?id=606634
Ray Strode [Thu, 1 Jul 2010 01:55:59 +0000 (21:55 -0400)]
[details] detach from event loop when quitting
If the user has the details plugin configured, and the
system does plymouth quit --retain-splash, then their
may be a crash.
This is because the plugin event loop exit handler will called
after the plugin is destroyed. This commit makes sure
the exit handler is removed before the plugin is freed.
Ray Strode [Thu, 1 Jul 2010 00:32:53 +0000 (20:32 -0400)]
[main] try more aggressively to find a terminal
Before we defaulted to tty1, but some systems just
don't have tty1. Normally, those systems specify
an alternate console on the kernel command line,
but not always.
This commit tries to make things work in those cases
as well.
I'd like to find a more generic way to make this all
work.
Tero Mononen [Tue, 15 Jun 2010 14:15:51 +0000 (10:15 -0400)]
[event-loop] Handle more than 8 events at once
epoll_wait was getting passed a pointer to 64 events,
but was only being told to use up to 8 of those events
at a time because it was using sizeof (pointer) for the
argument specifying the number of events instead of the
actual number of events.
Ray Strode [Mon, 14 Jun 2010 03:16:48 +0000 (23:16 -0400)]
[drm] Try to maintain current mode when overridden
plymouth has naïvely been treating the first available mode in
the connector object as the active mode. While this is true
most of the time, it doesn't hold true if the user overrides the
mode on the kernel command line.
This commit changes things to look up the actual active mode, and go
with that, which should help prevent flicker at start up in some cases.
This patch is based heavily on a patch from Forest Bond
<forest@alittletooquiet.net> here:
Ray Strode [Mon, 14 Jun 2010 02:18:35 +0000 (22:18 -0400)]
[drm] Store mode of each head as index
Previously, we would store the mode of each head as pointer in
the array of modes on the connector object. Now we just store
the index into that array.
This is to make it clearer that we don't own the memory
associated with it directly, and that the memory associated with
it is automatically cleaned up when the connector is.
This also helps to highlight a problem mentioned by
Forest Bond <forest@alittletooquiet.net> here:
Namely, we've been naïvely treating the first available mode in
the connector object as the active mode. While this is true
most of the time, it doesn't hold true if the user overrides the
mode on the kernel command line.
Charlie Brej [Thu, 3 Jun 2010 14:45:36 +0000 (15:45 +0100)]
[client] Add ignore-keystroke command
Adds an ignore-keystroke command. This does the same thing as the
ignore-keystroke option, but is migrated to a command. The option still exists
for compatibility.
Ray Strode [Wed, 2 Jun 2010 22:28:02 +0000 (18:28 -0400)]
[keyboard] Don't blow an assertion if terminal is unavailable
Right now, we always assume the tty can be reopened when it
gets disconnected. This isn't always true. While plymouth
clearly won't function 100% properly without a tty, we shouldn't
blow an assertion.
Ray Strode [Wed, 26 May 2010 17:10:46 +0000 (13:10 -0400)]
[main] Be more forgiving of an absent boot splash
Mandriva has cases where they need to drop to details mode
before /usr is mounted. /usr has the details splash plugin,
so this causes plymouth to explicitly exit.
This commit makes plymouth cope with that scenario slightly
better. It takes out the exit(1) call which was clearly bogus,
and also makes parts of the code handle a NULL splash better.
This is not a real fix though.
Ultimately, we should make "details" be built-in as a nice failsafe.
There's no reason we should need to load it off the disk as a plugin.
Ray Strode [Thu, 6 May 2010 17:04:14 +0000 (13:04 -0400)]
[two-step] Add optional header and throbber
These are just a few more bits for themes to optionally
make use of. The throbber gets overlaid with the
progress animation, so they need to be concentric.
The header gets put on top.
Ray Strode [Thu, 6 May 2010 14:04:26 +0000 (10:04 -0400)]
[throbber] Change frame sequencer function
The throbber has a function for determining which frame
to show based on the current time. This function was:
ƒrame(t) = number_of_frames ∙ (⅟₂ sin(t) + ⅟₂)
Which basically oscillates between 0 and number_of_frames - 1,
over and over again. There are two problems with this function;
- after it runs through all the frames in order, it then procedes
to run through them backward.
- This function also starts in the middle of the set of throbber
frames.
These problems don't matter for spinfinity, but will look wrong for most
other themes.
The new function is this:
ƒrame(t) = number_of_frames ∙ (1⁄duration)(t mod duration)
This function solves both problems. At time 0 it uses frame 0, and
after the last frame it jumps back to the first frame.
Colin Watson [Wed, 28 Apr 2010 12:31:39 +0000 (13:31 +0100)]
Handle NULL boot_buffer
boot_buffer may be NULL if plymouthd failed to attach to the console
session (e.g. if booting without an initramfs so /dev/pts isn't mounted
yet). Handle this gracefully rather than segfaulting.
Ray Strode [Thu, 29 Apr 2010 17:23:18 +0000 (13:23 -0400)]
[terminal] wait for vt switching to finish on quit
After changing the active vt during start up,
we get a signal when it finishes, because we're in
VT_PROCESS mode, so we don't need to explicitly block
waiting for it to finish.
During the quit path, though, we aren't in VT_PROCESS mode anymore,
won't get any signals, and still need to know that the VT switch
is finished before informing the client that the quit is
finished.
This commit forces ply_terminal_deactivate_vt to block until the
VT switch it initiates finishes.
Steve Langasek [Tue, 20 Apr 2010 11:02:24 +0000 (12:02 +0100)]
[main] Create a list of messages and when showing splash display them
The system now keeps a list of messages so they can be shown again when the
user flips themes or if the messages were passed before the splash was shown.
This also enables the splashes to show multiple messages (should they choose to
do so). There will later be a way of undisplaying a message.