SVN: geninitrd/trunk/mod-blkid.sh

glen glen at pld-linux.org
Mon Sep 17 14:22:04 CEST 2012


Author: glen
Date: Mon Sep 17 14:22:04 2012
New Revision: 12582

Modified:
   geninitrd/trunk/mod-blkid.sh
Log:
do not overwrite $ROOT if blkid fails

Modified: geninitrd/trunk/mod-blkid.sh
==============================================================================
--- geninitrd/trunk/mod-blkid.sh	(original)
+++ geninitrd/trunk/mod-blkid.sh	Mon Sep 17 14:22:04 2012
@@ -27,10 +27,12 @@
 	inst_exec $blkid /bin/blkid
 	initrd_gen_devices
 	add_linuxrc <<-'EOF'
-		# if built with blkid change ROOT=LABEL=something into ROOT=/dev/somethingelse -
-		# parsed by blkid
+		# if built with blkid change ROOT=LABEL=something into ROOT=/dev/device parsed by blkid
 		if [ "${ROOT##LABEL=}" != "${ROOT}" -o "${ROOT##UUID=}" != "${ROOT}" ]; then
-			ROOT="$(/bin/blkid -t $ROOT -o device -l)"
+			blkid="$(/bin/blkid -t $ROOT -o device -l)"
+			if [ -n "$blkid" ]; then
+				ROOT=$blkid
+			fi
 		fi
 	EOF
 }


More information about the pld-cvs-commit mailing list