Use @plymouthruntimedir@/pid in systemd-ask-password-plymouth.service.in so
that the way the path to the pidfile is build there is identical to the
way the --pidfile argument is build in plymouth-start.service.in.
Fixes#26
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Since plymouth concatenates boot logs one after the other in
/var/log/boot.log, causing it to grow endlessly. we need to logrotrate it.
Fixes#31
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
If we need to (re)install our fb as the buffer to scan-out of during
flush, then do so after updating our fb contents, rather then before.
This removes another potential source of flickering.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Instead of installing a framebuffer with uninitialized contents, delay
installing our framebuffer until the first (re)draw.
This fixes some ugly flashes when plymout loads in some cases and it
also removes a FIXME comment from the code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
On modern systems we should use /run/plymouth to store things like the
pid file, instead of /var/run/plymouth, make the runtime dir configurable
with --with-runtimedir. This keeps the old default behavior of using
/var/run/plymouth, users can pass --with-runtimedir=/run to use
/run/plymouth instead.
Fixes: #75
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Commit 4e1c00b89a (" ply-pixel-buffer: Fix right and bottom edge rendering
of scaled buffers"), which tried to fix a minor rendering issue with the right
and bottom edge of scaled images, contains a typo which actually makes things
worse :|
When checking if iy exceeds the height of the image, ix gets set to the height
instead of iy leading to addressing pass part of the buffer which leads to
various rendering artifacts.
This commit fixes the typo and thus also the artifacts.
Fixes: #83
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add capslock.png, keyboard.png and keymap-render.png files to the
spinner and spinfinity themes, this enables keyboard indicator
(keymap and capslock state) support for these themes.
capslock.png was made by me drawing the icon in xfig, then export as
svg, at some blank rows at the bottom and save as png. I've added the
capslock.fig file to the spinner theme dir.
keyboard.png comes from google's material-design-icons (original is
apache licensed): https://github.com/google/material-design-icons/
I've also added a copy of the 2 svg source files to the spinner theme dir.
keymap-render.png is generated by scripts/keymap-render.py.
Fixes: #85
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Mark the display area where the icon is as damaged on show to force it
being drawn on show, in case capslock is on at show time.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add a new control which draws a keyboard-icon + a pre-rendered text
describing the current layout/keymap (as reported by the renderer).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add a script for generating a png with the short-name (ignoring variants)
of all keymaps listed by "localectl list-keymaps" pre-generated.
This scripts also generates a ply-keymap-metadata.h file with info on
which pre-generated keymap name is where in the png.
This will be used in a follow-up commit to add support for a new
keyboard-keymap-icon control to libply-splash-graphics.
Note that this commit does not add the generated keymap-render.png file,
this file will be added to each themes image-dir separately as the color
of the pre-generated text may differ per theme.
Changes by Hans de Goede:
- Change generated metadata into a C header file
- Drop drawing of curved corners, we just want the text
- Add special handling for dvorak
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add a function to get the keymap from a renderer and implement
this for the drm and frame-buffer renderers.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
In some cases me way want to parse key=value style config files from
outside of plymouth which lack ini style groups.
This commit adds a new ply_key_file_load_groupless_file function which
supports loading such files. When a file is loaded this way, NULL must
be passed as group_name for subsequent ply_key_file_get_* calls.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Recent gcc versions give the following compiler warning with space-flares:
./plugin.c: In function ‘star_bg_update’:
./plugin.c:762:21: warning: taking the absolute value of unsigned type ‘uint32_t’ {aka ‘unsigned int’} has no effect [-Wabsolute-value]
762 | if (abs (((image_data[x + y * width] >> 16) & 0xff) - ((pixel_colour >> 16) & 0xff)) > 8) {
| ^~~
This commit fixes this, assuming that gcc actually optimises the abs()
away, this will also make the code behave as intended again.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Switch to ply_kernel_command_line_get_key_value where appropriate.
While at it also fix a mem-leak when falling back override_splash_path from
PLYMOUTH_RUNTIME_THEME_PATH to PLYMOUTH_THEME_PATH.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ply_kernel_command_line_get_string_after_prefix returns the rest of
the commandline after the passed in prefix. When parsing key=value parts
of the commandline, we really only want the value part and stop at the
whitespace separating it from other kernel commandline arguments.
This commit adds a new helper which returns a strdup-ed string containing
just the value; instead of the entire rest of the kernel commandline.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
These 2 functions were doing almost the same. Move the setting of the
entry text or bullet count into view_show_prompt were it belongs and
merge these 2 functions into 1 function.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Remove superflous is_hidden / is_stopped checks from our on_draw
handler. In all 3 cases the is_hidden / is_stopped check guards
a draw_area call, but the draw_area calls themselves contain the
same check, so it checking this in on_draw is not necessary.
Also note that we are already not doing such a check for e.g. the
progress_bar so lets be consistent and remove the check everywhere.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cleanup the stop_animation function:
- Remove the trigger argument as all callers pass NULL
- Remove the logging of "hiding progress animation" we already log a
generic "stopping animation" message and we do not log such a message
for the other animated controls, so remove this one for consistency
- Add a NULL pointer check for view->end_animation, as this can actually
be NULL when view_load_end_animation fails
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Move ply_progress_animation_set_transition call up, grouping it with the
ply_progress_animation_new call.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
At one point in time the two-step splash plugin was forked from the
throbgress splash. Since then the two-step plugin has grown to be more
flexible / configurable.
The two-step plugin is now flexible enough that with the right config
it can mimick the throbgress plugin. Moving the spinifity theme to
use the two-step plugin allows us to remove the throbgress plugin,
removing the code duplication between the 2 plugins.
An added advantage of this is that the two-step plugin has more functionality,
such as capslock indicator support for the password dialog.
Note the throbber-??.png images were modified to add 24 transparant rows at
the top, to get the extra hardcoded throbber-height / 2 space which the
throbgress plugin added between the throbber and the header-image, this
was done automatically using the following command:
convert old.png -background transparent -gravity northwest -splice 0x24 new.png
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Until now we have been disabling the animations when the theme specifies
that a progress-bar should be drawn for the current mode.
This commit adds a new UseAnimation setting which defaults to
!UseProgressBar to preserve the old behavior if UseAnimation is not
set by the theme.
This makes two-step more flexible. Specifically it will allow implementing
the spinfinity theme using two-step; and spinifinity is the only user of
the throbgress plugin, so this will allow removal of that plugin.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit makes the progress-bar location configurable seperately from
the animation location and it makes the progress-bar size configurable
instead of hardcoding it.
This makes two-step more flexible. Specifically it will allow implementing
the spinfinity theme using two-step; and spinifinity is the only user of
the throbgress plugin, so this will allow removal of that plugin.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Before this commit we were not hiding the progress-bar when starting the
end-animation nor when stop_animation gets called. This adds the 2 missing
hide calls, making the handling of the progress-bar identical to that of
the progress-animation.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
We were only calling ply_progress_bar_set_percent_done from the
system_update callback and not from the on_boot_progress callback.
This commit fixes this by adding the missing calls for this to
update_progress_animation and it makes system_update use
update_progress_animation instead of duplicating the code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
We should always disable (hide) the progress-animation when
starting the end-animation. Instead of having all callers of
view_start_end_animation do this themselves, do it at the beginning
of view_start_end_animation.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add support for showing a capslock indicator when capslock is pressed
while entering a password.
This is automatically enabled if a capslock.png file is present in
the theme's image dir.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Use the new ply_key_file_get_double() and ply_key_file_get_long() helpers
to get the various theme settings, resulting in a nice cleanup.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add a ply_key_file_get_double() function which plugins can use to read
a double value, instead of them having to repeat this pattern over and over:
double_str = ply_key_file_get_value (key_file, "group", "key");
if (double_str != NULL)
foo = ply_strtod (double_str);
else
foo = 1.0;
free (double_str);
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add a private ply_key_file_get_raw_value() helper to avoid code-duplication
between ply_key_file_get_value() and ply_key_file_get_bool().
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add a new control which draws a capslock-icon when capslock is active
(as reported by the renderer).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Add a function to get the capslock state from a renderer and implement
this for the drm and frame-buffer renderers.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Fix the label plugin rendering garbled (wrong pitch) top to bottom text,
instead of proper left to right text when the pixel-buffer has a
device-rotation of rotate-clockwise or rotate-counter-clockwise.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1753418
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
When a device gets hot unplugged, we should de-activate and close the
renderer before freeing it.
Speficially this fixes a problem where plymouth's display "freezes" when
used with AMD GPUs which can be handled by both the radeon or the amdgpu
kms driver and the user has added kernel commandline options to prefer
the amdgpu driver. In this case the following happens:
1) radeon driver gets loaded, creates /dev/dri/card0 generating a udev
"add /dev/dri/card0" event.
2) radeon driver's "load" method checks if it should bind, comes to the
conclusion it should not, causing the probe of the device to be
aborted and /dev/dri/card0 to be unregistered generating a udev
"remove /dev/dri/card0" event
3) amdgpu driver loads, creates /dev/dri/card0 generating another udev
"add /dev/dri/card0" event.
4) plymouth loads while udev is still catching up with kernel events,
plymouth sees the first "add" event opens /dev/dri/card0 (which is
already managed by amdgpu at this time) finds outputs, shows splash
5) plymouth gets the "remove" events tears down the renderer, but
since deactivate and close were not called before this commit,
plymouth keeps the master rights attached to the old-fd which is
leaked at this point
6) plymouth gets the second "add" event brings everything back up, but
it cannot get master rights, since there can only be 1 master and the
leaked fd is the master. This leads to lots of:
"Couldn't set scan out buffer" errors and plymouth appears frozen
because of this, this is esp. bad with the disk encryption unlock screen
7) When gdm starts, it deactivates plymouth, but does not yet tell it to quit
to avoid flickering. The deactivate makes plymouth drop its master rights,
but this happens on the new broken fd which never got the master rights.
This also makes it impossible for gdm to get master rights, also breaking
gdm, with the following error in the logs:
"(EE) wl_drm@4: error 0: authenicate failed"
Note in theory calling ply_renderer_close() on teardown (from
ply_device_manager_free()) should be fine too, but for some reason
this causes the framebuffer to be all messed up (looks like wrong pitch /
tiling) when this is done after gdm has taken over the framebuffer.
Where as just exiting without calling drmModeRmFB, letting the kernel
clean up behind us, does not trigger this. This feels like it is a kernel
bug bug and I will file a bug for this. But for now we should not call
ply_renderer_close() on teardown to avoid this issue (which would be a
regression).
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1490490
Signed-off-by: Hans de Goede <hdegoede@redhat.com>