packages: lesspipe/lesspipe.sh - initrd: handle also romfs images

glen glen at pld-linux.org
Sun Dec 19 13:10:02 CET 2010


Author: glen                         Date: Sun Dec 19 12:10:02 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- initrd: handle also romfs images

---- Files affected:
packages/lesspipe:
   lesspipe.sh (1.45 -> 1.46) 

---- Diffs:

================================================================
Index: packages/lesspipe/lesspipe.sh
diff -u packages/lesspipe/lesspipe.sh:1.45 packages/lesspipe/lesspipe.sh:1.46
--- packages/lesspipe/lesspipe.sh:1.45	Sun Dec 19 12:19:56 2010
+++ packages/lesspipe/lesspipe.sh	Sun Dec 19 13:09:57 2010
@@ -52,6 +52,12 @@
 	echo "$ft:${ft2#$tmp/initrd.img:}"
 	case "$ft2" in
 	*cpio?archive*)
+		install -d $tmp/initrd
+		(cd $tmp/initrd && cpio -dimu --quiet < $tmp/initrd.img)
+		;;
+	*romfs?filesystem*)
+		install -d $tmp/initrd
+		mount -ro loop $tmp/initrd.img $tmp/initrd
 		;;
 	*)
 		rm -rf $tmp
@@ -59,17 +65,16 @@
 		;;
 	esac
 
-	local out=$(cpio -itv --quiet < $tmp/initrd.img)
-	echo "initrd contents:"
-	echo "$out"
+	(cd $tmp/initrd; ls -lR)
 
 	# also display linuxrc
-	if [[ "$out" == *linuxrc* ]] ;then
+	if [ -f $tmp/initrd/linuxrc ]; then
 		echo ""
 		echo "/linuxrc program:"
-		(cd $tmp && cpio -dimu --quiet < $tmp/initrd.img)
-		cat $tmp/linuxrc
+		cat $tmp/initrd/linuxrc
 	fi
+
+	mountpoint -q $tmp/initrd && umount $tmp/initrd
 
 	rm -rf $tmp
 	return 0
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/lesspipe/lesspipe.sh?r1=1.45&r2=1.46&f=u



More information about the pld-cvs-commit mailing list