summaryrefslogtreecommitdiffstats
path: root/modules.d/50plymouth/plymouth-pretrigger.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:54:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:54:25 +0000
commit9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a (patch)
tree2efb72864cc69e174c9c5ee33efb88a5f1553b48 /modules.d/50plymouth/plymouth-pretrigger.sh
parentInitial commit. (diff)
downloaddracut-9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a.tar.xz
dracut-9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a.zip
Adding upstream version 060+5.upstream/060+5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules.d/50plymouth/plymouth-pretrigger.sh')
-rwxr-xr-xmodules.d/50plymouth/plymouth-pretrigger.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/modules.d/50plymouth/plymouth-pretrigger.sh b/modules.d/50plymouth/plymouth-pretrigger.sh
new file mode 100755
index 0000000..3d11999
--- /dev/null
+++ b/modules.d/50plymouth/plymouth-pretrigger.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if type plymouthd > /dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then
+ if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -d -n rd_NO_PLYMOUTH; then
+ # first trigger graphics subsystem
+ udevadm trigger --action=add --attr-match=class=0x030000 > /dev/null 2>&1
+ # first trigger graphics and tty subsystem
+ udevadm trigger --action=add \
+ --subsystem-match=graphics \
+ --subsystem-match=drm \
+ --subsystem-match=tty \
+ --subsystem-match=acpi \
+ > /dev/null 2>&1
+
+ udevadm settle --timeout=180 2>&1 | vinfo
+
+ info "Starting plymouth daemon"
+ mkdir -m 0755 /run/plymouth
+ read -r consoledev rest < /sys/class/tty/console/active
+ consoledev=${consoledev:-tty0}
+ [ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev"
+ plymouthd --attach-to-session --pid-file /run/plymouth/pid
+ plymouth --show-splash 2>&1 | vinfo
+ # reset tty after plymouth messed with it
+ [ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev"
+ fi
+fi