X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/c93d53536a4208b939a5f8e74feaa8eb5c5e7201..abacd09f3b0c031bf3727bbedc5147dc7b5e9854:/etc/rc.d/initdiskless diff --git a/etc/rc.d/initdiskless b/etc/rc.d/initdiskless index bcd04affec..f856c0bbbb 100644 --- a/etc/rc.d/initdiskless +++ b/etc/rc.d/initdiskless @@ -25,7 +25,7 @@ # SUCH DAMAGE. # # $FreeBSD: src/etc/rc.d/initdiskless,v 1.24 2003/06/30 21:47:06 brooks Exp $ -# $DragonFly: src/etc/rc.d/initdiskless,v 1.7 2005/11/19 21:47:32 swildner Exp $ +# $DragonFly: src/etc/rc.d/initdiskless,v 1.8 2007/04/26 23:34:27 dillon Exp $ # # PROVIDE: initdiskless @@ -60,10 +60,9 @@ dummy_rc_command "$1" # # 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//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 @@ dummy_rc_command "$1" # /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 @@ chkerr() { # 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` + 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 - mount_md $md_size /$1 - /bin/chmod 755 /$1 - eval md_created_$1=created - fi } # DEBUGGING @@ -168,8 +167,7 @@ done # # - 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 @@ for i in base default ${bootp_ipbca} ${bootp_ipa} ; do # 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 @@ for i in base default ${bootp_ipbca} ${bootp_ipa} ; do 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 @@ -227,7 +225,7 @@ for i in base default ${bootp_ipbca} ${bootp_ipa} ; do if [ -f $j ]; then create_md $subdir echo "Loading /$subdir from cpio archive $j" - (cd / ; /stand/gzip -d < $j | /stand/cpio --extract -d ) + (cd / ; /usr/bin/gzip -d < $j | /usr/bin/cpio --extract -d ) fi done for j in /conf/$i/*.remove ; do @@ -240,4 +238,3 @@ for i in base default ${bootp_ipbca} ${bootp_ipa} ; do fi done done -