SVN: geninitrd/trunk/geninitrd

glen glen at pld-linux.org
Mon Nov 19 18:02:41 CET 2007


Author: glen
Date: Mon Nov 19 18:02:40 2007
New Revision: 9069

Modified:
   geninitrd/trunk/geninitrd
Log:
- gensplash also requires initramfs
- made both splashes more standalone (moved their stuff together)

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Mon Nov 19 18:02:40 2007
@@ -1139,36 +1139,57 @@
 	local target="$1"
 
 	debug "Generating bootsplash"
+
+	if [ "$INITRDFS" != "initramfs" ]; then
+		die "Using bootsplash requires INITRDFS=initramfs!"
+	fi
+
 	if [ ! -x /bin/splash.bin ]; then
 		warn "Failed to execute /bin/splash.bin. Is bootsplash package installed?"
-	elif [ -z "$THEME" ]; then
+		return
+	fi
+
+	if [ -r /etc/sysconfig/bootsplash ]; then
+		. /etc/sysconfig/bootsplash
+	fi
+
+	if [ -z "$THEME" ]; then
 		warn "Please configure your /etc/sysconfig/bootsplash first."
 		warn "Generating bootsplashes skipped."
-	else
-		if [ -n "$BOOT_SPLASH_RESOLUTIONS" ]; then
-			for res in $BOOT_SPLASH_RESOLUTIONS; do
-				if [ -f "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" ]; then
-					/bin/splash.bin -s -f "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" >> "$target" && \
-					debug "Added $res $THEME theme to initrd."
-				else
-					warn "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg doesn't exist, skipped"
-				fi
-			done
+		return
+	fi
+
+	if [ -z "$BOOT_SPLASH_RESOLUTIONS" ]; then
+		warn "No BOOT_SPLASH_RESOLUTIONS specified in /etc/sysconfig/bootsplash."
+		warn "Not adding bootsplash to initrd."
+	fi
+
+	for res in $BOOT_SPLASH_RESOLUTIONS; do
+		if [ -f "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" ]; then
+			/bin/splash.bin -s -f "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" >> "$target" && \
+			debug "Added $res $THEME theme to initrd."
 		else
-			warn "No BOOT_SPLASH_RESOLUTIONS specified in /etc/sysconfig/bootsplash."
-			warn "Not adding bootsplash to initrd."
+			warn "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg doesn't exist, skipped"
 		fi
-	fi
+	done
 }
 
 initrd_gen_fbsplash() {
 	debug "Generating fbsplash"
 
+	if [ "$INITRDFS" != "initramfs" ]; then
+		die "Using fbsplash requires INITRDFS=initramfs!"
+	fi
+
 	if [ ! -x /usr/bin/splash_geninitramfs ]; then
 		warn "Failed to execute /usr/bin/splash_geninitramfs. Is splashutils package installed?"
 		return
 	fi
 
+	if [ -r /etc/sysconfig/fbsplash ]; then
+		. /etc/sysconfig/fbsplash
+	fi
+
 	if [ -z "$SPLASH_THEME" ]; then
 		warn "Please configure your /etc/sysconfig/fbsplash first."
 		warn "Generating fbsplashes skipped."
@@ -1459,14 +1480,6 @@
 	. /etc/sysconfig/geninitrd
 fi
 
-if [ -r /etc/sysconfig/bootsplash ]; then
-	. /etc/sysconfig/bootsplash
-fi
-
-if [ -r /etc/sysconfig/fbsplash ]; then
-	. /etc/sysconfig/fbsplash
-fi
-
 if [ ! -x /bin/initrd-busybox ]; then
 	die "/bin/initrd-busybox is missing!"
 fi
@@ -1702,15 +1715,11 @@
 fi
 
 if is_yes "$USE_SUSPEND" && is_yes "$USE_TUXONICE"; then
-	die "Tuxonice shouldn't be used in parallel with mainline suspend!."
+	die "Tuxonice shouldn't be used in parallel with mainline suspend!"
 fi
 
-if is_yes "$FB_SPLASH"; then
-	if is_yes "$BOOT_SPLASH"; then
-		die "You can't use both bootsplash and fbsplash! Please choose one."
-	elif [ "$INITRDFS" != "initramfs" ]; then
-		die "FB_SPLASH works only if INITRDFS is initramfs!."
-	fi
+if is_yes "$FB_SPLASH"  && is_yes "$BOOT_SPLASH"; then
+	die "You can't use both bootsplash and fbsplash! Please choose one."
 fi
 
 if [ ! -f /proc/mounts ]; then
@@ -2016,6 +2025,7 @@
 	cp -a "$IMAGE" "$target"
 fi
 
+# XXX. check if bootsplash can output data to tmp dir not directly to initramfs image.
 if is_yes "$BOOT_SPLASH"; then
 	initrd_gen_bootsplash "$target"
 fi


More information about the pld-cvs-commit mailing list