Commit graph

2843 commits

Author SHA1 Message Date
Ray Strode
ed3e4c8a11 Merge branch 'freetype-metrics-fix' into 'main'
label-freetype: Ensure font metrics are up to date when querying dimensions

See merge request plymouth/plymouth!285
2023-12-28 18:44:18 +00:00
Ray Strode
97516094e4 label-freetype: Ensure font metrics are up to date when querying dimensions
If code calls ply_label_get_width without ply_label_show or some other
call that forces the dimensions to be computed first, then the returned
width will be wrong.

This commit makes the freetype plugin look more like the pango plugin
where the size will computed on demand when querying the width, if
necessary.
2023-12-28 13:39:19 -05:00
Ray Strode
a44ffaf8ed Merge branch 'freetype-font-debugging' into 'main'
Improve font loading error debug messages in freetype plugin

See merge request plymouth/plymouth!284
2023-12-28 17:32:15 +00:00
Ray Strode
8cd615f188 label-freetype: Log font loading error
Right now if there's an error loading a font we quietly just
proceed.

This commit adds a debug log message saying what the error is.
2023-12-28 17:31:48 +00:00
Ray Strode
d8fd8e222c label-freetype: Don't bother loading fallback font if it doesn't exist
If the fallback font doesn't exist, we shouldn't even try to load it,
there's no point.

Instead, put a nice error in the log.
2023-12-28 17:31:48 +00:00
Ray Strode
e989867f48 ply-utils: Use lstat instead of stat for ply_file_exists
If a file is a symlink, we usually want to follow it, so
testing the symlink itself, is less than optimal.

This commit switches to lstat instead of stat.
2023-12-28 17:31:48 +00:00
Ray Strode
746078e89d Merge branch 'pango-console-viewer-fixes' into 'main'
console viewer fixes with the pango label plugin

See merge request plymouth/plymouth!283
2023-12-28 16:54:10 +00:00
Ray Strode
d4759a7766 ply-console-viewer: Make free function NULL safe 2023-12-28 11:51:09 -05:00
Ray Strode
b06435001b label-pango: Pass explicit width when computing height
pango will give a height that's several orders of magnitude too
big sometimes when the width is -1.

This commit checks for -1, explicitly measures the width first, and
remeasures with that width passed in to compute the height.
2023-12-28 11:45:43 -05:00
Ray Strode
d0f90388da ply-console-viewer: Disallow zero lines
A logic error meant the console viewer can end up being zero lines.

This commit fixes that.
2023-12-28 11:35:10 -05:00
Ray Strode
1b6c4b8684 label-pango: Fix inverted conditional
Right now we skip sizing the control when force == true because
of an inverted conditional.

This commit fixes that.
2023-12-28 10:53:02 -05:00
Ray Strode
07992537e8 ply-console-viewer: Fix typo
The last commit had a typo where it would never prefer console viewer.

This commit fixes that.
2023-12-28 10:03:05 -05:00
Ray Strode
8479450804 Merge branch 'console-viewer-crasher-fix' into 'main'
ply-console-viewer: Handle fonts failing to load better

See merge request plymouth/plymouth!282
2023-12-28 15:01:18 +00:00
Ray Strode
1a3251c43f two-step: Be more tolerant when there's no console viewer
There are still a number of places in the code where a console
viewer is expected, when it's totally possible that there won't
be one.

This commit runs through them, and does a few other style
cleanups on the way.
2023-12-28 09:36:06 -05:00
Ray Strode
0c62d4a0cf space-flares: Be more tolerant when there's no console viewer
There are still a number of places in the code where a console
viewer is expected, when it's totally possible that there won't
be one.

This commit runs through them, and does a few other style
cleanups on the way.
2023-12-28 09:36:06 -05:00
Ray Strode
6359b6715e fade-throbber: Be more tolerant when there's no console viewer
There are still a number of places in the code where a console
viewer is expected, when it's totally possible that there won't
be one.

This commit runs through them, and does a few other style
cleanups on the way.
2023-12-28 09:31:08 -05:00
Ray Strode
f281978ce8 ply-console-viewer: Handle fonts failing to load better
Right now we divide by zero if the font metrics can't be determined
and tank.

This commit attempts to detect the situation and fall back to using
kernel fb console in that case.
2023-12-28 08:59:25 -05:00
Ray Strode
197d580383 Merge branch 'catch-sigfpe' into 'main'
main: Catch floating point exceptions in crasher handler too

See merge request plymouth/plymouth!281
2023-12-28 13:05:22 +00:00
Ray Strode
9d8c62af24 main: Catch floating point exceptions in crasher handler too
Right now we catch the two big types of crashes:

1. Segmentation fault
2. Assertion failure

But we don't catch another common type, "Divide by zero"

This commit fixes that.
2023-12-28 07:48:43 -05:00
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