diff options
Diffstat (limited to 'modules.d/slx-splash/scripts/slx-splash.sh')
-rw-r--r-- | modules.d/slx-splash/scripts/slx-splash.sh | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/modules.d/slx-splash/scripts/slx-splash.sh b/modules.d/slx-splash/scripts/slx-splash.sh deleted file mode 100644 index 69e2c4e4..00000000 --- a/modules.d/slx-splash/scripts/slx-splash.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash - -type warn &>/dev/null || source /lib/dracut-lib.sh - -show_splash() { - # first determine where to place the ppm - screen_size="$(fbset | awk '$1 = /geometry/ {print $2" "$3}')" - screen_width="${screen_size%% *}" - screen_height="${screen_size#* }" - fbsplash_cfg="/etc/fbsplash.cfg" - fbsplash_ppm="/etc/splash.ppm.gz" - if [ -s "$fbsplash_ppm" ]; then - ppm_size="$(zcat "$fbsplash_ppm" | sed -n 2p)" - else - fbsplash_ppm="/etc/splash.ppm" - if [ -s "$fbsplash_ppm" ]; then - ppm_size="$(sed -n 2p "$fbsplash_ppm")" - else - warn "Splash screen requested, but not found in initramfs..." - fi - fi - ppm_width="${ppm_size%% *}" - ppm_height="${ppm_size#* }" - ppm_height="${ppm_height%% *}" # make sure nothing weird is trailing - img_left="$(( ( screen_width - ppm_width ) / 2 ))" - img_top="$(( ( screen_height - ppm_height ) / 2 ))" - - # just checking if nothing too weird is set - if [ -n "$img_left" ] && [ -n "$img_top" ] \ - && [ "$img_left" -ge 0 ] && [ "$img_left" -lt 8096 ] \ - && [ "$img_top" -ge 0 ] && [ "$img_top" -lt 8096 ]; then - printf "IMG_TOP=%d\nIMG_LEFT=%d\n" \ - "$img_top" "$img_left" \ - > "$fbsplash_cfg" - fbsplash_args+=("-i" "$fbsplash_cfg") - fi - fbsplash -b -s "$fbsplash_ppm" "${fbsplash_args[@]}" -} - -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 -wqE '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 ! show_splash; then - # fbsplash failed, most likely due to missing /dev/fb0 - # -> reactivate systemd status messages - kill -54 1 - fi -fi - -true |