Commit graph

2701 commits

Author SHA1 Message Date
Ray Strode
a1996600eb command-parser: Don't add duplicate command to command list
ply_command_parser_get_options inexplicably adds a duplicate
command to the list of available subcommands every time it's
called. This must be some sort of cut and paste bug, it shouldn't
be modifying the list.

That leads to double frees when freeing the command parser.

This commit fixes that.

Related: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/175
2022-04-12 16:20:20 -04:00
Ray Strode
ac631853a8 client: Free command parser after event loop
commit ed7b1690f0 added an explicit
command parser free call on exit to make memory analysis tools
give better results.

That commit freed the command parser a little too early, though,
before the event loop gets freed and the event loop exit handlers
are run.

The command parser uses an exit handler to clear a weak reference
on the event loop, so freeing the command parser before the event
loop can lead to crash.

This commit moves the free call a little lower.

Related: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/175
2022-04-12 16:20:20 -04:00
Ray Strode
b603ac17e3 Merge branch 'wip/uncrustify-updates' into 'main'
.gitlab-ci: Don't regress formatting

See merge request plymouth/plymouth!174
2022-04-06 17:28:22 +00:00
Ray Strode
25523a2f87 .gitlab-ci: Don't regress formatting
The formatting in the codebase isn't perfect, but there's no
reason to make it worse.

This commit adds a CI check to make sure new code is styled
right.
2022-04-04 20:24:06 -04:00
Ray Strode
651c22f11a .gitlab-ci: Make it work better on merge requests
gitlab CI apparently exposes more useful environment variables
if `only: merge_requests` is put on each job, so do that.
2022-04-04 16:25:07 -04:00
Ray Strode
02bc090ce7 .gitlab-ci: Update Fedora version to 35
30 is ancient at this point.
2022-04-04 15:51:09 -04:00
Ray Strode
36f451f4f1 script: Enforce separate lines for function parameters
The moment it's possible to sneak in functions like:

static void
foo (int param1, int param2)
{
}

when the style requires parameters on separate lines.

This updates the uncrustify config to account for that.
2022-04-04 15:44:20 -04:00
Ray Strode
d021553e55 Merge branch 'check-shell-before-merge' into 'main'
.gitlab-ci: Check for shell errors in CI

See merge request plymouth/plymouth!172
2022-04-01 16:17:03 +00:00
Ray Strode
a586e59834 .gitlab-ci: Check for shell errors in CI
Recently a shell error snuck into CI and I didn't notice it because
it was in the tail end of a short-circuited conditional.

This commit adds a little shell validation to CI to avoid that
sort of thing in the future.
2022-04-01 12:11:00 -04:00
Ray Strode
fb2721bd82 Merge branch 'plymouth-set-default-theme' into 'main'
scripts: plymouth-set-default-theme reporting missing right brace

See merge request plymouth/plymouth!171
2022-04-01 14:47:58 +00:00
Eric Curtin
123ca59cf2 scripts: plymouth-set-default-theme reporting missing right brace
Fixes issue:

/usr/sbin/plymouth-set-default-theme: line 199: [: missing `]'

when executed as plymouth-set-default-theme spinner
2022-04-01 14:13:23 +01:00
Ray Strode
e40a59d2c2 Merge branch 'tt-keyfilter' into 'main'
core, script: add support for filtering input characters in plugins

See merge request plymouth/plymouth!169
2022-03-29 17:49:52 +00:00
Timo Teräs
5d1b49c601 core, script: add support for validating input characters in plugins
This adds also '\e' to be parsed as escape character in script strings.

Together these allow possibility to create scripts that allow only
numeric PINs, and prevent switching to text mode.
2022-03-29 17:28:00 +03:00
Ray Strode
88c54ffbee Merge branch 'set-default-theme-improvements' into 'main'
Improve plymouth-set-default-theme a bit

Closes #174

See merge request plymouth/plymouth!167
2022-03-28 16:26:46 +00:00
Ray Strode
fd961ef391 scripts: Support -R with -r and standalone for plymouth-set-default-theme
Right now plymouth-set-default-theme only supports rebuilding the initrd if a theme
is passed explicitly.

This commit improves the script to also work for --reset and even in a
standalone mode where no theme is passed at all.

Closes https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/174
2022-03-28 16:24:06 +00:00
Ray Strode
63cfc4eff5 scripts: Support short options being squished togethers for plymouth-set-default-theme
People expect to be able to squish short options together, so
this commit adds some glob matching to support that feature.
2022-03-28 16:24:06 +00:00
Ray Strode
28b8b4909f Merge branch 'mem-leak' into 'main'
client: fix memory leak state.client and state.loop

See merge request plymouth/plymouth!170
2022-03-28 15:30:38 +00:00
Eric Curtin
740c3b3370 event-loop: change assert to just check for is_running
Simlify assert in ply_event_loop_free, to check that the event loop is
not running.
2022-03-28 15:25:50 +00:00
Eric Curtin
8a7cf6e013 command-parser: add more free's
A couple of resources not free'd
2022-03-28 15:25:50 +00:00
Eric Curtin
ed7b1690f0 client: call cleanup functions everytime we return from main
We were not cleaning up allocated resources in many of the code
execution paths in main()
2022-03-28 15:25:50 +00:00
Ray Strode
bce1856745 Merge branch 'script-password-argument' into 'main'
script: add password argument to display password callback

Closes #150

See merge request plymouth/plymouth!166
2022-03-25 20:00:49 +00:00
Mateusz Piórkowski
29c1511738 script: add String.Length function
Add String.Length function which returns the length of a string.
It will make it possible to get the number of bullets from the
display prompt callback inside scripts.
2022-03-25 19:48:26 +01:00
Mateusz Piórkowski
853ec9c290 Add display_prompt function
Add display_prompt function which will be called for both passwords
and questions. This will make it possible to get a plaintext password
string.
SetDisplayPromptFunction will make it possible to set this callback
from a theme script.

Closes #150
2022-03-25 19:48:26 +01:00
Ray Strode
76c1bb6b2f Merge branch 'device-manager-fbdev-add-after-timeout' into 'main'
ply-device-manager: Accept new simpledrm/fbdev devices from udev events after timeout

Closes #167

See merge request plymouth/plymouth!165
2022-03-07 18:34:10 +00:00
Hans de Goede
9a48b3b532 ply-device-manager: Accept new simpledrm/fbdev devices from udev events after timeout
Before the device-timeout elapses verify_add_or_change () blocks new
simpledrm and fbdev getting added through udev add events because we
really only want native drm devices.

Then when the timeout triggers the list of udev devices existing at
that point int time is rescanned and any drm (including simpledrm) and
fbdev devices are added (filtering out duplicates).

But what if a simpledrm or fbdev device for some reason only shows
up after the timeout? Before this change those would then be ignored
for ever.

Add a manager->device_timeout_elapsed check and make verify_add_or_change ()
accept any drm + fbdev devices after the timeout. Note this addresses
a mostly theoretically issue since in practice a simpledrm or fbdev device
showing up later is very unlikely.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-03-07 15:12:09 +01:00
Hans de Goede
5acb3ceee3 ply-device-manager: verify_add_or_change(): Move local_console_is_text check
Move the local_console_is_text check outside of the
"if (subsytem == SUBSYSTEM_DRM)" block.

This check is equally relevant for SUBSYSTEM_FRAME_BUFFER.

Note by itself this is a no-op since verify_add_or_change() *always*
returns false for SUBSYSTEM_FRAME_BUFFER devices.

This is a preparation patch for making verify_add_or_change() not
return false when manager->device_timeout_elapsed is set.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-03-07 15:12:09 +01:00
Ray Strode
9ae5b7e760 Merge branch 'simpledrm-enumeration' into 'main'
ply-device-manager: Treat SimpleDRM drm devices as fbdev devices

Closes #167

See merge request plymouth/plymouth!163
2022-03-07 13:34:00 +00:00
Hans de Goede
83b385061c ply-device-manager: Treat SimpleDRM drm devices as fbdev devices
Simple-framebuffer devices driven by simpledrm lack information
like panel-rotation info and physical size, causing the splash
to briefly render on its side / without HiDPI scaling, switching
to the correct rendering when the native driver loads.

To avoid this treat simpledrm devices as fbdev devices and only
use them after the timeout.

Also adds 2 exceptions to this:

1. If nomodeset is passed on the kernel commandline then no native
drivers will load, so in this case it is best to immediately use
SimpleDRM devices when they are detected.

2. On some devics the firmware leave the panel black at boot. In this
case it is desirable to show the splash to the user ASAP so that there
is some visual feedback that the device is booting. Add a support for a
"plymouth.use-simpledrm" kernel cmdline option to show the splash
immediately on SimpleDRM devices rather then waiting for the native
driver to load.

Closes #167

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-03-07 12:30:12 +01:00
Hans de Goede
ab4238d548 ply-utils: Reintroduce ply_string_has_prefix helper
ply_string_has_prefix was dropped in commit c7965ea19a ("ply-utils:
Drop unused ply_string_has_prefix helper"). We have a need for this
helper again, so reintroduce it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-03-07 12:28:29 +01:00
Ray Strode
aef728a83d Merge branch 'misc-cleanups' into 'main'
Misc. cleanups

See merge request plymouth/plymouth!164
2022-02-28 18:56:25 +00:00
Hans de Goede
083763e9e5 ply-device-manager: Remove unnecessary subsystem != NULL check
The ply-device-manager.c already assumes that the return value of
udev_device_get_subsystem () is never NULL in many places, including
in the condition of the "else if" just below the check which is
being removed.

Remove the one lonely check for it being NULL for consistency.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-02-28 16:28:41 +01:00
Hans de Goede
da821831d6 ply-device-manager: Fix double-assignment of subsystem
The subsystem variable is also initialized with udev_device_get_subsystem ()
a couple of lines lower.

Remove the first initialization, so that udev_device_get_subsystem ()
does not get called unnecessary when the function exits early because
of the action value.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-02-28 16:28:41 +01:00
Hans de Goede
07a7a1c7ee gitignore: Add plymouthd-fd-escrow to gitignore
Add the new plymouthd-fd-escrow binary to gitignore.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-02-28 16:28:41 +01:00
Ray Strode
d7bd39aaa5 Merge branch 'main' into 'main'
Add support for CSI sequences

Closes #166

See merge request plymouth/plymouth!162
2022-02-22 15:41:50 +00:00
Mateusz Piórkowski
b41e40e065 Add support for CSI sequences 2022-02-22 15:41:49 +00:00
Ray Strode
6f298131a7 Merge branch 'ignore-clangd-files' into 'main'
Ignore generated files required by clangd

See merge request plymouth/plymouth!160
2022-02-16 21:57:40 +00:00
Hans Christian Schmitz
0f0014bbc5
Ignore generated files required by clangd
Also add .dirstamp which seems to be generated by
autoconf/automake/make.

`compile_commands.json` is also used by standalone `clang-tidy`
2022-02-16 22:44:20 +01:00
Ray Strode
aa0d6aa9aa Merge branch 'reproducible-build-fix' into 'main'
configure: Generate version from date of last commit not current date

See merge request plymouth/plymouth!158
2022-02-15 20:16:04 +00:00
Ray Strode
4ca7abf03e configure: Generate version from date of last commit not current date
Using the date at build time prevents the build from being reproducible
later.

In order to facilitate reproducible builds, this commit changes the
logic to derive the version from the date of the last commit.
2022-02-15 20:11:54 +00:00
Ray Strode
24160a53a7 Merge branch 'romanian-translation' into 'main'
Add Romanian translation

See merge request plymouth/plymouth!155
2022-02-07 18:00:12 +00:00
Sergiu Bivol
c277749f68 Add Romanian translation 2022-02-06 22:30:37 +00:00
Ray Strode
716b5bd9e2 Merge branch 'fix-buffer' into 'main'
drm: do not reset the buffer twice

See merge request plymouth/plymouth!152
2022-01-15 05:02:37 +00:00
Oleg Solovyov
5d75819462 drm: Retry setting scanout buffer on failure
Plymouth currently assumes that setting the scanout buffer will succeed.
if it fails because of a driver bug or transient failure it should try
again next frame.

This commit adds that error handling code.
2022-01-15 04:58:38 +00:00
Ray Strode
27764b2a2c Merge branch 'version-naming-change' into 'main'
autogoo: Determine project version from date

See merge request plymouth/plymouth!153
2022-01-11 17:10:11 +00:00
Ray Strode
7b203e49b9 autogoo: Determine project version from date
Numbers are arbitrary, and we've never successfully made it to
version 1.0 after like 15 years or something.

Furthermore, plymouth has a very slow release schedule at present
and some distros hate building from git.

So, I'd like to start generating tarballs more regularly.

Adopting a version number derived from the date will help facilitate
that.

This commit changes AC_INIT to compute the version automatically.

https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/143
https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/158
2022-01-11 10:38:28 -05:00
Ray Strode
a3dcafa8b2 Merge branch 'wip/use-logo-file' into 'main'
spinfinity: use logo file passed to configure

See merge request plymouth/plymouth!110
2022-01-11 14:35:27 +00:00
Ray Strode
729869f5c0 spinfinity: use logo file passed to configure
At the moment we hardcode the header to a logo file that ships
in fedora.

This commit changes it to use the logo configured by the distro.

https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/106
2022-01-11 14:28:45 +00:00
Ray Strode
3e75dda9e6 Merge branch 'weblate-plymouth-master' into 'main'
Translations update from Weblate

See merge request plymouth/plymouth!146
2022-01-11 14:26:24 +00:00
Yauhen Bugamol
d70a7e3d38 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/master
2022-01-11 14:26:09 +00:00
Ray Strode
39d374d8ec Merge branch 'add_croatian_language' into 'main'
Add Croatian language

See merge request plymouth/plymouth!148
2022-01-11 14:25:37 +00:00