SVN: geninitrd/trunk/mod-condecor.sh

glen glen at pld-linux.org
Mon Apr 6 17:11:52 CEST 2009


Author: glen
Date: Mon Apr  6 17:11:52 2009
New Revision: 10314

Added:
   geninitrd/trunk/mod-condecor.sh
Log:
- add missing file

Added: geninitrd/trunk/mod-condecor.sh
==============================================================================
--- (empty file)
+++ geninitrd/trunk/mod-condecor.sh	Mon Apr  6 17:11:52 2009
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# geninitrd mod: condecor
+
+# requires splashutils package to operate
+FB_CON_DECOR=no
+
+# setup geninitrd module
+# @access	public
+setup_mod_condecor() {
+	if is_yes "$FB_CON_DECOR" && [ "$INITRDFS" != "initramfs" ]; then
+		warn "Using fbcondecor requires INITRDFS=initramfs; skipping fbcondecor generation"
+		FB_CON_DECOR=no
+	fi
+}
+
+# generate initrd fragment
+# @access	public
+initrd_gen_fbcondecor() {
+	debug "Generating fbcondecor"
+
+	if [ ! -x /usr/bin/splash_geninitramfs -a ! -x /usr/sbin/splash_geninitramfs ]; then
+		warn "Failed to find splash_geninitramfs. Is splashutils package installed?"
+		return
+	fi
+
+	local splash_geninitramfs_bin=/usr/sbin/splash_geninitramfs
+	[ -f /usr/bin/splash_geninitramfs ] && splash_geninitramfs_bin=/usr/bin/splash_geninitramfs
+
+	if [ -r /etc/sysconfig/splash ]; then
+		. /etc/sysconfig/splash
+	fi
+
+	if [ -z "$SPLASH_THEME" ]; then
+		warn "Please configure your /etc/sysconfig/splash first."
+		warn "Generating of splashes skipped."
+		return
+	fi
+
+	if [ -z "$FB_SPLASH_RESOLUTIONS" ]; then
+		warn "No FB_SPLASH_RESOLUTIONS specified in /etc/sysconfig/splash."
+		warn "Not adding fbcondecor to initramfs."
+		return
+	fi
+
+	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 && \
+			debug "Added $res $SPLASH_THEME theme to initramfs."
+		else
+			warn "/etc/splash/$SPLASH_THEME/$res.cfg doesn't exist, skipped"
+		fi
+	done
+}


More information about the pld-cvs-commit mailing list