[readonly/geninitrd: 429/1068] - check produced romfs image size

draenog draenog at pld-linux.org
Sat Nov 2 19:48:25 CET 2013


commit a8b63949f32a8e1ca9ef606e2928359d454c5f42
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Fri Oct 5 15:27:51 2007 +0000

    - check produced romfs image size
    
    svn-id: @8786

 geninitrd | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/geninitrd b/geninitrd
index 2fffaf2..9b84126 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1531,6 +1531,11 @@ case "$INITRDFS" in
 		;;
 	rom)
 		genromfs -f "$IMAGE" -d "$MNTPOINT" -V "PLD initrd for kernel $kernel"
+		IMAGESIZE=$(stat -c %s $IMAGE | awk '{print int((($1/1024)+1023+512)/1024)*1024}')
+		debug 	"romfs image size: $IMAGESIZE ($IMAGE)"
+		if [ "$IMAGESIZE" -gt 4096 ]; then
+			echo >&2 "$0: Your image size is larger than 4096, Be sure to boot kernel with ramdisk_size=$IMAGESIZE!"
+		fi
 		;;
 	cram)
 		mkcramfs "$MNTPOINT" "$IMAGE"
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list