]> git.pld-linux.org Git - projects/geninitrd.git/blobdiff - mod-fbsplash.sh
Version 12531.
[projects/geninitrd.git] / mod-fbsplash.sh
index ec848291136666fd002d2347b1507e28a3d3a74f..a9ed6ca505e5fd340f484acab36d96960d2a26e2 100644 (file)
@@ -1,13 +1,20 @@
 #!/bin/sh
-#
+FBSPLASH_RCSID='$Revision$ $Date::                            $'
+
 # geninitrd mod: fbsplash
+FB_SPLASH=${FB_SPLASH:-no}
 
 # requires splashutils package to operate
-FB_SPLASH=no
 
 # setup geninitrd module
 # @access      public
 setup_mod_fbsplash() {
+       fbsplash_geninitramfs=$(find_tool /usr/sbin/splash_geninitramfs /usr/bin/splash_geninitramfs)
+       if [ ! -x "$fbsplash_geninitramfs" ]; then
+               FB_SPLASH=no
+               return
+       fi
+
        if is_yes "$FB_SPLASH" && [ "$INITRDFS" != "initramfs" ]; then
                warn "Using fbsplash requires INITRDFS=initramfs; skipping fbsplash generation"
                FB_SPLASH=no
@@ -32,14 +39,10 @@ find_modules_fbsplash() {
 # generate initrd fragment
 # @access      public
 initrd_gen_fbsplash() {
-       debug "Generating fbsplash"
-
-       if [ ! -x /usr/bin/splash_geninitramfs -a ! -x /usr/sbin/splash_geninitramfs ]; then
-               warn "Failed to find splash_geninitramfs. Is splashutils package installed?"
+       if ! is_yes "$FB_SPLASH"; then
                return
        fi
-       local splash_geninitramfs_bin=/usr/sbin/splash_geninitramfs
-       [ -f /usr/bin/splash_geninitramfs ] && splash_geninitramfs_bin=/usr/bin/splash_geninitramfs
+       debug "Generating fbsplash"
 
        if [ -r /etc/sysconfig/fbsplash ]; then
                . /etc/sysconfig/fbsplash
@@ -57,9 +60,10 @@ initrd_gen_fbsplash() {
                return
        fi
 
+       local res
        for res in $FB_SPLASH_RESOLUTIONS; do
                if [ -f "/etc/splash/$SPLASH_THEME/$res.cfg" ]; then
-                       $splash_geninitramfs_bin -c $DESTDIR -r $res $SPLASH_THEME && \
+                       $fbsplash_geninitramfs -c $DESTDIR -r $res $SPLASH_THEME && \
                        debug "Added $res $SPLASH_THEME theme to initramfs."
                else
                        warn "/etc/splash/$SPLASH_THEME/$res.cfg doesn't exist, skipped"
This page took 0.270248 seconds and 4 git commands to generate.