summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-05-23 12:09:49 +0200
committerJonathan Bauer2018-05-23 12:09:49 +0200
commit9149d134cdd6c214ba0c253b8e9912ff8ff75045 (patch)
tree9b51aa87c804246a218444655bbfcf290eaeee25
parentupdate to dracut v47 (diff)
downloadsystemd-init-9149d134cdd6c214ba0c253b8e9912ff8ff75045.tar.gz
systemd-init-9149d134cdd6c214ba0c253b8e9912ff8ff75045.tar.xz
systemd-init-9149d134cdd6c214ba0c253b8e9912ff8ff75045.zip
new slx-drm and slx-splash (PoC) modules
slx-drm pulls in dracut's drm module and provides a modprobe.d configurations file to always prioritize nvidia drivers, falling back to nouveau on failures. slx-splash uses the slx busybox's fbsplash (WIP). Busybox is still missing from defaults builds, so this won't function out of the box!
-rw-r--r--builder/modules.d/slx-drm/data/nvidia-nouveau-fallback.conf2
-rwxr-xr-xbuilder/modules.d/slx-drm/module-setup.sh16
-rw-r--r--builder/modules.d/slx-splash/data/splash.ppm.gzbin0 -> 11233 bytes
-rwxr-xr-xbuilder/modules.d/slx-splash/module-setup.sh13
-rw-r--r--builder/modules.d/slx-splash/scripts/slx-splash.sh42
5 files changed, 73 insertions, 0 deletions
diff --git a/builder/modules.d/slx-drm/data/nvidia-nouveau-fallback.conf b/builder/modules.d/slx-drm/data/nvidia-nouveau-fallback.conf
new file mode 100644
index 00000000..76b0793f
--- /dev/null
+++ b/builder/modules.d/slx-drm/data/nvidia-nouveau-fallback.conf
@@ -0,0 +1,2 @@
+install nouveau [ -e /sys/module/nvidia ] || { /sbin/modprobe --ignore-install nvidia || /sbin/modprobe --ignore-install nouveau $CMDLINE_OPTS ; }
+install nvidia /sbin/modprobe --ignore-install nvidia $CMDLINE_OPTS || /sbin/modprobe --ignore-install nouveau
diff --git a/builder/modules.d/slx-drm/module-setup.sh b/builder/modules.d/slx-drm/module-setup.sh
new file mode 100755
index 00000000..8530b2d0
--- /dev/null
+++ b/builder/modules.d/slx-drm/module-setup.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+check() {
+ # Tell dracut that this module should only be included if it is required
+ # explicitly.
+ return 255
+}
+depends() {
+ echo drm
+}
+installkernel() {
+ instmods acpi_ipmi
+}
+install() {
+ mkdir -p "$initdir/etc/modprobe.d"
+ cp "$moddir/data/nvidia-nouveau-fallback.conf" "$initdir/etc/modprobe.d"
+}
diff --git a/builder/modules.d/slx-splash/data/splash.ppm.gz b/builder/modules.d/slx-splash/data/splash.ppm.gz
new file mode 100644
index 00000000..d30d44e2
--- /dev/null
+++ b/builder/modules.d/slx-splash/data/splash.ppm.gz
Binary files differ
diff --git a/builder/modules.d/slx-splash/module-setup.sh b/builder/modules.d/slx-splash/module-setup.sh
new file mode 100755
index 00000000..6abd06e0
--- /dev/null
+++ b/builder/modules.d/slx-splash/module-setup.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+check() {
+ # Tell dracut that this module should only be included if it is required
+ # explicitly.
+ return 255
+}
+depends() {
+ echo slx-drm
+}
+install() {
+ cp "$moddir/data/splash.ppm.gz" "$initdir/etc/splash.ppm.gz"
+ inst_hook pre-trigger 10 "$moddir/scripts/slx-splash.sh"
+}
diff --git a/builder/modules.d/slx-splash/scripts/slx-splash.sh b/builder/modules.d/slx-splash/scripts/slx-splash.sh
new file mode 100644
index 00000000..8f3ccec3
--- /dev/null
+++ b/builder/modules.d/slx-splash/scripts/slx-splash.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+
+show_splash() {
+ if [ -e "/etc/splash.ppm.gz" ]; then
+ /usr/bin/systemd-preserve-process-marker /bin/busybox fbsplash -x -b -s "/etc/splash.ppm.gz" &
+ elif [ -e "/etc/splash.ppm" ]; then
+ /usr/bin/systemd-preserve-process-marker /bin/busybox fbsplash -x -b -s "/etc/splash.ppm" &
+ else
+ echo "Splash screen requested, but not found in initramfs..."
+ fi
+}
+
+init_drm() {
+ # taken from dracut's plymouth module
+ # 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
+}
+
+if grep -qE '\s+splash\s+' /proc/cmdline; then
+ # first init graphics
+ init_drm
+ # disable non-critical kernel messages
+ echo "1 1 0 1" > /proc/sys/kernel/printk
+ # disable systemd's status message on console
+ # See: https://www.freedesktop.org/software/systemd/man/systemd.html#Signals
+ kill -55 1
+ # clear console
+ busybox clear
+ # disable cursor
+ echo -e "\033[?25l" > /dev/console
+ # finally:
+ show_splash
+fi