geninitrd/trunk/geninitrd

arekm cvs at pld-linux.org
Sat Mar 25 22:30:50 CET 2006


Author: arekm
Date: Sat Mar 25 22:30:47 2006
New Revision: 7319

Modified:
   geninitrd/trunk/geninitrd
Log:
Hacky initramfs support (and of course not working yet).

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Sat Mar 25 22:30:47 2006
@@ -804,11 +804,12 @@
 if [ "x" = "x$INITRDFS" ] ; then
 	if [ "x" = "x$FS" ] ; then
 		# default value
-#		if [ "$pack_version" -ge "002005" ] ; then
-#		    INITRDFS="initramfs"
-#		else
+		# XXX: initramfs blocked for now
+		if [ "1" = " 0" -a "$pack_version" -ge "002005" ] ; then
+		    INITRDFS="initramfs"
+		else
 		    INITRDFS="rom"
-#		fi
+		fi
 	else
 		echo "Warning: FS configuration options is obsoleted. Use INITRDFS instead" 1>&2
 		INITRDFS="$FS"
@@ -1288,6 +1289,16 @@
 	initrd_gen_procdata
 fi
 
+if [ "$INITRDFS" = "initramfs" ]; then
+	mkdir -p $MNTIMAGE/newroot
+	cp -HR $org_rootdev $MNTIMAGE/dev
+	echo "mount -t $rootFs $org_rootdev /newroot" >> "$s"
+	echo "switch_root /newroot /sbin/init" >> "$s"
+	# we need real file, not symlink
+	rm -f $MNTIMAGE/init
+	cp -a $MNTIMAGE/linuxrc $MNTIMAGE/init
+fi
+
 chmod +x "$RCFILE"
 
 (cd "$MNTIMAGE"; tar cf - .) | (cd "$MNTPOINT"; tar xf -)


More information about the pld-cvs-commit mailing list