Commit graph

1718 commits

Author SHA1 Message Date
Ray Strode
9e5a276f32 main: rename process to be more systemd friendly
Systemd will cleanse the system of running processes
in the hand over from the initrd to the main root filesystem,
and at shutdown.

In both cases we want to keep on chugging, so we tag ourselves
in a way that systemd won't kill us.

See http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons
2012-06-06 13:58:09 -04:00
Kevin Murphy
cdbfba5364 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.

Minor changes to initial patch by Ray Strode.
2012-05-11 11:54:05 -04:00
Steve Langasek
e274cda1ee client: add new flush api
In some cases, clients may need a way to ensure that all queued
messages have been flushed and are sent to the daemon
(before, for instance, exiting).

This commit adds an API to block until the outgoing request queue is
empty.
2012-05-11 08:48:02 -04:00
Dr. Tilmann Bubeck
23fa0e8eea docs: Add keyboard shortcuts
This commit adds four keyboard shortcuts to the developer
documentation that were found from reading the source:

Esc: Toggle between system console and plymouth boot animation.

Ctrl-V: Toogle verbose mode on and off.

Ctrl-U or Ctrl-W: erase a line
2012-05-10 00:44:30 -04:00
Ray Strode
bb8e3afe19 docs: do a pass over new development.txt
I just did a quick read through and made various changes here and
there.
2012-05-07 23:55:12 -04:00
Ray Strode
19f237b7cc docs: specify where to send contributions 2012-05-07 22:33:15 -04:00
Dr. Tilmann Bubeck
987672f234 docs: Start document for developers
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
2012-05-07 22:30:55 -04:00
Dr. Tilmann Bubeck
ecd2721f1e 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.

https://bugs.freedesktop.org/show_bug.cgi?id=49355
2012-05-07 21:34:03 -04:00
Ray Strode
1a19b4572a drm: rename ENABLE_GDM_TRANSITION to ENABLE_GDM_DEPRECATED_TRANSITION
Most distributions no longer use this transition, which relies
on plymouth quitting before X starts.

For clarity, rename the #define to include the word DEPRECATED
2012-05-03 16:52:52 -04:00
Dave Airlie
527400dc5a 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.
2012-05-03 16:50:54 -04:00
Dr. Tilmann Bubeck
55939ac3a1 label: add alignment and width for labels.
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.
2012-05-01 19:18:01 -04:00
Ray Strode
0400dfeb11 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.
2012-05-01 12:42:33 -04:00
Ray Strode
9f526a0af4 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.
2012-05-01 12:30:25 -04:00
Kevin Murphy
c20cd45346 main: corrected error in read_consoles_from_file 2012-04-27 11:22:19 -04:00
Kevin Murphy
87b27bd1a8 main: fix bug in add_consoles_from_file
commit 6baab7a8f8 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.
2012-04-26 10:42:27 -04:00
Ray Strode
6e50233b03 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.
2012-04-25 18:22:00 -04:00
Ray Strode
e1e4779629 Revert "main: add way to ignore /sys/class/tty/console/active"
This reverts commit 9e3071520d.

This command line option is sort of awkward. It would be better
to provide a kernel command line escape hatch.
2012-04-25 18:17:26 -04:00
Ray Strode
ae29ca2d91 main: add default console for default scenarios
commit e810532e5d 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.

This restores show-splash functionality.
2012-04-25 18:01:45 -04:00
Kevin Murphy
6baab7a8f8 main: make add_consoles_from_file more robust
add_consoles_from_file was a little fast and loose in its parsing.

This commit makes it a little more fault tolerant.

Patch split from larger patch, and modified by Ray Strode.
2012-04-25 16:01:38 -04:00
James Hunt
16c7b306b3 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.

Minor changes by Ray Strode.

https://bugs.freedesktop.org/show_bug.cgi?id=28548
2012-04-24 18:03:03 -04:00
Ray Strode
dd3a6dcc6f event-loop: drop redundant EINTR/EAGAIN check
We check it a couple lines earlier in the code, so
there's no reason to check it again.
2012-04-24 17:58:18 -04:00
Ray Strode
9e3071520d 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.
2012-04-10 10:14:30 -04:00
Ray Strode
d4267ec71a 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.
2012-04-09 14:34:46 -04:00
Ray Strode
955534e18f main: more console fixes
When parsing /sys/class/tty/console/active,
we need to make sure we jump over spaces in
the command line
2012-04-09 14:33:08 -04:00
Ray Strode
a3af9feed3 main: only force details if system has non-tty0 console
Right now we're unconditionally forcing details mode,
which is clearly wrong.
2012-04-09 14:27:44 -04:00
Ray Strode
270615b516 populate-initrd: add new location for dracut source functions 2012-04-04 15:02:53 -04:00
Ray Strode
03498536f2 main: more console fixes 2012-04-04 11:41:40 -04:00
Ray Strode
f61c12af16 main: break out of loop when hitting trailing new line
It's important to ignore chunks of the active tty buffer
that are just whitespace.
2012-04-04 11:38:45 -04:00
Ray Strode
990f332b3f main: fix inverted conditional in active console reading code
We were failing when read succeeded, not when it failed, so
we were always reverting to fallback.
2012-04-04 11:30:26 -04:00
Ray Strode
f15abb5d95 main: strdup default tty
Just noticed a memory management problem when looking through
the code.
2012-04-04 10:42:12 -04:00
Colin Guthrie
032a30c489 main: Also show splash for 'splash=silent' arguments (which is what we use in Mageia) 2012-03-21 10:36:30 -04:00
Colin Guthrie
b8f2e2b11f 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.
2012-03-21 10:36:12 -04:00
Per Øyvind Karlsen
3f0cf34885 ulibc: Change the link order + add -ldl
ulibc linking is a bit more particular than regular glibc
2012-03-21 10:35:37 -04:00
Per Øyvind Karlsen
153b77e7e3 ulibc: Make the /usr/lib substitution less greedy. 2012-03-21 10:35:30 -04:00
Per Øyvind Karlsen
3aaee87bf9 ulibc: Add header needed when compiling against ulibc 2012-03-21 10:35:05 -04:00
Daniel Drake
b840b6f73c 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.
2012-03-17 02:39:03 -04:00
Daniel Drake
6cd7fd00d1 ply-splash-graphics: ensure link in config file
While building a theme externally I found that the link to
libply-splash-graphics was missing, due to an omission in the config
file.
2012-03-17 02:38:00 -04:00
Ray Strode
b8de41ef07 plymouth-populate-initrd: Check for new path to dracut-functions 2012-02-23 10:04:37 -05:00
Ray Strode
488a5d6578 Revert "Hang around until killed by init at shutdown"
This reverts commit 841068ba12.

That commit made plymouthd hang around until the last round
of slayings by init to keep the splash screen up as long as
possible.

That adds 5 seconds to shut down in some cases, though, so
is wrong.  Instead we need a solution that keeps the splash
around after plymouth exits.

See http://bugzilla.redhat.com/744932
2012-01-19 12:32:11 -05:00
Ray Strode
e810532e5d main: read consoles from /sys/class/tty/console/active
We currently read the list of available consoles from the
kernel command line.

This isn't the most reliable way to do things.

This commit changes the code to read

/sys/class/tty/console/active

instead.
2011-12-02 17:18:41 -05:00
Ray Strode
553c3e8643 main: close all terminals, not just local console terminal
It's important we close all terminals in the shutdown path,
so they all get unlocked and returned to cooked mode.

Previously, we would just close the local console terminal,
which meant other terminals would end up left in a broken state.
2011-10-13 11:55:43 -04:00
Ray Strode
b636493e08 main: rename state->terminal to state->local_console_terminal
state->terminal is used for VT handling code.  To make it clear
what its role is, rename it to state->local_console_terminal.
2011-10-13 11:55:24 -04:00
Ray Strode
95c3522e92 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)
2011-10-13 11:52:04 -04:00
Ray Strode
3a627b7878 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.
2011-10-13 11:49:19 -04:00
Ray Strode
2d1e0c8938 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.
2011-10-12 15:50:56 -04:00
James Hunt
1946bbc0de main: plug fd leak
This plugs an fd leak in an error path
2011-10-11 22:11:10 -04:00
Ray Strode
bd7a6bc929 utils: drop ply_list_directory
It's unused code
2011-10-11 22:09:37 -04:00
James Hunt
4cb4edd9f8 utils: plug dir fd leak
This commit calls closedir() in an error path.
2011-10-11 22:08:48 -04:00
James Hunt
128e14d342 logger: plug fd leak
This plugs an fd leak in an error path.
2011-10-11 22:05:54 -04:00
James Hunt
bcb27226b7 text-progress-bar: plug fd leak
This plugs a fd leak in an error path
2011-10-11 22:03:08 -04:00