Commit graph

3011 commits

Author SHA1 Message Date
Hans de Goede
d4cbf1fafd Merge branch 'two-step-diskunlockscreen-tweaks' into 'main'
two-step: 2 small disk unlock screen cosmetic tweaks

See merge request plymouth/plymouth!357
2025-07-14 10:49:07 +02:00
Hans de Goede
9f72b7c34d two-step: Add some padding between text-entry field and prompt
Two-step's disk unlock screen shows the prompt text directly below
the text entry field without any padding which looks bad.

Add some padding to make things look better.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2356893
Signed-off-by: Hans de Goede <hansg@kernel.org>
2025-07-14 10:46:34 +02:00
Hans de Goede
b828874199 two-step: Remove ':' at the end of (passphrase) prompt below text entry field
When asked for e.g. a disk unlock passphrase, plymouth will be passed
a prompt like: "Please enter passphrase for disk $DISK:" the ':' in
the end makes sense when asking for this a text console, but this makes
less sense in the two-step disk unlock screen where the text is below
the passphrase entry field.

Strip any ':' char at the prompt's end on two-step's disk unlock screen.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2356893
Signed-off-by: Hans de Goede <hansg@kernel.org>
2025-07-14 10:46:34 +02:00
Hans de Goede
5a4bda3de2 Merge branch 'fix-ply-keymap-icon-label-fallback' into 'main'
ply-keymap-icon: Fix falling back to label-plugin when there is no pre-rendered text

See merge request plymouth/plymouth!358
2025-07-14 10:30:42 +02:00
Hans de Goede
98419849ef ply-keymap-icon: Fix falling back to label-plugin when there is no pre-rendered text
In order for the fallback path (keymap_icon->has_prerendered_text == false)
to work properly keymap_icon->keymap_name must be set when no pre-rendered
text is found.

Tested by temporarily removing the "us" entry from ply-keymap-metadata.h.

Signed-off-by: Hans de Goede <hansg@kernel.org>
2025-07-14 10:20:16 +02:00
Hans de Goede
c340ce047b Merge branch 'drm_simpledrm_dpi' into 'main'
drm: Add simpledrm HiDPI display support

See merge request plymouth/plymouth!348
2025-07-14 09:29:42 +02:00
Janne Grunau
6780124665 drm: Add simpledrm HiDPI display support
For devicetree based systems simpledrm might know the actual physical
display dimensions. Test if the reported connector width and height
result in a pixel density larger than 96 DPI. If that's the case
calculate the device scale instead of guessing it based on the
resolution.
This restores HiDPI scaling on 13-inch Apple silicon Macbooks with a
resolution of 2560x1600 (224 - 227 DPI) after commit 1421a9f6
("ply-utils: Increase threshold for guessed hiDPI scaling
to >= 2880x1620").

Signed-off-by: Janne Grunau <j@jannau.net>
2025-07-13 22:55:17 +02:00
Hans de Goede
992870da8a Merge branch 'lower_hidpi_cutoff_value' into 'main'
ply-utils: Adjust HiDPI cut-off value to 1.625f

See merge request plymouth/plymouth!349
2025-07-03 15:09:58 +02:00
Janne Grunau
7e3b8330c9 ply-utils: Adjust HiDPI cut-off value to 1.625f
This matches mutter's behaviour before
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3616 was merged.
It first rounded to the newest fractional scale factor (in 0.25 steps)
and then rounded N.25 and N.5 down to N and N.75 up to N+1.

Commit 3b8e9184 ("ply-utils: Only choose scale 2 when the perfect scale
would be >= 1.75") interprets the mentioned difference of at most 0.25
for rounding up very literal. A differnt ionterpretation of
d03dce4378
intend is that it's desireable to round N.5 down.

This change has unexpected side effect of using a device scale of 1 for
most of Apple's Retina displays in Macbooks (221 - 227 DPI). Raised as
https://gitlab.gnome.org/GNOME/mutter/-/issues/4110 in mutter.

Using 1.75f cut-off value requires a pixel density of 236.25 for HiDPI
while 1.625f requires only 219.375 DPI.

Mutter use the same calculation with
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4490 merged.

Signed-off-by: Janne Grunau <j@jannau.net>
2025-07-03 15:04:17 +02:00
n3rdopolis
38f7ff25b8 Merge branch 'weblate-plymouth-master' into 'main'
Translations update from Fedora Weblate

See merge request plymouth/plymouth!350
2025-06-24 15:08:05 +00:00
David Medina
d103d155b8 Translated using Weblate (Catalan)
Currently translated at 100.0% (7 of 7 strings)

Co-authored-by: David Medina <dmedinacpnl@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/ca/
Translation: plymouth/main
2025-06-24 15:02:32 +00:00
Américo Monteiro
a56423c41a Translated using Weblate (Portuguese)
Currently translated at 100.0% (7 of 7 strings)

Co-authored-by: Américo Monteiro <a_monteiro@gmx.com>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/pt/
Translation: plymouth/main
2025-06-24 15:02:32 +00:00
hsu zangmen
c9f380661b Translated using Weblate (Chinese (Traditional) (zh_TW))
Currently translated at 100.0% (7 of 7 strings)

Co-authored-by: hsu zangmen <chzang55@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/zh_TW/
Translation: plymouth/main
2025-06-24 15:02:32 +00:00
n3rdopolis
04d94e52aa Merge branch 'fix-288-frame-buffer' into 'main'
frame-buffer: Check for NULL terminal in watch_input_device

See merge request plymouth/plymouth!353
2025-06-24 13:13:28 +00:00
n3rdopolis
fb802b9ab1 frame-buffer: Check for NULL terminal in watch_input_device
Match the drm backend
2025-06-20 12:44:36 -04:00
Hans de Goede
78f73d5281 Merge branch 'fix-issue-288' into 'main'
drm: Check for NULL terminal in watch_input_device

Closes #288

See merge request plymouth/plymouth!344
2025-06-19 21:15:37 +00:00
Daniel van Vugt
d20b1be527 drm: Check for NULL terminal in watch_input_device
It's allowed to be NULL and the rest of the source file checks for NULL.
Seems the check was just forgotten here.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/288
2025-06-19 20:42:32 +00:00
n3rdopolis
87105eb500 Merge branch 'double-underline-fix' into 'main'
Fix doubly underlined text output and incorrect SGR attribute handling

See merge request plymouth/plymouth!346
2025-06-18 17:18:35 +00:00
Tomita Moeko
11e889ef2f ply-terminal-emulator: Fix incorrect SGR attribute handling
According to ECMA-48 [1], Select Graphic Rendition (SGR) attribute 21
is for "doubly underlined", not "disabling bold" in current plymouth
implementation.

Additionally, SGR 22 is for "normal colour or normal intensity (neither
bold nor faint)", both bold and dim should be disabled with it.

[1] 8.3.117, https://www.ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf

Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
2025-06-18 15:14:25 +00:00
Tomita Moeko
1e35656625 ply-kmsg-reader: Fix doubly underlined text output
Currently plymouth applies Select Graphic Rendition (SGR) attribute 21
to disable bold text. However, per ECMA-48 [1], this attribute is for
doubly underlined text, not for disabling bold, resulting unintended
doubly underlined output on boot. Fix it by conditionally applying
standard bold attribute (SGR 1) on bold text.

[1] 8.3.117, https://www.ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf

Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
2025-06-18 15:14:25 +00:00
n3rdopolis
184b7dc2ab Merge branch 'fix-handle-kmsg-reader-crash' into 'main'
kmsg-reader: handle multipart messages

Closes #303

See merge request plymouth/plymouth!352
2025-06-16 00:39:39 +00:00
Cedric Hombourger
8014c505ce kmsg-reader: handle multipart messages
handle_ksmg_message wrongly assumed that all messages are terminated
with a trailing line feed: kernel messages emitted by pr_cont() may
not. At any rate, the return value of the strchr() call ought to be
checked to avoid crashing when parsing incoming messages.

Closes #303
2025-06-16 00:38:00 +00:00
n3rdopolis
6890432b2a Merge branch 'ctrl_alt_delete' into 'main'
ply-input-device: Reboot when users press Ctrl+Alt+Delete

See merge request plymouth/plymouth!351
2025-06-14 01:10:37 +00:00
n3rdopolis
6a32765ae8 ply-input-device: Reboot when users press Ctrl+Alt+Delete 2025-06-13 14:15:13 -04:00
Adrian Vovk
bc6c67dc11 Merge branch 'dmesg-replay' into 'main'
details: Don't duplicate output on console

Closes #298

See merge request plymouth/plymouth!347
2025-05-15 17:31:13 -04:00
Adrian Vovk
a53065d0ce
kmsg-reader: Seek to the end of the ringbuffer
Otherwise, whenever plymouth starts we'd replay all previous kmsg
entries, even if they've already been logged to the console. This leads
to duplicated log entires, and makes it hard to debug things.

With /dev/console, we only log what we capture while Plymouth is
running. Let's do the same with /dev/kmsg
2025-05-12 16:05:43 -04:00
Adrian Vovk
6d7b3c3342
details: Suppress kernel's own kmsg console output
Plymouth forwards /dev/console and /dev/kmsg to all consoles (and to the
graphical splash). With the details plugin, we would do this without
suppressing the kernel's own output first. This would lead to duplicate
log entries
2025-05-12 16:05:42 -04:00
Adrian Vovk
2446472f9a
utils: Don't lose log level when silencing kmsg
Once we disable kmsg logging to the console, the kernel will set the
console log level to the minimum log level (i.e. only logging kernel
panics). However the unintended side effect is that our own kmsg-reader
will start filtering out all kernel log messages, since we also respect
the kernel's console log level.

This change make it so that we keep using the original console log level
whenever we disable the kernel's output. This lets us keep forwarding
the kernel's kmsg output
2025-05-12 16:05:41 -04:00
Rafael Fontenelle
4876cfa147 Merge branch 'weblate-plymouth-master' into 'main'
Translations update from Fedora Weblate

See merge request plymouth/plymouth!333
2025-05-07 16:38:59 +00:00
ButterflyOfFire
2e4f738400 Translated using Weblate (Kabyle)
Currently translated at 100.0% (7 of 7 strings)

Co-authored-by: ButterflyOfFire <butterflyoffire@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/kab/
Translation: plymouth/main
2025-05-07 16:26:50 +00:00
joo es
9885d6fab9 Translated using Weblate (Arabic)
Currently translated at 100.0% (7 of 7 strings)

Added translation using Weblate (Arabic)

Co-authored-by: joo es <jonnyse@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/ar/
Translation: plymouth/main
2025-05-07 16:26:50 +00:00
Yauhen Bugamol
f4803bd013 Translated using Weblate (Belarusian)
Currently translated at 100.0% (7 of 7 strings)

Co-authored-by: Yauhen Bugamol <3abac@3a.by>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/be/
Translation: plymouth/main
2025-05-07 16:26:50 +00:00
Icar NS
d0bf79b27e Translated using Weblate (Catalan)
Currently translated at 100.0% (7 of 7 strings)

Added translation using Weblate (Catalan)

Co-authored-by: Icar NS <fedoraproject.relock974@passmail.net>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/ca/
Translation: plymouth/main
2025-05-07 16:26:50 +00:00
Hans de Goede
9653285f37 Merge branch 'get_device_scale_guess' into 'main'
ply-utils: Guessed device-scale improvements

See merge request plymouth/plymouth!343
2025-05-06 11:49:25 +00:00
Hans de Goede
1421a9f65f ply-utils: Increase threshold for guessed hiDPI scaling to >= 2880x1620
1440 is only 33% more then FHD, so using 2x there is a bit too much and
leads to the spinner being much too large on e.g 27" monitors.

And on e.g. Dell ultrawide 34" 3440x1440 which are only 110 DPI this effect
is even worse.

Change the threshold to >= 2880x1620 to avoid using 2x scaling on 1440p
monitors. 2880x1620 is ~240DPI when used in a 14" laptop at which point
using 2x scaling is really necessary.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-05-06 11:38:59 +00:00
Hans de Goede
2123f7b9c6 ply-utils: Use lower threshold for hiDPI scaling on 3:2 screens
3:2 screens are only used in mobile form factors, add a special case for
this with a lower threshold to enable 2x hiDPI scaling.

Also remove the HIDPI_MIN_* defines these were only used in one place
and adding a second set for the 3:2 screens just makes things harder
to read.

Instead write the actual width/height thresholds directly in the code
of the new get_device_scale_guess () helper.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-05-06 11:38:59 +00:00
Hans de Goede
0a4fd6b1d2 ply-utils: Swap width <-> height for portrait screens when guessing device-scale
Swap width <-> height for portrait screens when guessing device-scale,
this fixes the heuristics not working for portrait screens.

Also move the heuristics to a new get_device_scale_guess () helper, because
it has become a bit larger now.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-05-06 11:38:59 +00:00
Hans de Goede
655aae1e3d Merge branch 'use_simpledrm-config' into 'main'
Make simpledrm selection configurable from config file

Closes #264

See merge request plymouth/plymouth!342
2025-05-06 11:37:33 +00:00
Hans de Goede
61e471762e ply-device-manager: Update verify_drm_device () comment
The comment about why SimpleDRM devices should be skipped is no longer
accurate, the kernel does provide rotation info now; and plymouth now
has heuristics to guess the device-scale.

If SimpleDRM devices should be used or not now mostly is a user
preference.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:47:04 +01:00
Hans de Goede
f23b07e5b5 drm: Reject 800x600 and 1024x768 simpledrm drm devices
Sometimes the EFI firmware initializes the framebuffer at a very low
resolution rather then at the panel's native resolution.

In this case it is better to wait for the native GPU driver to load
rather then rendering a not-so-pretty splash at this very low resolution.

Reject these low resolutions for simpledrm devices except when
query_device () is called with force=true.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:47:04 +01:00
Hans de Goede
c1e0070d47 libply-splash-core: Add a force argument to ply_renderer_open ()
Sometimes a renderer plugin may want to refuse to open a device
because it has suboptimal settings, like e.g. an EFI framebuffer
based simpledrm when the EFI firmware has set the resolution to
800x600 instead of the native panel resolution.

In such a case it might be better to wait for another better
/dev/dri/card# device to show up.

This skipping of devices by renderer plugins needs to be configurable
in case the timeout hits, or the user wishes to override things.

Add a force argument to ply_renderer_open () to allow overriding
this behavior. User can force using simpledrm by passing
plymouth.use-simpledrm=2 on the kernel commandline or by setting
UseSimpledrm=2 in the config-file.

This flag is passed to the renderer plugin's query_device () method
as that is the best place for the renderer plugin to determine
a device's usability.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:46:58 +01:00
Hans de Goede
e7fc6cb5c4 Make simpledrm selection configurable from config file
Move the handling of the "plymouth.use-simpledrm" commandline argument from
ply-device-manager to main.c, and allow specifying its default value in
the "[Daemon]" section of the config-file using a new UseSimpledrm keyword.

Extend the "plymouth.use-simpledrm" handling to also accept a value e.g.
"plymouth.use-simpledrm=0" to allow overriding a "UseSimpledrm=1" in
the configfile.

And pass the use-simpledrm value to ply_device_manager_new () through a new
PLY_DEVICE_MANAGER_FLAGS_USE_SIMPLEDRM flag.

This also moves the kernel commandline handling to src/main.c grouping
it together with most of the other commandline handling.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:45:27 +01:00
Hans de Goede
6620904dff main: Do not override device_scale from lower-priorities config files
main () calls functions to get the theme and other config settings from
the commandline / config files in order of *descending* priority:

1. find_override_splash ()             /* Parses commandline */
2. find_system_default_splash ()       /* /etc/plymouth/plymouthd.conf */
3. find_distribution_default_splash () /* /usr/share/plymouth/plymouthd.defaults */

To avoid the later parsed config files *with lower priorities* overriding
earlier settings the code initializes the config variables to NAN and only
sets them if they are still set to NAN.

Except for the device_scale handling, where load_settings () always calls
ply_set_device_scale () overriding earlier values, the commandline
handling for "plymouth.force-scale=..." is done separately later so that
the commandline does take priority over the config files, but since
/usr/share/plymouth/plymouthd.defaults is parsed last any DeviceScale
setting there will override /etc/plymouth/plymouthd.conf settings.

Fix this by following the pattern used by start_time/splash_delay/
device_timeout, add a device_scale variable initialized to -1 and
only override that variable if it is at -1.

This also allows removing find_force_scale () moving the commandline
parsing to find_override_splash () together with the other commandline
handling.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:45:27 +01:00
Hans de Goede
443e580162 ply-utils: Add ply_kernel_command_line_get_ulong () helper
Add a ply_kernel_command_line_get_ulong () helper mirroring
ply_key_file_get_ulong ().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:45:18 +01:00
Hans de Goede
bf80db4ec3 ply-keyfile: Change ply_key_file_get_long () into ply_key_file_get_ulong ()
Change ply_key_file_get_long () into ply_key_file_get_ulong () and add
error checking.

All callers of ply_key_file_get_long () expect a positive / unsigned number.
Rename it to ply_key_file_get_ulong ().

Also add error checkig for non valid numbers and return the default value
for these instead of 0.

Note this also fixes the return value of ply_key_file_get_long () being
a double (this is now changed to an unsigned long).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-04 12:35:05 +01:00
Ray Strode
d42a2830bd Merge branch 'keymap-icon-fixes' into 'main'
ply-keymap-icon: Make Dvorak check case-insensitive

See merge request plymouth/plymouth!341
2025-02-10 19:52:38 +00:00
Hans de Goede
a251957882 Run keymap-render.py to update the pre-rendered keymap
Run keymap-render.py to update the pre-rendered keymap used by
ply-keymap-icon.c.

This adds 2 new console keymaps: "mod" and "nz" and 1 new xkb keymap:
"English (New Zealand)".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-02-10 14:49:07 +01:00
Hans de Goede
f443234585 ply-keymap-icon: Make Dvorak check case-insensitive
When using evdev support the XKB keymap name (with variant) for Dvorak
users will be e.g. "US (Dvorak)". The Dvorak layouts are not described
in /usr/share/X11/xkb/rules/evdev.xml, so these are not added to
ply-keymap-metadata.h / keymap-render.png .

For the console-keymap case dvorak is handled specially in:

keymap-render.py:normalize_keymaps()
ply-keymap-icon.c:ply_keymap_normalize_keymap()

mapping all keymap-names with a lowercase dvorak in there to "dvorak",
change this special handling to be case-insensitive so that it also works
for the xkb-keymap case.

Note the keymap-render.py change really is a no-op since keymap-render.py
only calls normalize_keymaps() on console-keymaps which are always
lower-case. normalize_keymaps() should still be updated though to keep
the 2 functions in sync.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2341810
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-02-10 14:23:58 +01:00
Ray Strode
a0e8b6cf50 Merge branch 'freetype-monospace-bold' into 'main'
label-freetype: implement bold font handling

See merge request plymouth/plymouth!338
2024-12-15 18:40:14 +00:00
Ferdinand Bachmann
42430bcdf8 label-freetype: implement bold font handling
Bold monospace fonts are prominently used in the console output printed
by systemd. Without them, the output looks incorrect compared to pango.
This still is far from a complete implementation of rich text, but
brings label-freetype much closer to what label-pango does for the
default theme.

This commit introduces a glyph_face variable in load_glyphs() that holds
the correct face for the current glyph (label->face or
label->bold_face). This face is then passed on to load_glyph() and
finish_measuring_line() to ensure correct font measurements.
2024-10-30 10:50:22 +01:00