Blob Blame History Raw
diff -up system-config-netboot-0.1.42/diskless/mkdiskless.tmpdev system-config-netboot-0.1.42/diskless/mkdiskless
--- system-config-netboot-0.1.42/diskless/mkdiskless.tmpdev	2007-10-12 11:10:02.000000000 +0200
+++ system-config-netboot-0.1.42/diskless/mkdiskless	2008-03-21 14:17:15.000000000 +0100
@@ -260,6 +260,11 @@ if [ ! -e $ROOT/etc/ssh.prediskless ] ||
    touch $ROOT/etc/ssh.prediskless;
    rm -f $ROOT/etc/ssh/ssh_host_*;
 fi
+
+#
+#  Make sure the /dev exists
+mkdir $ROOT/dev &>/dev/null;
+
 #
 #  We need to make small changes to the following startup scripts,
 #  with initscripts < 7.62 (ie. RHEL-3 or before) :
diff -up system-config-netboot-0.1.42/diskless/files.tmpdev system-config-netboot-0.1.42/diskless/files
--- system-config-netboot-0.1.42/diskless/files.tmpdev	2006-04-19 23:04:07.000000000 +0200
+++ system-config-netboot-0.1.42/diskless/files	2008-03-21 14:17:15.000000000 +0100
@@ -5,7 +5,6 @@
 # add files please create a files.custom in this directory and add entries to it.
 #
 /boot/kernel.h
-/dev/
 /etc/resolv.conf
 /etc/resolv.conf.predhclient
 /etc/yp.conf
diff -up system-config-netboot-0.1.42/diskless/disklessrc.tmpdev system-config-netboot-0.1.42/diskless/disklessrc
--- system-config-netboot-0.1.42/diskless/disklessrc.tmpdev	2007-10-16 18:34:33.000000000 +0200
+++ system-config-netboot-0.1.42/diskless/disklessrc	2008-03-25 14:24:55.000000000 +0100
@@ -105,14 +105,6 @@ mountfile () {
 	    echo "Creating ${1}"
 	    touch $snapshotfile
 	fi
-    else
-#  If dev directory already exists in snapshot directory, check if the root 
-#   /dev directory is newer.  If it is rsync the root directory over the 
-#   snapshot directory.
-	if [ ${1} == "/dev" -a ${1} -nt ${dir}/dev ]; then
-	    echo "RSYNC-ing /dev";
-	    rsync -a /mnt/${1} $snapshotfile
-	fi
     fi
 #
 #  Mount the snapshotfile over the root file so the client will have r/w access
@@ -124,7 +116,43 @@ echo "==================================
 echo "Running /disklessrc"
 
 echo "Mounting /proc"
-/bin/mount -n -t proc /proc /proc
+mount -n -t proc /proc /proc
+ 
+#
+# Make /dev on tmpfs
+#
+echo Creating /dev
+mount -o mode=0755 -t tmpfs /dev /dev
+mkdir /dev/pts
+mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
+mkdir /dev/shm
+mkdir /dev/mapper
+echo Creating initial device nodes
+mknod /dev/null c 1 3
+mknod /dev/zero c 1 5
+mknod /dev/systty c 4 0
+mknod /dev/tty c 5 0
+mknod /dev/console c 5 1
+mknod /dev/ptmx c 5 2
+mknod /dev/rtc c 10 135
+mknod /dev/tty0 c 4 0
+mknod /dev/tty1 c 4 1
+mknod /dev/tty2 c 4 2
+mknod /dev/tty3 c 4 3
+mknod /dev/tty4 c 4 4
+mknod /dev/tty5 c 4 5
+mknod /dev/tty6 c 4 6
+mknod /dev/tty7 c 4 7
+mknod /dev/tty8 c 4 8
+mknod /dev/tty9 c 4 9
+mknod /dev/tty10 c 4 10
+mknod /dev/tty11 c 4 11
+mknod /dev/tty12 c 4 12
+mknod /dev/ttyS0 c 4 64
+mknod /dev/ttyS1 c 4 65
+mknod /dev/ttyS2 c 4 66
+mknod /dev/ttyS3 c 4 67
+
 
 if [ "${INITRD_DBG}" = "1" ]; then exec /bin/bash; fi
 
@@ -354,10 +382,6 @@ mount -n -t nfs $NFS_IP:${NFS_DIR}/snaps
 	    mountfile $i ${SNAPSHOT}
 	fi;
     done
-
-    mount --bind /proc /mnt/proc
-    chroot /mnt /sbin/ifup lo
-    umount /mnt/proc
 }
 
 if [ "${INITRD_DBG}" = "6" ]; then exec /bin/bash; fi
@@ -376,8 +400,6 @@ cp -fp /tmp/dhclient.leases /mnt/var/lib
 
 if [ "${INITRD_DBG}" = "7" ]; then exec /bin/bash; fi
 
-#echo "Mounting the devfs filesystem"
-#mount -n -t devfs /devfs /dev
 #
 # Complete the network boot by killing the dhcp client.
 # Umount file systems that are no longer used.
@@ -399,4 +421,7 @@ export keep_old_ip=yes
 export fastboot=yes
 export READONLY=yes
 
+# make /dev accessible from new root
+mount --bind /dev /mnt/dev
+
 exec /sbin/switch_root -c /dev/console /mnt /sbin/init