Index: diskless
===================================================================
RCS file: /home/dcvs/src/etc/rc.d/diskless,v
retrieving revision 1.5
diff -u -r1.5 diskless
--- diskless	19 Nov 2005 21:47:32 -0000	1.5
+++ diskless	10 Apr 2007 21:25:10 -0000
@@ -40,11 +40,9 @@
 dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
 [ ${dlv:=0} -eq 0 ] && exit 0
 
-name="diskless2"
+name="diskless"
 
-# Provide a function for normalizing the mounting of memory
-# filesystems.  This should allow the rest of the code here to remain
-# as close as possible between 5-current and 4-stable.
+# Provide a function for normalizing the mounting of memory filesystems.
 #   $1 = size
 #   $2 = mount point
 #   $3 = (optional) bytes-per-inode
@@ -52,7 +50,7 @@
 	if [ -n "$3" ]; then
 		bpi="-i $3"
 	fi
-	/sbin/mdmfs $bpi -s $1 -M md $2
+	/sbin/mount_mfs $bpi -s $1 swap $2
 }
 
 # If there is a global system configuration file, suck it in.
@@ -77,7 +75,7 @@
         rmdir /var/.diskless
 else
 	echo "+++ mount_md of /var"
-	mount_md ${varsize:=32m} /var
+	mount_md ${varsize:=32768} /var
 fi
 
 if [ ! -d /var/db ]; then
@@ -138,7 +136,7 @@
 	true
 elif (/bin/mkdir /dev/.diskless 2> /dev/null); then
 	# if /dev is writable assume it has already been populated
-	# via rc.diskless1
+	# via rc.d/diskless
 	#
 	rmdir /dev/.diskless
 else
@@ -151,7 +149,7 @@
 # generate our hostname
 #
 if [ -z "`hostname -s`" ]; then
-	hostname=`/bin/kenv dhcp.host-name`
+	hostname=`/usr/bin/kenv dhcp.host-name`
 	hostname $hostname
 	echo "Hostname is $hostname"
 fi
@@ -160,11 +158,10 @@
 # build the resolv.conf
 #
 if [ ! -e /etc/resolv.conf ]; then
-	echo domain `/bin/kenv dhcp.domain-name` > /etc/resolv.conf
+	echo domain `/usr/bin/kenv dhcp.domain-name` > /etc/resolv.conf
 
-	set `/bin/kenv dhcp.domain-name-servers`
+	set `/usr/bin/kenv dhcp.domain-name-servers`
 	for ns in `IFS=','; echo $*`; do
 		echo nameserver $ns >> /etc/resolv.conf;
 	done
 fi
-
Index: initdiskless
===================================================================
RCS file: /home/dcvs/src/etc/rc.d/initdiskless,v
retrieving revision 1.7
diff -u -r1.7 initdiskless
--- initdiskless	19 Nov 2005 21:47:32 -0000	1.7
+++ initdiskless	10 Apr 2007 21:25:10 -0000
@@ -60,10 +60,9 @@
 #
 # If a subdirectory contains the file 'md_size', the contents of the
 # file is used to determine the size of the memory filesystem, in 512
-# byte sectors.  The default is 8192 (4MB).  You only have to specify an
+# byte sectors.  The default is 4096 (2MB).  You only have to specify an
 # md_size if the default doesn't work for you (i.e. if it is too big or
-# too small).  Note that in -current the default is 4096 (2MB).  For
-# example, /conf/base/etc/md_size might contain '16384'.
+# too small).  For example, /conf/base/etc/md_size might contain '16384'.
 #
 # If /conf/<special_dir>/SUBDIR.cpio.gz exists, the file is cpio'd into
 # the specified /SUBDIR (and a memory filesystem is created for /SUBDIR
@@ -78,7 +77,7 @@
 # /conf/default/etc/{rc.conf,rc.local,fstab}.  Your fstab should be sure
 # to mount a /usr... typically an NFS readonly /usr.
 #
-# NOTE!  rc.diskless2 will create /var, /tmp, and /dev.  Those filesystems
+# NOTE!  rc.d/diskless will create /var, /tmp, and /dev.  Those filesystems
 # should not be specified in /conf.  At least not yet.
 
 dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
@@ -106,22 +105,22 @@
 # Create a generic memory disk
 #
 mount_md() {
-	/sbin/mdmfs -i 4096 -s $1 -M md $2
+	/sbin/mount_mfs -i 4096 -s $1 swap $2
 }
 
 # Create the memory filesystem if it has not already been created
 #
 create_md() {
 	if [ "x`eval echo \\$md_created_$1`" = "x" ]; then
-	if [ "x`eval echo \\$md_size_$1`" = "x" ]; then
-	    md_size=4096
-	else
-	    md_size=`eval echo \\$md_size_$1`
-	fi
-	mount_md $md_size /$1
-	/bin/chmod 755 /$1
-	eval md_created_$1=created
-    fi
+		if [ "x`eval echo \\$md_size_$1`" = "x" ]; then
+			md_size=4096
+		else
+			md_size=`eval echo \\$md_size_$1`
+		fi
+		mount_md $md_size /$1
+		/bin/chmod 755 /$1
+		eval md_created_$1=created
+	fi
 }
 
 # DEBUGGING
@@ -168,8 +167,7 @@
 #
 # - calculate memory filesystem sizes.  If the subdirectory (prior to
 #   NFS remounting) contains the file 'md_size', the contents specified
-#   in 512 byte sectors will be used to size the memory filesystem.  Otherwise
-#   8192 sectors (4MB) is used.
+#   in 512 byte sectors will be used to size the memory filesystem.
 #
 # - handle NFS remounts.  If the subdirectory contains the file
 #   diskless_remount, the contents of the file is NFS mounted over
@@ -188,7 +186,7 @@
 	#
 	subdir=${j##*/}
 	if [ -d $j -a -f $j/md_size ]; then
-	    eval md_size_$subdir=`cat $j/md_size`
+		eval md_size_$subdir=`cat $j/md_size`
 	fi
 
 	# NFS remount
@@ -196,12 +194,12 @@
 	if [ -d $j -a -f $j/diskless_remount ]; then
 		nfspt=`/bin/cat $j/diskless_remount`
 		if [ `expr "$nfspt" : '\(.\)'` = "/" ]; then
-		nfspt="${nfsroot}${nfspt}"
+			nfspt="${nfsroot}${nfspt}"
 		fi
 		mount_nfs $nfspt $j
 		chkerr $? "mount_nfs $nfspt $j"
 	fi
-    done
+	done
 done
 
 # - Create all required MFS filesystems and populate them from
@@ -240,4 +238,3 @@
 		fi
 	done
 done
-
