Commit graph

2824 commits

Author SHA1 Message Date
Ray Strode
aed498e026 Merge branch 'fix-xkb-crash' into 'main'
ply-device-manager: Handle XKB failing to load more gracefully

See merge request plymouth/plymouth!280
2023-12-27 22:02:36 +00:00
Ray Strode
5b471eb7e3 ply-device-manager: Handle XKB failing to load more gracefully
Right now we always assume `xkb_context_new` will succeed.

This isn't necessarily true. If it fails, we shouldn't crash.

This commit fixes that.
2023-12-27 21:39:33 +00:00
Ray Strode
9bfd229131 Merge branch 'print-backtraces' into 'main'
main: Print backtrace on crash

See merge request plymouth/plymouth!279
2023-12-27 21:39:27 +00:00
Ray Strode
f2bd492ac7 main: Print backtrace on crash
Since plymouth can crash before the root filesystem is mounted,
and since plymouth can prevent boot from proceeding, coredumpctl
isn't always a viable option for getting backtraces.

This commit changes the crash handler to output backtrace
information to assist when coredumpctl can't.
2023-12-27 21:39:07 +00:00
Ray Strode
355197714f Merge branch 'fix-freetype-crash' into 'main'
label-freetype: Handle font failing to load more gracefully

See merge request plymouth/plymouth!276
2023-12-27 20:18:35 +00:00
Ray Strode
0fb9f0c6f1 label-freetype: Fix loading debug message
The freetype plugin was calling printf instead of ply-trace when
a font failed to load. Also, it didnt list the failure reason.

This commit fixes things up a bit.
2023-12-27 19:54:29 +00:00
Ray Strode
b4e01e90c0 label-freetype: Handle font failing to load more gracefully
We currently crash if the font fails to load.

This commit attempts to handle the situation more gracefully.
2023-12-27 19:54:29 +00:00
Ray Strode
1c676e5031 Merge branch 'fix-console-viewer-crash' into 'main'
fade-throbber,space-flares,two-step: Don't crash if no console viewer

See merge request plymouth/plymouth!278
2023-12-27 19:53:42 +00:00
Ray Strode
7003f17229 fade-throbber,space-flares,two-step: Don't crash if no console viewer
The splash plugins don't create a console viewer if
`plymouth.prefer-fbcon` is on the kernel command line, but expect it
to be not NULL regardless.

This commit corrects that misconception.
2023-12-27 14:50:09 -05:00
Ray Strode
c835c7ff53 Merge branch 'fall-back-to-text-faster' into 'main'
ply-device-manager: Fall back to text plugin if no renderers installed

See merge request plymouth/plymouth!275
2023-12-26 11:37:01 +00:00
Ray Strode
03842d5201 ply-device-manager: Fall back to text plugin if no renderers installed
If there's no renderers installed there's no point in continuing to
listen for DRM events and trying to load the drm plugin.

This commit just forces text mode right away in that case.
2023-12-25 20:49:01 -05:00
Ray Strode
32d930bdda Merge branch 'font-fix' into 'main'
Fix checks for existence of vars set by fc-match

See merge request plymouth/plymouth!274
2023-12-26 00:05:11 +00:00
Adam Williamson
2fe900a4f3 Fix checks for existence of vars set by fc-match
The first line here checked for the wrong variable and is a dupe
from two lines earlier anyway, and the second line isn't guarded
at all, which seems to cause the weird failure we've been seeing
in openQA testing.

Also add a couple more existence checks for the same variables
later.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2023-12-25 14:52:54 -08:00
Ray Strode
ac6c34b9f5 plymouth-populate-initrd: More dependency softification
This commit makes lack of fc-match less noisy and makes
compose.dir from libX11 be optional as well.
2023-12-25 15:25:51 -05:00
Ray Strode
2d979da044 Merge branch 'make-deps-less-hard' into 'main'
plymouth-populate-initrd: Handle xkb and fontconfig not being installed

See merge request plymouth/plymouth!273
2023-12-25 19:47:06 +00:00
Ray Strode
97a19552f3 plymouth-populate-initrd: Handle xkb and fontconfig not being installed
Some minimal installs won't have fontconfig or xkb. In those cases,
the script should continue to work even if the initramfs will be
less featureful.

This commit fixes that.
2023-12-25 14:42:53 -05:00
Ray Strode
202a6ac379 Merge branch 'fix-usage-message' into 'main'
plymouth-populate-initrd: Fix usage message

See merge request plymouth/plymouth!272
2023-12-25 16:12:59 +00:00
Ray Strode
2f89dc9060 plymouth-populate-initrd: Fix usage message
It currently says the scripts name is `plymouth` not
`plymouth-populate-initrd`.

This commit changes it to use $0
2023-12-25 11:07:47 -05:00
Ray Strode
780a58603b Merge branch 'meson-systemd-integration' into 'main'
meson: Fix PLY_ENABLE_SYSTEMD_INTEGRATION define

See merge request plymouth/plymouth!271
2023-12-25 13:29:25 +00:00
Balló György
1de4e487fb meson: Fix PLY_ENABLE_SYSTEMD_INTEGRATION define 2023-12-25 13:29:25 +00:00
Ray Strode
1a8e184885 Merge branch 'fix-label-crasher' into 'main'
ply-label: Make NULL safe (again)

See merge request plymouth/plymouth!270
2023-12-24 20:48:47 +00:00
Ray Strode
07bc5992de ply-label: Make NULL safe (again)
commit a045f01568 tried to make ply-label
NULL safe, but missed a strdup.

This commit fixes that.
2023-12-24 15:46:33 -05:00
Ray Strode
65aecea9b4 Merge branch 'input-device-crasher' into 'main'
ply-input-device: Fix crasher

See merge request plymouth/plymouth!269
2023-12-24 20:46:28 +00:00
Ray Strode
a9bc80efb5 ply-input-device: Fix crasher
If we have an error during early input device initialization we
can blow assertion because we may try to cleave it from the event
loop it is not yet attached to.

This commit fixes that.
2023-12-24 15:42:31 -05:00
Ray Strode
93416bd5e6 generate-version: Use day number instead of week number
Right now the version is generated from week number but that
means more than one release in a week won't work.

This commit changes it to day number.
2023-12-22 11:29:12 -05:00
Ray Strode
897217ccc9 Merge branch 'main' into 'main'
main: fix out of bounds write

See merge request plymouth/plymouth!265
2023-12-22 16:22:14 +00:00
Ray Strode
0dd39b916b main: Fix out of bounds write
There's currently an out of bounds write when copying dmesg to to
the boot buffer.

This is because there's a newline and a terminating NUL and only
one of the two was being accounted for.

This commit fixes the problem by dropping strcat/strcpy and using
printf style functions instead.

Spotted by Ilya K.
2023-12-22 15:51:48 +00:00
Ray Strode
508c0d0690 Merge branch 'fix-generate-version' into 'main'
generate-version: Fix script inside of a tarball

Closes #232

See merge request plymouth/plymouth!268
2023-12-22 15:46:55 +00:00
Ray Strode
3e76e1343b generate-version: Fix script inside of a tarball
The heuristic to check whether or not we're inside of a git checkout
or a tarball isn't working properly.

This commit changes it to use git rev-parse --is-inside-git-dir which
is pretty specifically designed for this use case.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/232
2023-12-22 10:36:40 -05:00
Ray Strode
de600fd9a4 Merge branch 'fix-keymap-memory-leak' into 'main'
ply-keymap-icon: Fix memory leak

See merge request plymouth/plymouth!267
2023-12-22 14:50:08 +00:00
Ray Strode
2d01c5cda7 ply-keymap-icon: Fix memory leak
It seems like there's a memory leak with the keymap icon text if
there isn't a hit.

This commit fixes that, and renames some of the variables to make
it a little clearer what's going on
2023-12-22 09:38:29 -05:00
Ray Strode
e3b89b1b95 Merge branch 'handle-null-better' into 'main'
ply-label: Make NULL safe

See merge request plymouth/plymouth!266
2023-12-22 13:42:41 +00:00
Ray Strode
a045f01568 ply-label: Make NULL safe
commit 42d07913a0 made the pango plugin
NULL safe but the same problem exists in the freetype plugin.

This commit makes things NULL safe a layer higher.
2023-12-22 08:29:13 -05:00
Ray Strode
bfaf591c03 Merge branch 'revamp-freetype-plugin' into 'main'
label-freetype: Revamp to work better

See merge request plymouth/plymouth!264
2023-12-19 19:32:45 +00:00
Ray Strode
fc986f0c1c label-freetype: Revamp to work better
Recent changes to the freetype plugin made it quite buggy. There
was an infinite loop bug, and also a failure in metrics handling.

There's also a number of outstanding issues:

1. Kerning is not properly applied
2. hidpi displays don't render correctly

Rather than try to tackle all of these problems in a peicemeal way,
this commit substantially reworks the code.

It introduces a ply_freetype_unit_t type for more clearly managing
the fixed point math freetype requires. This type relies on less
than well defined compiler behavior, however, so it may cause issues
down the road.

It consolidates measuring and drawing code to one function, since in
both cases, the same computation needs to happen, and they had
slightly divergent implementations before.

It consolidates font loading code, so we don't end up with two
different font face loading routines, with different dpi values.

It also changes the names of some variables to be clearer in my
mind (like changing the loaded glyph to the name "glyph" instead
of the name "slot")
2023-12-19 14:21:25 -05:00
Ray Strode
606f8c232b ply-console-viewer: Don't crash if passed a NULL format
The splash plugins currently call

ply_console_viewer_print (... NULL);

if no prompt message is specified... This leads to crash.

Rather than fixing all the splash plugins, this commit just makes
a NULL format be a noop.
2023-12-18 13:57:10 -05:00
Ray Strode
d7c2e3a4ac Merge branch 'synchronize-display-updates' into 'main'
ply-boot-splash: Flush display updates at fixed framerate

See merge request plymouth/plymouth!263
2023-12-17 15:05:23 +00:00
Ray Strode
5e33469e87 ply-boot-splash: Flush display updates at fixed framerate
At the moment the splash plugins have a lot of leeway when
updates can go to the screen. They can pause and unpause
updates by themselves, and draw at any point.

This rope has a little too much slack, it's actually kind
of complicated for the splash plugins to manage drawing
when they have more than one moving part.

For instance, a spinner animation may be drawing autonomously
from the splash plugin itself. To avoid flicker, everything
needs to be synchronized.

This commit adds that synchronization a layer higher than
the plugins themselves, in ply-boot-splash. It accumulates
drawing updates continuously without doing any drawing, until
a given deadline, then flushes the updates out all at once.
2023-12-17 07:57:47 -05:00
Ray Strode
cdc81fd4f7 Revert "ply-pixel-display: Pause the display and unpause it at a framerate"
This reverts commit 815d3c72e2.

This idea of pausing and unpausing updates at a given framerate is good,
but doing it at the ply-pixel-display level causes a proble with
monitor hotplug.
2023-12-17 07:57:02 -05:00
n3rdopolis
e8251d4f03 Merge branch 'fixconsoleviewerrefresh' into 'main'
splash plugins: Better handling the redraw of the console viewer when visible,...

See merge request plymouth/plymouth!257
2023-12-16 13:27:24 +00:00
nerdopolis
7f7c15fc26 splash plugins: Better handling the redraw of the console viewer when visible, and the splash state changes 2023-12-16 13:25:01 +00:00
nerdopolis
815d3c72e2 ply-pixel-display: Pause the display and unpause it at a framerate 2023-12-16 13:25:01 +00:00
nerdopolis
0083c97ffa ply-entry: Don't crash hiding an entry that is already hidden 2023-12-16 13:25:01 +00:00
nerdopolis
5f7b364d07 ply-console-viewer: introduce ply_console_viewer_clear_line () 2023-12-16 13:25:01 +00:00
nerdopolis
df86c73414 ply-console-viewer: Reorder the labels.
When there is less than 1 screenful of lines, the first line now appears at the top, more similar to a terminal emulator
2023-12-16 13:25:01 +00:00
nerdopolis
d0738917dd ply-terminal-emulator: Don't reject empty lines 2023-12-16 13:25:01 +00:00
Ray Strode
f5e0b9e06c Merge branch 'nullify-borrowed-bytes' into 'main'
ply-buffer: Nullify bytes outside scope block

See merge request plymouth/plymouth!262
2023-12-11 15:45:51 +00:00
Ray Strode
90a9174a81 ply-buffer: Nullify bytes outside scope block
ply_buffer_borrow_bytes is a new macro to make it possible to
temporarily alter the allocation of the underlying bytes of
a `ply_buffer_t` outside of `ply_buffer_t` specific methods.

This macro works by forcing the caller to use a scope block
to clearly delineate where the allocation modification is
occurring. This macro was inspired by the python `with` feature.

Unfortunately, the macro leaves the bytes initialized outside
the scope block, so there is some temptation to continue messing
with the allocation when it's not allowed.

This commit improves the macro to address that problem by nullifying
the passed in variables at the conclusion of the borrowing scope
block.
2023-12-11 10:42:46 -05:00
Ray Strode
3cff63128c Merge branch 'resilientunicode' into 'main'
ply-terminal-emulator: Handle incomplete Unicode characters with more resiliency

See merge request plymouth/plymouth!261
2023-12-11 03:14:31 +00:00
nerdopolis
27fd8d115c ply-terminal-emulator: Handle incomplete UTF-8 characters better
This commit introduces a state machine to better handle when part
of a UTF-8 character comes in immediately, and the rest of it
comes in later.

It also tries to better handle cases where control characters
are interleaved in the middle of UTF-8 characters.
2023-12-10 22:13:58 -05:00