summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Neumann2017-05-18 20:28:36 +0200
committerRichard Neumann2017-05-18 20:28:36 +0200
commitcfba9269d1a12c910928c724a30c9b4c9a003cd1 (patch)
tree43914b90cc866d70537ceae514bc19791e434d94
parentbcb64c008e47ed1ce74ab1f465389f8b3849fd84 (diff)
downloadaur-cfba9269d1a12c910928c724a30c9b4c9a003cd1.tar.gz
Added checking for framebuffer device and redirected error messages to stderr
-rw-r--r--.SRCINFO2
-rw-r--r--fbsplash.hook13
2 files changed, 10 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 02725a191ae8..07c80acf0d95 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Thu May 18 18:24:08 UTC 2017
+# Thu May 18 18:28:00 UTC 2017
pkgbase = mkinitcpio-fbsplash
pkgdesc = Tools to include a framebuffer based boot splash within the initcpio
pkgver = 1.0.1
diff --git a/fbsplash.hook b/fbsplash.hook
index abd1c7f6a276..a33d2f05d950 100644
--- a/fbsplash.hook
+++ b/fbsplash.hook
@@ -2,12 +2,17 @@
# Copies the splash image into the framebuffer device
run_hook() {
+ local FBDEV="/dev/fb0"
local SPLASH_IMAGE="/etc/splash.fb"
- if [ -f "${SPLASH_IMAGE}" ]; then
- dd if=${SPLASH_IMAGE} of=/dev/fb0 2> /dev/null
+ if [ -c "${FBDEV}" ]; then
+ if [ -f "${SPLASH_IMAGE}" ]; then
+ dd if="${SPLASH_IMAGE}" of="${FBDEV}" 2> /dev/null
+ else
+ echo "Cannot find ${SPLASH_IMAGE}." >&2
+ echo "Did you include it in the \"FILES=...\" of your /etc/mkinitcpio.conf?" >&2
+ fi
else
- echo "Cannot find ${SPLASH_IMAGE}."
- echo "Did you include it in the \"FILES=...\" of your /etc/mkinitcpio.conf?"
+ echo "Framebuffer device \"${FBDEV}\" is not present." >&2
fi
}