summaryrefslogtreecommitdiffstats
path: root/modules.d/slx-splash/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d/slx-splash/scripts')
-rwxr-xr-xmodules.d/slx-splash/scripts/slx-splash-exam.sh4
-rwxr-xr-xmodules.d/slx-splash/scripts/slx-splash-icon-hdd.sh4
-rwxr-xr-xmodules.d/slx-splash/scripts/slx-splash-init.sh42
-rwxr-xr-xmodules.d/slx-splash/scripts/slx-splash-stage4.sh (renamed from modules.d/slx-splash/scripts/restore-cursor.sh)18
4 files changed, 17 insertions, 51 deletions
diff --git a/modules.d/slx-splash/scripts/slx-splash-exam.sh b/modules.d/slx-splash/scripts/slx-splash-exam.sh
index 79160fc4..251f95c3 100755
--- a/modules.d/slx-splash/scripts/slx-splash-exam.sh
+++ b/modules.d/slx-splash/scripts/slx-splash-exam.sh
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
-type warn &>/dev/null || . /lib/dracut-lib.sh
-
-. /etc/openslx
+[ -n "$SLX_PXE_SERVER_IP" ] || . /etc/openslx
# Let's do this even in "no splash" mode to be sure
if [ -n "$SLX_EXAM" ]; then
diff --git a/modules.d/slx-splash/scripts/slx-splash-icon-hdd.sh b/modules.d/slx-splash/scripts/slx-splash-icon-hdd.sh
deleted file mode 100755
index 2b1ff4a3..00000000
--- a/modules.d/slx-splash/scripts/slx-splash-icon-hdd.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/ash
-
-grep -wq splash /proc/cmdline \
- && splashtool --icon "/opt/openslx/icons/active/??-hdd.ppm"
diff --git a/modules.d/slx-splash/scripts/slx-splash-init.sh b/modules.d/slx-splash/scripts/slx-splash-init.sh
deleted file mode 100755
index a4c71f88..00000000
--- a/modules.d/slx-splash/scripts/slx-splash-init.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env bash
-
-type warn &>/dev/null || source /lib/dracut-lib.sh
-
-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 -wq 'splash' /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:
- if splashtool --center /etc/splash.ppm -b; then
- splashtool --reset /opt/openslx/icons
- else
- # fbsplash failed, most likely due to missing /dev/fb0
- # -> reactivate systemd status messages
- kill -54 1
- fi
-fi
-
-true
diff --git a/modules.d/slx-splash/scripts/restore-cursor.sh b/modules.d/slx-splash/scripts/slx-splash-stage4.sh
index 4ba9880d..b88a6a90 100755
--- a/modules.d/slx-splash/scripts/restore-cursor.sh
+++ b/modules.d/slx-splash/scripts/slx-splash-stage4.sh
@@ -1,5 +1,11 @@
-#!/usr/bin/env bash
-#
+#!/bin/bash
+
+grep -qw 'splash' "/proc/cmdline" || return 0
+
+# Set option that we want splash
+
+echo "SLX_SPLASH='yes'" >> "$NEWROOT/opt/openslx/config"
+
# The console cursor is disabled when starting the splash screen.
# This will add a drop-in to getty@.service to ensure the cursor
# is restored when starting gettys.
@@ -9,3 +15,11 @@ cat <<- EOF > "$NEWROOT/etc/systemd/system/getty@.service.d/restore-cursor.conf"
[Service]
ExecStartPre=-/usr/bin/env bash -c "echo -en '\033c' > /dev/%I"
EOF
+
+# Copy icons and tools, so we can trigger the HDD icon in
+# setup-partitions.service
+
+cp -n "$( which splashtool )" "$NEWROOT/opt/openslx/bin/splashtool"
+cp -n -r "/opt/openslx/icons" -t "$NEWROOT/opt/openslx/"
+
+: