[readonly/geninitrd: 533/1068] - gensplash also requires initramfs - made both splashes more standalone (moved their stuff together

draenog draenog at pld-linux.org
Sat Nov 2 19:57:13 CET 2013


commit 7992356a4aee768f69bbfa2695e3297020941aed
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Mon Nov 19 17:02:40 2007 +0000

    - gensplash also requires initramfs
    - made both splashes more standalone (moved their stuff together)
    
    svn-id: @9069

 geninitrd | 68 ++++++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 39 insertions(+), 29 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 9b4dd8b..ebe038e 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1139,36 +1139,57 @@ initrd_gen_bootsplash() {
 	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 @@ if [ -r /etc/sysconfig/geninitrd ]; then
 	. /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 @@ if [ ! -d "/lib/modules/$kernel" ]; then
 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 @@ else
 	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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090



More information about the pld-cvs-commit mailing list