[readonly/geninitrd/devel: 206/334] rootfs on nfs works with funny things like kernel swapper doing init job/

draenog draenog at pld-linux.org
Sat Nov 2 19:28:50 CET 2013


commit c52ba2fe25f0822e8db804757ffb9be81faae6b0
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Jun 5 22:19:41 2004 +0000

    rootfs on nfs works with funny things like kernel swapper doing init job/
    
    svn-id: @4148

 geninitrd | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 6e4641e..416c19e 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1028,16 +1028,14 @@ fi
 
 if is_yes "$usenfs" ; then
     	[ -n "$verbose" ] && echo "Adding rootfs on NFS support to initrd (dhcp)"
+	mkdir "$MNTIMAGE/proc"
 	mkdir "$MNTIMAGE/newroot"
 	mkdir "$MNTIMAGE/newroot/initrd"
-	mkdir "$MNTIMAGE/newroot/dev"
-	mknod "$MNTIMAGE/newroot/dev/console" c 5 1
-	mknod "$MNTIMAGE/newroot/dev/null" c 1 3
-	mknod "$MNTIMAGE/newroot/dev/zero" c 1 5
+	echo "mount -t proc none /proc" >> "$s"
 	echo "ifconfig lo 127.0.0.1 up" >> "$s"
 	echo "route add -net 127.0.0.0 netmask 255.0.0.0 lo" >> "$s"
 	echo "ifconfig eth0 0.0.0.0 up" >> "$s"
-    	echo "busybox udhcpc -i eth0 -s /bin/setdhcp"  >> "$s"
+    	echo "udhcpc -i eth0 -f -q -s /bin/setdhcp"  >> "$s"
 	cat << EOF > "$MNTIMAGE/bin/setdhcp"
 #!/bin/sh
 [ "\$1" != "bound" ] && exit
@@ -1055,7 +1053,7 @@ if [ -n "\$router" ]; then
 fi
 if [ -n "\$rootpath" ]; then
     set -x
-    mount -n -t nfs -o ro,nolock \$rootpath /newroot
+    mount -n -t nfs -o ro,nolock,tcp \$rootpath /newroot
     set +x
 else
     set +x
@@ -1066,10 +1064,12 @@ else
 fi
 EOF
 	chmod 755 "$MNTIMAGE/bin/setdhcp"
+	echo "echo 255 > /proc/sys/kernel/real-root-dev" >> "$s"
+	echo "umount /proc" >> "$s"
 	echo "cd /newroot" >> "$s"
-	echo "pivot_root /newroot /newroot/initrd" >> "$s"
-	echo "exec /usr/sbin/chroot . /sbin/init" >> "$s"
-	echo "echo CRITICAL PROBLEM - BOOT FAILED" >> "$s"
+	echo "pivot_root . initrd" >> "$s"
+	echo "exec /usr/sbin/chroot . /sbin/init -i < dev/console > dev/console 2>&1" >> "$s"
+	echo "echo \"CRITICAL PROBLEM - BOOT FAILED\"" >> "$s"
 fi
 
 if is_yes "$uselvm" ; then
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/398807324938659207036e520c0950a61ef50c11



More information about the pld-cvs-commit mailing list