SVN: geninitrd/trunk/geninitrd

glen glen at pld-linux.org
Tue Apr 22 17:19:45 CEST 2008


Author: glen
Date: Tue Apr 22 17:19:40 2008
New Revision: 9717

Modified:
   geninitrd/trunk/geninitrd
Log:
- add --with-fbcondecor
- let different different splashes and suspend be added to initrd. results are unexpected but all is possible

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Tue Apr 22 17:19:40 2008
@@ -41,10 +41,12 @@
 rootdev_nr=0
 # device node for rootfs from fstab
 rootdev=""
-# default bootsplash is off, if it have to be on, install bootsplash package
+# requires bootsplash package to operate
 BOOT_SPLASH=no
-# default same as bootsplash, if on install splashutils and some splashutils theme
+# requires splashutils package to operate
 FB_SPLASH=no
+# requires splashutils package to operate
+FB_CON_DECOR=no
 
 # internal variables
 # is /dev on tmpfs
@@ -84,7 +86,8 @@
 	echo "       [--initrdfs=rom|initramfs|ext2|cram] [--modules-conf=<modules.conf>]"
 	echo "       [--with-raidstart] [--without-raidstart] [--with-insmod-static]"
 	echo "       [--with-bootsplash] [--without-bootsplash]"
-	echo "       [ --with-fbsplash] [--without-fbsplash]"
+	echo "       [--with-fbsplash] [--without-fbsplash]"
+	echo "       [--with-fbcondecor] [--without-fbcondecor]"
 	echo "       [--lvmtoolsversion=1|2] [--with-udev] [--without-udev]"
 	echo "       [--with-suspend] [--without-suspend]"
 	echo "       [--with-tuxonice] [--without-tuxonice]"
@@ -1167,14 +1170,7 @@
 		return
 	fi
 
-	local splash_geninitramfs
-	if [ -x /usr/bin/splash_geninitramfs ]; then
-		splash_geninitramfs=/usr/bin/splash_geninitramfs
-	elif [ -x /usr/sbin/splash_geninitramfs ]; then
-		splash_geninitramfs=/usr/sbin/splash_geninitramfs
-	fi
-
-	if [ -z "$splash_geninitramfs" ]; then
+	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
@@ -1197,7 +1193,46 @@
 
 	for res in $FB_SPLASH_RESOLUTIONS; do
 		if [ -f "/etc/splash/$SPLASH_THEME/$res.cfg" ]; then
-			$splash_geninitramfs -c $DESTDIR -r $res $SPLASH_THEME && \
+			/usr/bin/splash_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"
+		fi
+	done
+}
+
+initrd_gen_fbcondecor() {
+	debug "Generating fbcondecor"
+
+	if [ "$INITRDFS" != "initramfs" ]; then
+		warn "Using fbcondecor requires INITRDFS=initramfs; skipping fbcondecor generation"
+		return
+	fi
+
+	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
+
+	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
+			/usr/sbin/splash_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"
@@ -1545,6 +1580,12 @@
 	--without-fbsplash)
 		FB_SPLASH=no
 		;;
+	--with-fbcondecor)
+		FB_CON_DECOR=yes
+		;;
+	--without-fbcondecor)
+		FB_CON_DECOR=no
+		;;
 	--with-suspend)
 		USE_SUSPEND=yes
 		;;
@@ -1738,15 +1779,11 @@
 fi
 
 if is_yes "$USE_SUSPEND" && is_yes "$USE_TUXONICE"; then
-	warn "Tuxonice can't be used in parallel with mainline suspend! Disabling both inclustion to initrd"
-	USE_SUSPEND=no
-	USE_TUXONICE=no
+	warn "Tuxonice and mainline suspend are exclusive!"
 fi
 
 if is_yes "$FB_SPLASH"  && is_yes "$BOOT_SPLASH"; then
-	warn "You can't use bootsplash and fbsplash together! Disabling both inclusion to initrd"
-	FB_SPLASH=no
-	BOOT_SPLASH=no
+	warn "bootsplash and fbsplash are exclusive!"
 fi
 
 if [ ! -f /proc/mounts ]; then
@@ -2016,6 +2053,10 @@
 	initrd_gen_fbsplash
 fi
 
+if is_yes "$FB_CON_DECOR"; then
+	initrd_gen_fbcondecor
+fi
+
 IMAGE=$(mktemp -t initrd.img-XXXXXX) || die "mktemp failed"
 
 debug "Creating $INITRDFS image $IMAGE"


More information about the pld-cvs-commit mailing list