Commit graph

2637 commits

Author SHA1 Message Date
Diego Augusto
dbec44871d src: Add support for /dev/input devices
Plymouth currently gets keyboard input from the terminal. This isn't
ideal, since it means plymouth requires VTs to be enabled in the kernel.

Furthermore, most display servers use /dev/input and libxkbcommon for
keyboard handling these days.

This commit adds similar support to the plymouth core code. Subsequent
commits will add support to the render plugins.

Some contributions by n3rdopolis and Ray Strode.
2022-11-29 09:22:06 -05:00
Diego Augusto
a2f03d4b98 scripts: Update keymap-render script to handle xkb keymaps too
At the moment the keyboard-render script only generates short
names for console layouts.

We're going to add /dev/input support to plymouth using
libxkbcommon, so we're going to need a list of of those keymaps
too.

This commit adds that.

Some contributions by n3rdopolis and Ray Strode.
2022-11-29 09:22:06 -05:00
Ray Strode
c354f026e5 device-manager: Only wait for device timeout for framebuffer devices
At the moment we ignore any udev events that come in before the
device timeout that are not drm devices.

That is because we don't want to use framebuffer devices as anything
but a last resort fallback option.

In the near future we're going to be handling input events from udev
as well. Those will obviously need to be handled right away, just like
drm devices.

This commit makes the check only defer framebuffer devices and not
anything that isn't a drm device.
2022-11-29 09:22:06 -05:00
Ray Strode
111b968759 ply-device-manager: Add != 0 to strcmp calls
strcmp is kind of a confusing function in that it returns
non-zero when the strings are not equal. That is
especially counterintuitive when this non-zero value is
treated as a TRUE boolean.

This commit just adds some != 0's to a couple of strcmp
calls for clarity.
2022-11-29 09:22:06 -05:00
Ray Strode
ab0559893e buffer: Support length == 0 for ply_buffer_append_bytes
Right now callers of ply_buffer_append_bytes have to be
very careful to make sure the data they're appending is
non-zero in length. This is kind of inconvenient, since
it's not unusual for data to come in that's zero bytes
long.

For simplicity, this commit just makes
ply_buffer_append_bytes support that use case.
2022-11-29 09:22:06 -05:00
Ray Strode
288d0aca02 terminal: Add API for flushing input buffer
In the future we're going to start reading keyboard input from
/dev/input instead of the tty. When that happens, input will
still be sent by the kernel to the tty.

This input would eventually back up and overflow.

To address that problem before it exists, this commit adds a new
API, ply_terminal_flush_input, that will drain the input buffer
on demand.

We can later use that API to keep the tty from backing up.
2022-11-29 09:22:06 -05:00
Ray Strode
dacf2dd9f3 trigger: Add the ability to trigger data with an associated instance
Right now triggers can only fire off handlers that have one piece
of data associated with them, but sometimes it's useful to have
an object associated with the data too.

This commit adds new api for adding "instance handlers" that have
an additional parameter and a new method `ply_trigger_set_instance`
that allows an object to be associated with the trigger and get
used for the additional parameter of the instance handlers.
2022-11-29 09:22:06 -05:00
Diego Augusto
123d07afd3 list: Add helper macro for iterating lists
At the moment, iterating over a ply_list_t requires an an
ugly looking for loop.

This commit adds a little sugar in the form of a
ply_list_foreach macro in the name of convenience.
2022-11-29 09:22:06 -05:00
Ray Strode
0902c25eb6 Revert "Add input device support"
Apparently the:

[x] Squash commits

box was checked when merge request plymouth/plymouth!177 was merged.
Oops.

We want good commit messages for such a big change, though, so people
doing code spelunking later have a fighting chance of following what's
going on.

This reverts commit dacfb36b57.

Subsequents commits will bring it back, peicemeal.
2022-11-29 09:14:37 -05:00
Ray Strode
8475409813 Merge branch 'fix-terminal-crash' into 'main'
Fix terminal crash

Closes #196

See merge request plymouth/plymouth!213
2022-11-29 05:40:54 +00:00
Ray Strode
e58891856c device-manager: Make sure local console terminal is open
We need to make sure the local console terminal is open so that
when we check later if it's a vt or not we get a valid answer.

This commit adds the open call.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/196
2022-11-28 19:33:29 -05:00
Ray Strode
8cb20287b0 device-manager: Ensure local_console_terminal isn't NULL
We thought we could get away with a NULL local_console_terminal
when the terminal isn't a VT, but it turns out we need it for
various reasons anyway.

This commit just makes sure we keep it in place.
2022-11-28 19:19:13 -05:00
Ray Strode
ca15d30c2f Merge branch 'vt-less_graphical' into 'main'
Allow Plymouth to use graphical backends on kernels without VT

See merge request plymouth/plymouth!179
2022-11-27 02:13:05 +00:00
n3rdopolis
8b1669acb2 device-manager: Support kernels with CONFIG_VT=n
At the moment, plymouth requires VT support be enabled in the kernel
to show graphical splashes.

This is because:

1. it relies on the tty to show details
2. when VT support is disabled the kernel will use ttyS0 as the default
console which makes plymouth disable graphical splashes since it assumes
the machine is a server with a serial console.

This commit addresses the first problem by disabling the
escape-to-toggle-details feature and addresses the second problem by
introducing a new kernel parameter plymouth.graphical that is like
the "splash" option and "plymouth.ignore-serial-consoles" option
combined.
2022-11-26 21:04:19 -05:00
Ray Strode
2165fe4f3b Merge branch 'dev_input' into 'main'
Add input device support

See merge request plymouth/plymouth!177
2022-11-27 01:38:00 +00:00
Diego Augusto
dacfb36b57 Add input device support 2022-11-27 01:38:00 +00:00
Ray Strode
1812e55afe Merge branch 'main' into 'main'
Add Hindi (hi) translation

See merge request plymouth/plymouth!212
2022-11-21 00:33:27 +00:00
Hemish
e28976464b Add Hindi (hi) translation 2022-11-21 05:47:39 +05:30
Ray Strode
58b7dba239 Merge branch 'debian-needs-a-certain-je-ne-sais-quoi' into 'main'
A bunch of fixes for -Wl,--no-undefined

Closes #194

See merge request plymouth/plymouth!211
2022-11-15 21:23:40 +00:00
Ray Strode
fa1067f581 ci: Add -Wl,--no-undefined to CFLAGS
I believe this is the real cause of failures on debian, so add
it to the CI builds.
2022-11-15 16:18:24 -05:00
Ray Strode
67bb3e2011 label-pango: Add -lcairo
This is more -Wl,--no-undefined fall out.

Closes: #194
2022-11-15 16:18:23 -05:00
Ray Strode
5285abddaf script: Fix up build for script plugin
More problems uncovered by -Wl,--no-undefined
2022-11-15 16:18:23 -05:00
Ray Strode
bf3eb9fdea libply: Add -lm too
-lm is problematic as well, so add it.
2022-11-15 16:18:23 -05:00
Ray Strode
0baf613607 Merge branch 'seriously-whats-the-dl' into 'main'
libply: Try again to add -ldl

Closes #194

See merge request plymouth/plymouth!210
2022-11-15 20:45:41 +00:00
Ray Strode
e7ff99e6da libply: Try again to add -ldl
This is yet one more try to get -ldl added to the link line on
debian.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/194
2022-11-15 15:43:23 -05:00
Ray Strode
b86cd4679e Merge branch 'its-not-just-at-the-end-of-a-rainbow' into 'main'
ci: Use gold by default

See merge request plymouth/plymouth!209
2022-11-15 14:58:33 +00:00
Ray Strode
cd7df781b5 ci: Use gold by default
I assume

https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/194

happened because the machine was using gold instead of ld. Let's
try to prevent future problems like that by making fedora use
gold in ci, too.
2022-11-15 14:58:26 +00:00
Ray Strode
f2a475f9e2 Merge branch 'whats-the-dl' into 'main'
libply: Add dependency on ldl

Closes #194

See merge request plymouth/plymouth!208
2022-11-15 14:37:20 +00:00
Ray Strode
f87be4d429 libply: Add dependency on ldl
debian is failing to build right now because libply isn't explicitly
pulling in libdl.

This commit fixes that oversight.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/194
2022-11-15 09:34:08 -05:00
Ray Strode
29fa684c68 Merge branch 'meson' into 'main'
meson: Fix theme path

See merge request plymouth/plymouth!207
2022-11-14 19:22:08 +00:00
Ray Strode
78fad74cd0 meson: Fix theme path
The meson port is missing a few slashes that cause some theme loading
issues at runtime.

This fixes that.
2022-11-14 14:19:58 -05:00
Ray Strode
53bff28957 Merge branch 'meson' into 'main'
Port build system to Meson

See merge request plymouth/plymouth!206
2022-11-14 18:48:43 +00:00
Ray Strode
a5c1ccd711 autogoo: Drop the goo
We have meson support now, get rid of the cruft.
2022-11-14 13:40:56 -05:00
Ray Strode
1654069171 ci: Update for meson 2022-11-14 13:30:59 -05:00
Niels De Graef
95d3e3bbf9 Port build system to Meson 2022-11-14 12:21:55 -05:00
Ray Strode
4bd41a355f Merge branch 'label-freetype-font-fixes' into 'main'
plugins: label-freetype: Fix alignment and calculation of line width

See merge request plymouth/plymouth!204
2022-10-20 16:45:37 +00:00
Alfonso Sánchez-Beato
d566b1285d plugins: label-freetype: Fixes calculation of line width
label-freetype was giving a wrong line width for two reasons:
* Unproper handling of negative left bearings as it was using it as normal
  while in fact the plugin draws full character boxes.
* Loading of the character used different flags when calculating width
  and when actually printing the characters.
2022-10-20 12:48:55 +01:00
Alfonso Sánchez-Beato
dbf0fa7fc7 plugins: label-freetype: Fix font alignment
label->width is used to calculate wrapping of lines and it is by
default -1. We need to use label->area.width instead when aligning a
line, as label->width might not have been set.
2022-10-20 11:37:14 +01:00
Ray Strode
770ef251a6 Merge branch 'label-ft' into 'main'
plugins: Add FreeType-based label plugin

See merge request plymouth/plymouth!203
2022-10-17 20:51:57 +00:00
Fabian Vogt
c9a03c17d7 populate-initrd: Install label-freetype plugin into initrd if available
Now that there's a freetype plugin available, it should be installed in
the initramfs.

This commit adds the changes to plymout-populate-initrd to make that
happen.

Some contributions by Petr Vorel and Nathan Pratta Teodosio.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
2022-10-17 13:04:02 -04:00
Fabian Vogt
58f4d4f47c plugins: Add FreeType-based label plugin
Right now plymouth uses pango for rendering text. Pango is
fully featured, but also carries a lot of depedencies.

Since plymouth goes in the initramfs, using a library that
brings in a lot of dependencies is less than optimal.

This commit adds a new freetype based plugin, alongside the
pango one.

It doesn't have quite the same feature set, but it brings in
a smaller dependency footprint.

Contributions to this commit from Nathan Pratta Teodosio,
Alfonso Sánchez-Beato, Petr Vorel, and Ondrej Holecek.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Ondrej Holecek <oholecek@suse.com>
[ oholecek: fix plugin for newline characters ]
Signed-off-by: Fabian Vogt <fvogt@suse.com>
2022-10-17 13:04:02 -04:00
Fabian Vogt
d019a7fce9 ply-label: Don't crash if label plugin fails
Right now if the label plugin fails during initialization, the plymouth
daemon crashes.

This commit adds a NULL check to fail more gracefully.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
2022-10-17 13:04:02 -04:00
Ray Strode
ccf2edf406 Merge branch 'dont-clear-serial-consoles' into 'main'
details: Only clear screen on VT not serial consoles

Closes #187

See merge request plymouth/plymouth!197
2022-10-15 19:41:37 +00:00
Ray Strode
45c3a40abd details: Don't replay boot buffer on serial consoles
commit 0e59dde8 changed the details plugin to clear the terminal when
first opening it. This was done to prevent duplicate messages from
showing up when toggling back and forth between details and graphical
splashes.

That has the negative side effect of purging serial console output too
though. Furthermore, it makes little sense to replay the boot buffer
on serial consoles, since serial consoles don't aggressively purge
scrollback like VTs do.

This commit adds a check to make sure the terminal is a VT before trying
to clear and replay the scrollback buffer.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/187
2022-10-15 19:39:12 +00:00
Ray Strode
2370412c10 Merge branch 'main' into 'main'
po: add Geogian translation

See merge request plymouth/plymouth!201
2022-10-15 19:37:49 +00:00
NorwayFun
5caf597e44 po: add Geogian translation 2022-10-15 19:37:49 +00:00
Ray Strode
214cdfc8c8 Merge branch 'valentindavid/reload-command' into 'main'
main: Add "reload" command

See merge request plymouth/plymouth!194
2022-10-15 18:04:08 +00:00
Valentin David
8d1c0e622e main: Add "reload" command
If an initramfs does not yet have all configuration, it might want
to start with a fallback theme, and re-load the correct theme is
accessible.
2022-10-15 18:02:01 +00:00
Ray Strode
5d98b174ba Merge branch 'force-fb' into 'main'
ply-device-manager: Add plymouth.force-frame-buffer parameter, allow to choose force framebuffer mode.

See merge request plymouth/plymouth!193
2022-10-15 16:19:22 +00:00
shiptux
f07ab522f4 ply-device-manager: Add plymouth.force-frame-buffer-on-boot parameter, allow to choose force framebuffer mode.
Some hardware vendor may not open source display driver. (Such as pangu
M900). They load drm driver via kernel modules. On such devices, drm driver
load more slowly then other devices, which may cause logo show later and no
seem to get the Plymouth decryption screen to show. To avoid this problem,
add a bootargs for people who want to forced use fb in plymouth.

When found "plymouth.force-frame-buffer-on-boot flags" in kernel parameter,
During the system start, PLY_DEVICE_MANAGER_FLAGS_FORCE_FRAM_BUFFER will be
add to device_manager_flags. Then "force_fb" mode  will enable, and the
renderer_type set as framebuffer.

Signed-off-by: shiptux <shiptux@gmail.com>
2022-10-15 16:17:16 +00:00