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>
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.
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>
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>
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>
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>
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.
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.
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.
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
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
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
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.
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.
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.