Commit graph

2588 commits

Author SHA1 Message Date
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
Ray Strode
e3aab2748b Merge branch 'fix-mkinitcpio-shutdown' into 'main'
systemd: Add mkinitcpio support to plymouth-switch-root-initramfs.service

See merge request plymouth/plymouth!202
2022-10-15 14:46:40 +00:00
Maxim Mikityanskiy
2f12aa4c5d systemd: Add mkinitcpio support to plymouth-switch-root-initramfs.service
plymouth-switch-root-initramfs.service commands plymouth to release
rootfs to allow the shutdown ramfs to unmount rootfs. However, it only
integrates with dracut. Arch Linux uses mkinitcpio by default, and it
uses shutdown ramfs when layered block storage (e.g. LUKS) is used for
rootfs. Therefore, it fails to unmount rootfs on shutdown if LUKS and
plymouth are used together.

Add a new trigger for plymouth-switch-root-initramfs.service to start
when /run/initramfs/shutdown exists (/run/initramfs/bin/sh may not exist
with mkinitcpio when systemd-based initramfs is used), and add a
dependency to start it after mkinitcpio generates the shutdown ramfs.
2022-10-15 14:44:03 +00:00
Hans de Goede
c09c651afe Merge branch 'simpledrm-coldplug-fix' into 'main'
ply-device-manager: Also ignore SimpleDRM devs in coldplug enumeration path

See merge request plymouth/plymouth!200
2022-10-03 09:10:57 +00:00
Hans de Goede
5dedca818f ply-device-manager: Also ignore SimpleDRM devs in coldplug enumeration path
Plymouth has 2 hw discovery paths:
1. Enumerating devices already known by udev at plymouth startup
2. Devices which are hotplugged after startup

At boot we have udevd which is enumerating hw and plymouthd racing
with each other, which means that plymouthd may discover the new
SimpleDRM device through either 1. or 2.

Before this patch a check for SimpleDRM was missing from path 1, causing
it to be treated as a normal device instead of being ignored as intended:

plymouth-debug.log for the simpledrm being enumerated in path 1:

ply-device-manager.c:344: create_devices_for_subsystem:
 found device /sys/devices/platform/simple-framebuffer.0/drm/card0
ply-device-manager.c:351: create_devices_for_subsystem:
 device is initialized
ply-device-manager.c:360: create_devices_for_subsystem:
 found node /dev/dri/card0
ply-device-manager.c:283: create_devices_for_udev_device:
 found DRM device /dev/dri/card0
ply-device-manager.c:885: create_devices_for_terminal_and_rende:
 creating devices for /dev/dri/card0 (renderer type: 1)

plymouth-debug.log for the simpledrm *not* being enumerated in path 1:

ply-device-manager.c:344: create_devices_for_subsystem:
 found device /sys/devices/platform/simple-framebuffer.0/drm/card0
ply-device-manager.c:367: create_devices_for_subsystem:
 it's not initialized

followed by path 2 enumerating the device very shortly after this:

ply-device-manager.c:532: on_udev_event:
 got add event for device /dev/dri/card0
ply-device-manager.c:462: verify_add_or_change:
 ignoring since we only handle SimpleDRM devices after timeout

Note how path 2 does correctly ignore SimpleDRM devices, where as
path 1 does not. This commit fixes this by moving the verify_drm_device()
check in to create_devices_for_udev_device() which runs in both paths.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2127663
Reported-by: Michael Catanzaro <mcatanza@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-09-28 15:41:58 +02:00
Hans de Goede
439c38ccc7 ply-device-manager: Move verify_drm_device() higher up in the file
Move verify_drm_device() higher up in ply-device-manager.c, this is
a preparation patch for the next patch in this series.

This is a pure move without any changes to the moved block.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-09-28 15:41:58 +02:00
Ray Strode
6f5dc63785 Merge branch 'fixreadmebuild' into 'main'
Fix build after README changes

See merge request plymouth/plymouth!199
2022-09-12 01:54:17 +00:00
n3rdopolis
58d0dece94 Fix build after README changes 2022-09-10 15:12:11 -04:00
Jim Farrell
9826df513c Merge branch 'jim.vzit-main-patch-40612' into 'main'
Jim.vzit main patch 40612

See merge request plymouth/plymouth!198
2022-09-07 18:09:33 +00:00
Jim Farrell
f43e8a32f0 Update Makefile.am 2022-09-07 18:07:31 +00:00
jim.vzit
ca0b765501 Add README in .md format. 2022-09-07 18:07:31 +00:00
Ray Strode
614d2db918 Merge branch 'ignore-non-desktop' into 'main'
drm: ignore non-desktop outputs

See merge request plymouth/plymouth!187
2022-08-30 17:26:20 +00:00
Xaver Hugl
4b8c1336a7 drm: ignore non-desktop outputs
It doesn't make sense to display a boot screen on virtual reality headsets
2022-08-30 17:23:19 +00:00
Ray Strode
9c5f356e89 Merge branch 'dont-uncrustify-on-debian' into 'main'
ci: Don't run uncrustify on debian

See merge request plymouth/plymouth!196
2022-08-30 15:15:20 +00:00
Ray Strode
bb6580212d ci: Don't run uncrustify on debian
The uncrustify is too old for the config we ship.
2022-08-30 09:54:51 -04:00
Ray Strode
30615d6560 Merge branch 'move-ci-to-debian-unstable' into 'main'
ci: Update to debian unstable

See merge request plymouth/plymouth!195
2022-08-30 13:20:03 +00:00
Ray Strode
25b60af88c ci: Update to debian unstable
It seems the uncrustify in debian stable is too old. Hopefully,
debian unstable has a new enough version.
2022-08-30 09:16:29 -04:00
Ray Strode
0b0e93c241 Merge branch 'kate/WIP/secureboot-check' into 'main'
plugins: splash: two-step: Secure boot check and a warning image

See merge request plymouth/plymouth!176
2022-08-11 16:27:53 +00:00
Kate Hsuan
98cf5fa56a plugins: splash: two-step: Secure boot check and a warning image
Secure boot is used against several security threats when malware tries to
infect the firmware of the system. Users may inadvertently disable or
software may intentionally disable the secure boot. Consequently, the
system is running on an insecure platform with incorrect configuration. If
Plymouth could offer a warning to the user, the user could reboot and
reconfigure their system or asks for help immediately.

This work can be used to check the secure boot configuration and put a red
warning image on the screen if the secure boot is disabled. Also, this
check can be utterly disabled through the kernel parameter for testing.
If the parameter "secure_boot.warn_if_disabled=false" appears in the
kernel parameter, the secure boot check will be disabled.

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2022-08-11 22:24:51 +08:00
Kate Hsuan
25f0932cba libply: ply-utils: Add ply_is_secure_boot_enabled () helper
This checks the secure boot status. If the secure boot are enabled,
return true. Otherwise, return false.

The system secure boot settings is at
/sys/firmware/efi/efivars/SecureBoot* and the fifth byte should be
0x1 which means the system secure boot is enabled.

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2022-08-11 22:24:40 +08:00
Ray Strode
52b0494de7 Merge branch 'move-ci-to-f37' into 'main'
ci: Update to fedora 37

See merge request plymouth/plymouth!185
2022-08-03 19:48:31 +00:00
Ray Strode
9dff465f0c ci: Update to fedora 37
It seems like uncrustify is changed slightly incompatibly between
35 and 37, so just move to 37.
2022-08-03 15:32:04 -04:00
Ray Strode
eb6d33782d scripts: Add -B to interdiff in check-format
It's currently complaining about an extra blank line in each file.
That's a little extreme.  Add -B.
2022-08-03 15:32:04 -04:00
Ray Strode
5f1e43c000 ply-utils: Drop linux/fs.h include
It was needed long ago for a function we no longer even have.

Now it's causing compile errors on Fedora 37 because it's conflicting
with sys/mount.h.

This commit drops it.
2022-08-03 15:32:04 -04:00
Ray Strode
98cb6ccbdb Merge branch 'drop-vim-lines' into 'main'
src: Drop vim: lines

See merge request plymouth/plymouth!184
2022-08-03 19:15:18 +00:00
Ray Strode
b849a3c54d src: Drop vim: lines
Many of the source files in tree have "vim:" lines to tell vim a
hint about our coding style.

Unfortunately, they were written when plymouth used the GNU coding
style, and it, of course, doesn't anymore.

This commit just drops them since the default vim indentation options
match pretty well with the plymouth coding style now, anyway.
2022-08-03 15:10:20 -04:00
Ray Strode
eb1b8935db Merge branch 'update-uncrustify-config' into 'main'
scripts: Update uncrustify config

See merge request plymouth/plymouth!183
2022-08-01 14:34:39 +00:00
Ray Strode
cd809faf9d scripts: Update uncrustify config
It looks like I forgot to merge the latest uncrustify config last
time I did an uncrustify run.

This commit puts it in place.
2022-08-01 14:32:08 +00:00
Ray Strode
4e40d8a49b Merge branch 'diff-less' into 'main'
scripts: Diff less

See merge request plymouth/plymouth!182
2022-07-29 19:07:17 +00:00
Ray Strode
26fde15195 scripts: Diff less
I think check-format.sh might get into trouble in some cases when
a non source file gets changed.

This commit makes the diffing more targeted
2022-07-29 15:03:43 -04:00
Ray Strode
0d30fe5957 Merge branch 'cut-the-crust' into 'main'
src: Run through uncrustify

See merge request plymouth/plymouth!181
2022-07-29 13:21:10 +00:00
Ray Strode
e483f0c4fe src: Run through uncrustify
I was going to fix the preexisting style issues piecewise as they're
changed, but it's actually making reviewing patchsets noisy.

This commit just bites the bullet and does a full run through
uncrustify.
2022-07-29 09:16:44 -04:00
Ray Strode
9e72df3d8a Merge branch 'runtimedir-fix' into 'main'
Make use of standard --runstatedir flag vs custom --with-runtimedir

See merge request plymouth/plymouth!178
2022-07-19 18:32:22 +00:00
Ben Brown
4c90a66fb7 Fix daemon install ignoring configured runstatedir 2022-07-19 19:09:44 +01:00
Ben Brown
97012d2c38 Use standard runstatedir vs custom flag 2022-07-19 19:09:33 +01:00
Ray Strode
e96011133a Merge branch 'fix-exit-crash' into 'main'
client: Free command parser after event loop

Closes #175

See merge request plymouth/plymouth!175
2022-04-12 23:46:01 +00:00
Ray Strode
13799d9d84 script: Don't crash for scripts without input validation functions
commit 5d1b49c601 adds support for
filtering input to plymouthd and the script plugin.

The script plugin additions, unfortunately, fail to properly handle
scripts that don't add a validation function.

This commit fixes that by assuming no validation function means
no filtering.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/175
2022-04-12 17:25:50 -04:00
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