Ray Strode [Wed, 6 Jun 2012 17:35:18 +0000 (13:35 -0400)]
two-step: set is_idle=TRUE at shutdown time
Right now, we do the end animation immediately if in
shutdown mode. This is because shutdown is fast,
and we don't try to estimate how long it will take.
The code depends on is_idle being true after the end
animation is run, but we neglect to do that in the
shutdown case.
This commit makes shutdown mode just call
"become_idle" right away, and deletes the duplicated
shutdown code path.
Ray Strode [Wed, 6 Jun 2012 15:55:35 +0000 (11:55 -0400)]
drm: flush pending draw to kernel buffer on vt switch
When plymouth's VT is not the foreground VT, we tell the
kernel not to scan out from the kernel buffer we manage.
Also, we don't bother dispatching rendering to the kernel
buffer (since it's not getting scanned out anyway).
When plymouth's VT becomes the foreground VT, we tell the
kernel to start scanning out from our buffer again.
Unfortunately, we neglect to flush all the pending drawing
that happens while VT switched away.
This means we briefly show stale contents.
This commit flushes all pending rendering to the kernel,
before resetting the scan out buffer, so we get a current
view of the splash shown immediately.
Kevin Murphy [Tue, 8 May 2012 09:02:08 +0000 (05:02 -0400)]
drm: for minimum buffer size to be greater than 0
The drm driver tells us the minimum dimensions it supports
for buffer objects. We use this minimum for creating a
small temporary 32-bit buffer to test if 32-bit buffers
are supported.
Unfortunately, some drivers neglect to fill in
min_width/min_height and then we try to allocate a buffer
with 0 sized dimensions.
This commit checks for min_width/min_height being 0, and then
bumps them to 1.
This commit starts to document plymouth to help
new contributors get into the code.
The aim of the document is to provide useful information,
such as the overall architecture, the most
important data structures, and howto recipes for
typical user cases, like debugging.
The document is explicitly not meant to be detailed API documentation.
In the future, that type of documentation may be provided with gtk-doc
style annotations.
The documentation is written in asciidoc
(http://www.methods.co.nz/asciidoc/) and is therefore easily readable as
its ascii text and can also be translated into more rich formats
(like HTML).
For example, to get an HTML version of the document:
yum install asciidoc (or equivalent for your distribution)
cd docs
make development.html
two-step: quit properly when boot finishes while waiting for password
When the computer is progressing through its boot up process, plymouth
calls into the splash plugin's on_boot_progress function at regular
intervals with increasing values for "percent_done". At some point, it
gets to 90% done, and that's when two-step begins its finishing
animation sequence. As soon as this sequence finishes, two-step pulls
its stop trigger, which
1) sets its "is_idle" flag to true and
2) pulls the core plymouthd code's idle trigger, to notify that
code that it's at a good animation frame to quit (if the core
plymouthd code has an idle trigger set up)
During the boot process, the user may need to enter a password
(the "plymouth ask-for-password" command). When that happens,
the splash waits for the user to enter a password, but boot progresses
in the background.
If the user then enters a password, the boot animation restarts again
(from the display_normal function). This restarting of the boot
animation will cause the "is_idle" flag of the splash to get set back
to false.
Later when plymouthd wants to quit, it calls the become_idle function
of the splash plugin. That function notices "is_idle" is false, and
the stop_trigger is not NULL. The function isn't suited to work
with this combination, and so at this point the splash never
tells the code daemon code it's idle.
This commit changes on_boot_progress to return before looking at
percent_done, if the user is getting asked a question. This way
the stop_trigger won't get created prematurely, and is_idle won't
get out of sync.
Dave Airlie [Thu, 26 Apr 2012 19:00:00 +0000 (20:00 +0100)]
drm: add generic driver to drm renderer plugin
Since around 2.6.39, the kernel has offered a generic ioctl interface
for modesetting (the KMS 'dumb' interface). This interface is now
provided by most all of the modesetting drivers.
Adding support for this interface means that plymouth will automatically
gain support for new modesetting drivers going forward.
This commit adds that support. Some changes made by Ray Strode.
A ply_label can now be alignment with ply_label_set_alignment()
taking one of PLY_LABEL_ALIGN_LEFT, PLY_LABEL_ALIGN_CENTER, or
PLY_LABEL_ALIGN_RIGHT.
This alignment is made within a horizontal box which width can be set with
ply_label_set_width().
Both functions are now used by the plugin "two-step" to make sure, that
the prompt for "ask-for-password" gets centered on the screen. Previously
the prompt started in the middle of the screen and was cropped at the right
border of the screen (fixes bz #681513). This lead to unreadable prompts
for disk encryption.
Ray Strode [Tue, 1 May 2012 16:42:33 +0000 (12:42 -0400)]
drm: use queried minimum size, not 1x1 for dummy buffer
The previous commit tries to create a 32bpp 1x1 dummy buffer
to know whether or not the modesetting driver can handle
our needs. It's concievable (though not realized in practice) that
the driver could support our needs fine, but not support buffers
as small as 1x1.
This commit uses the queried minimum buffer dimensions for the dummy
buffer instead of assuming 1x1.
Ray Strode [Tue, 1 May 2012 16:24:11 +0000 (12:24 -0400)]
drm: ensure modesetting driver supports 32bpp fb
Now that more and more hardware is getting kms support,
we need to be more careful about what hardware we try to
run on. Cirrus cards can't make 32bpp framebuffers, which
is all we support in the drm renderer.
This commit tries to create a small buffer up front, just
to see if the driver will allow it. If the driver chokes,
then we bail and fall back to the /dev/fb renderer, which
is more tolerant of aging hardware.
Kevin Murphy [Thu, 26 Apr 2012 14:39:36 +0000 (10:39 -0400)]
main: fix bug in add_consoles_from_file
commit 6baab7a8f889f6b48cb559fd5a62750203f62c3b was the
result of Ray Strode splitting part of a larger patch
out. The splitting and subsequent modifications weren't
completely right.
This commit contains some fixes to address the problems
with those changes.
Ray Strode [Wed, 25 Apr 2012 22:22:00 +0000 (18:22 -0400)]
main: add plymouth.ignore-serial-consoles
This commit adds plymouth.ignore-serial-consoles kernel command
line for OLPC to use.
Eventually, we'll support multiple plugins at once, and we can
run details on the serial console and e.g. two-step on the main
console and then this argument won't be needed.
Ray Strode [Wed, 25 Apr 2012 22:01:45 +0000 (18:01 -0400)]
main: add default console for default scenarios
commit e810532e5d2387e121bbded67c1b4cccc01dda4c contained
a function called add_consoles_from_file that was a badly
modified version of add_consoles_from_kernel_command_line
changed to read from /sys/class/tty/console/active instead
of /proc/cmdline.
Previously, if we had console=SOMETHING on the kernel command
line, then we would assume the user is using serial consoles
and force details. This translated to if add_consoles_from_file
finds any devices in /sys/class/tty/console/active force details.
Of course, /sys/class/tty/console/active contains tty0 even when
the user doesn't specify console=tty0 on the kernel command line,
so this broke show-splash calls.
This commit changes the logic bit. We now only force details if
there is some console in the list that isn't tty0.
James Hunt [Mon, 23 Apr 2012 08:14:40 +0000 (09:14 +0100)]
event-loop: hold reference to ready sources while handling timeouts
If ply_event_loop_handle_timeouts() is called before the events returned
by epoll_wait() are given references, a timeout handler can prematurely
free an event source by calling ply_event_loop_stop_watching_fd leading
to crashes and other undefined behaviour since
ply_event_loop_process_pending_events() dispatches the event sources
returned by epoll_wait() after the timeouts have been handled.
Thanks to cjwatson for a simpler solution to my original fix.
Ray Strode [Tue, 10 Apr 2012 14:14:30 +0000 (10:14 -0400)]
main: add way to ignore /sys/class/tty/console/active
Previously OLPC used --kernel-command-line to make plymouth
ignore specific consoles. That no longer works, now that we
read from /sys/class/tty/console/active
This commit adds an escape hatch, a way to get back to the old
behavior.
Ray Strode [Mon, 9 Apr 2012 18:34:46 +0000 (14:34 -0400)]
main: rename remaining_command_line to remaining_file_contents
add_consoles_from_file suffers from a sever case of
cut-and-paste-itis. This commit renames its variable
"remaining_command_line" to "remaining_file_contents" so that
the variable name actually makes sense.
Colin Guthrie [Thu, 15 Dec 2011 10:27:51 +0000 (10:27 +0000)]
main: Fix parsing of plymouth.debug=stream: argument.
It did not terminate at space so the log file to use was not
properly defined and any additional kernel command line args were
added to the end of the file name.
Daniel Drake [Sat, 17 Mar 2012 06:39:03 +0000 (02:39 -0400)]
frame-buffer: use /dev/fb0 as default device
The /dev/fb symlink doesn't get created with any recent udev version.
dracut puts it in place "by hand" before starting plymouthd, which is
why things aren't broken in configurations that use dracut's plymouth
module.
Update the default device path so that it works out-of-the-box in
other setups too.
Ray Strode [Thu, 13 Oct 2011 02:38:53 +0000 (22:38 -0400)]
main: don't overwrite state->terminal if there are multiple consoles
We call the add_display_and_keyboard_for_terminal function for
every console passed into the kernel command line and once for
/dev/tty1 if no console line is passed in. This function
repeatedly, reinitializes state->terminal with whatever
terminal is passed in each time its called.
This commit changes add_display_and_keyboard_for_terminal to not
touch state->terminal and instead makes the callers do it
(if appropriate)
Ray Strode [Thu, 13 Oct 2011 03:32:36 +0000 (23:32 -0400)]
boot-splash: deduce terminal from text display
Right now we pass a terminal to the constructor of the boot splash
object. This terminal is used for going to KD_TEXT mode when
ctrl-T is tapped or when hiding the splash.
We only need to do this, though, when:
1) we're running on a local vt
2) we're showing graphics
the boot-splash code has all the knowledge it needs to figure these
two things out on its own, and furtermore it already can figure out
which terminal is the relevant one without being told at construct
time.
This commit adds those smarts to the boot splash code.
Ray Strode [Wed, 12 Oct 2011 19:50:56 +0000 (15:50 -0400)]
main: fix kernel command line parsing
check_for_consoles has another bug (surprised?) where it would
jump too many characters forward if the command line has
console=tty0 in it, since tty0 is transparently changed to /dev/tty1.
Ray Strode [Mon, 10 Oct 2011 14:54:00 +0000 (10:54 -0400)]
README: resync from wiki
walters pointed out the README had some stale information in
it. I've copy and pasted the wiki text in, now, so there
will be hopefully a small quantity of said stale information.
Colin Walters [Sun, 9 Oct 2011 19:54:15 +0000 (15:54 -0400)]
autogen.sh: rework to be more buildsystem friendly
One of the goals laid out in
http://people.gnome.org/~walters/docs/build-api.txt
is to get projects to have autogen.sh scripts that
don't invoke configure after generating it.
This commit does that along with some other small
modifications designed to help be more confromant
with the Build API referenced in the above url.
James Hunt [Fri, 7 Oct 2011 15:32:46 +0000 (16:32 +0100)]
event-loop: use static buffer instead of stack allocation buffer
alloca() isn't a good idea to use, in general, because it provides
undefined behavior when it fails.
This commit changes the epoll event buffer from being stack allocated
to static to avoid any potentially problems resulting from stack
space exhaustion.
This is because when the kernel is closing a tty down, that
tty is unavailable to userspace to reopen.
Unfortunately, that commit neglected to inform the ply-keyboard
part of the code when the terminal retry was successful. The
upshot of this, is that if plymouthd needs to retry opening the
tty, then the splash screens lose control over the keyboard.
This commit changes how input notification is sent to the keyboard
handling code, so the tty disconnects are transparent.
Ray Strode [Tue, 29 Mar 2011 02:14:34 +0000 (22:14 -0400)]
systemd: toggle systemd messages when toggling console redirection
Normally systemd is very mute about messages. It's important,
though for it to be chatty when plymouth is running so we can
show verbose messages to the user when they hit escape.
This commit adds a new --enable-systemd-integration configure
flag which explicitly tells systemd when to print messages to
the console.
This may get dropped in the future in lieu of init script
changes doing this instead of plymouth directly.
Ray Strode [Wed, 23 Mar 2011 16:04:56 +0000 (12:04 -0400)]
main: add new --kernel-command-line option
It's really annoying when you're running plymouthd in
debug mode and don't happen to have "splash" on your kernel
command line and then need to reboot.
This commit adds a new debug option to override the kernel
command line for ths system.
Colin Watson [Sat, 12 Mar 2011 21:31:15 +0000 (16:31 -0500)]
upstart-bridge: add new helper program
This commit adds a new program, plymouth-upstart-bridge,
the listens for upstart state changes and sends them to plymouth,
or prints them out as appropriate.
Ray Strode [Wed, 9 Mar 2011 22:22:03 +0000 (17:22 -0500)]
drm: don't light up unlit monitors
If a monitor is dark when plymouth is started, we shouldn't
try to light it up. There are rules on which outputs can be
attached to which controllers and we're very likely to break
those rules just assigning things willy-nilly.
The kernel should set us up in the way it thinks is best anyway.
There's no reason to second guess the kernel here.
Ray Strode [Fri, 4 Mar 2011 19:57:52 +0000 (14:57 -0500)]
terminal: Keep retrying to reopen tty on EIO after hang up
If the tty hangs up on us, the kernel will return EIO while it's
closing down. As far as I know, there's no way to get notified
when it's back up again, so just keep retrying in a loop over
the course of a second or so. Eventually give up, though.
This is really suboptimal and suggests we should get away from
using ttys for input at some point.
client: do not wait forever if daemon is not started
Currently plymouth --wait will wait forever if daemon is not
started. This does not look right - we were asked to wait for
daemon to stop and daemon is obviously stopped. So make it
exit right away in this case.
This avoids timeouts during systemd boot if plymouth happened to be
stopped (or never started) before plymouth-quit-wait had chance to
start.
Ray Strode [Fri, 18 Feb 2011 18:45:55 +0000 (13:45 -0500)]
terminal: unlock tty before mucking with it
It seems that sometimes when the tty is stolen from us
it remains locked when we get it back. That would be okay
if the attributes were still kosher, but they aren't.
This commit unlocks the tty before trying to reinitialize
the terminal with suitable attributes.
Debugged by Andrey Borzenkov <arvidjaar@gmail.com>