diff options
| -rw-r--r-- | etc/rc.d/diskless | 11 | ||||
| -rw-r--r-- | etc/rc.d/initdiskless | 14 | ||||
| -rw-r--r-- | etc/rc.d/resolv | 11 | ||||
| -rw-r--r-- | etc/rc.d/tmp | 11 | ||||
| -rw-r--r-- | etc/rc.d/var | 11 | ||||
| -rw-r--r-- | etc/rc.diskless1 | 14 | ||||
| -rw-r--r-- | etc/rc.diskless2 | 11 | ||||
| -rw-r--r-- | etc/rc.initdiskless | 14 |
8 files changed, 78 insertions, 19 deletions
diff --git a/etc/rc.d/diskless b/etc/rc.d/diskless index 858261d5c13a..a19c0688c009 100644 --- a/etc/rc.d/diskless +++ b/etc/rc.d/diskless @@ -29,6 +29,13 @@ # PROVIDE: diskless # REQUIRE: initdiskless mountcritlocal + +# $1 = size +# $2 = mount point + /sbin/newfs /dev/md$3c +# $4 = (optional) bytes-per-inode +mount_md() +{ if [ -n "$4" ]; then bpi="-i $4" fi @@ -39,7 +46,7 @@ } echo "+++ mfs_mount of /var" -mount_mfs -s ${varsize:=65536} -T qp120at dummy /var +mount_md ${varsize:=65536} /var 2 if [ -r /etc/rc.subr ]; then . /etc/rc.subr load_rc_config $name @@ -65,7 +72,7 @@ fi # extract a list of device entries, then copy them to a writable partition (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp echo "+++ mount_mfs of /dev" -mount_mfs -s 4096 -i 512 -T qp120at dummy /dev +mount_md 4096 /dev 3 (cd /; cpio -i -H newc -d < /tmp/dev.tmp) # extract a list of device entries, then copy them to a writable fs (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp diff --git a/etc/rc.d/initdiskless b/etc/rc.d/initdiskless index 07c68ae99b8f..6f19e3cd2819 100644 --- a/etc/rc.d/initdiskless +++ b/etc/rc.d/initdiskless @@ -62,6 +62,13 @@ chkerr() { esac } +mount_md() { + /sbin/mdconfig -a -t malloc -s $1 -u $3 + /sbin/disklabel -r -w md$3 auto + /sbin/newfs /dev/md$3c + /sbin/mount /dev/md$3c $2 +} + # DEBUGGING # # set -v @@ -93,12 +100,13 @@ echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" # Create an MFS /tmp to temporarily hold files from /etc until we # can bootstrap /etc as an MFS. -/sbin/mount_mfs -s 4096 -T qp120at dummy /tmp +mount_md 4096 /tmp 0 +chmod 1777 /tmp chkerr $? "MFS mount on /tmp" /bin/cp -Rp /etc /tmp chkerr $? "cp /etc to /tmp/etc MFS" -/sbin/mount_mfs -s 4096 -T qp120at dummy /etc +mount_md 4096 /etc 1 chkerr $? "MFS mount on /etc" /bin/chmod 755 /etc @@ -107,7 +115,7 @@ chkerr $? "cp /tmp/etc to /etc MFS" rm -rf /tmp/etc /sbin/umount /tmp - +/sbin/mdconfig -d -u 0 # Allow for override files to replace files in /etc. Use /conf/*/etc # to find the override files. First choice is default files that diff --git a/etc/rc.d/resolv b/etc/rc.d/resolv index 858261d5c13a..a19c0688c009 100644 --- a/etc/rc.d/resolv +++ b/etc/rc.d/resolv @@ -29,6 +29,13 @@ # PROVIDE: diskless # REQUIRE: initdiskless mountcritlocal + +# $1 = size +# $2 = mount point + /sbin/newfs /dev/md$3c +# $4 = (optional) bytes-per-inode +mount_md() +{ if [ -n "$4" ]; then bpi="-i $4" fi @@ -39,7 +46,7 @@ } echo "+++ mfs_mount of /var" -mount_mfs -s ${varsize:=65536} -T qp120at dummy /var +mount_md ${varsize:=65536} /var 2 if [ -r /etc/rc.subr ]; then . /etc/rc.subr load_rc_config $name @@ -65,7 +72,7 @@ fi # extract a list of device entries, then copy them to a writable partition (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp echo "+++ mount_mfs of /dev" -mount_mfs -s 4096 -i 512 -T qp120at dummy /dev +mount_md 4096 /dev 3 (cd /; cpio -i -H newc -d < /tmp/dev.tmp) # extract a list of device entries, then copy them to a writable fs (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp index 858261d5c13a..a19c0688c009 100644 --- a/etc/rc.d/tmp +++ b/etc/rc.d/tmp @@ -29,6 +29,13 @@ # PROVIDE: diskless # REQUIRE: initdiskless mountcritlocal + +# $1 = size +# $2 = mount point + /sbin/newfs /dev/md$3c +# $4 = (optional) bytes-per-inode +mount_md() +{ if [ -n "$4" ]; then bpi="-i $4" fi @@ -39,7 +46,7 @@ } echo "+++ mfs_mount of /var" -mount_mfs -s ${varsize:=65536} -T qp120at dummy /var +mount_md ${varsize:=65536} /var 2 if [ -r /etc/rc.subr ]; then . /etc/rc.subr load_rc_config $name @@ -65,7 +72,7 @@ fi # extract a list of device entries, then copy them to a writable partition (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp echo "+++ mount_mfs of /dev" -mount_mfs -s 4096 -i 512 -T qp120at dummy /dev +mount_md 4096 /dev 3 (cd /; cpio -i -H newc -d < /tmp/dev.tmp) # extract a list of device entries, then copy them to a writable fs (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp diff --git a/etc/rc.d/var b/etc/rc.d/var index 858261d5c13a..a19c0688c009 100644 --- a/etc/rc.d/var +++ b/etc/rc.d/var @@ -29,6 +29,13 @@ # PROVIDE: diskless # REQUIRE: initdiskless mountcritlocal + +# $1 = size +# $2 = mount point + /sbin/newfs /dev/md$3c +# $4 = (optional) bytes-per-inode +mount_md() +{ if [ -n "$4" ]; then bpi="-i $4" fi @@ -39,7 +46,7 @@ } echo "+++ mfs_mount of /var" -mount_mfs -s ${varsize:=65536} -T qp120at dummy /var +mount_md ${varsize:=65536} /var 2 if [ -r /etc/rc.subr ]; then . /etc/rc.subr load_rc_config $name @@ -65,7 +72,7 @@ fi # extract a list of device entries, then copy them to a writable partition (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp echo "+++ mount_mfs of /dev" -mount_mfs -s 4096 -i 512 -T qp120at dummy /dev +mount_md 4096 /dev 3 (cd /; cpio -i -H newc -d < /tmp/dev.tmp) # extract a list of device entries, then copy them to a writable fs (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp diff --git a/etc/rc.diskless1 b/etc/rc.diskless1 index 07c68ae99b8f..6f19e3cd2819 100644 --- a/etc/rc.diskless1 +++ b/etc/rc.diskless1 @@ -62,6 +62,13 @@ chkerr() { esac } +mount_md() { + /sbin/mdconfig -a -t malloc -s $1 -u $3 + /sbin/disklabel -r -w md$3 auto + /sbin/newfs /dev/md$3c + /sbin/mount /dev/md$3c $2 +} + # DEBUGGING # # set -v @@ -93,12 +100,13 @@ echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" # Create an MFS /tmp to temporarily hold files from /etc until we # can bootstrap /etc as an MFS. -/sbin/mount_mfs -s 4096 -T qp120at dummy /tmp +mount_md 4096 /tmp 0 +chmod 1777 /tmp chkerr $? "MFS mount on /tmp" /bin/cp -Rp /etc /tmp chkerr $? "cp /etc to /tmp/etc MFS" -/sbin/mount_mfs -s 4096 -T qp120at dummy /etc +mount_md 4096 /etc 1 chkerr $? "MFS mount on /etc" /bin/chmod 755 /etc @@ -107,7 +115,7 @@ chkerr $? "cp /tmp/etc to /etc MFS" rm -rf /tmp/etc /sbin/umount /tmp - +/sbin/mdconfig -d -u 0 # Allow for override files to replace files in /etc. Use /conf/*/etc # to find the override files. First choice is default files that diff --git a/etc/rc.diskless2 b/etc/rc.diskless2 index e69f6ee5ee03..043b72f867bc 100644 --- a/etc/rc.diskless2 +++ b/etc/rc.diskless2 @@ -29,6 +29,13 @@ # rc.diskless2 # +mount_md() { + /sbin/mdconfig -a -t malloc -s $1 -u $3 + /sbin/disklabel -r -w md$3 auto + /sbin/newfs /dev/md$3c + /sbin/mount /dev/md$3c $2 +} + # If there is a global system configuration file, suck it in. # if [ -r /etc/defaults/rc.conf ]; then @@ -39,7 +46,7 @@ elif [ -r /etc/rc.conf ]; then fi echo "+++ mfs_mount of /var" -mount_mfs -s ${varsize:=65536} -T qp120at dummy /var +mount_md ${varsize:=65536} /var 2 echo "+++ populate /var using /etc/mtree/BSD.var.dist" /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var @@ -65,5 +72,5 @@ mount -a # chown and chgrp are in /usr # extract a list of device entries, then copy them to a writable partition (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp echo "+++ mount_mfs of /dev" -mount_mfs -s 4096 -i 512 -T qp120at dummy /dev +mount_md 4096 /dev 3 (cd /; cpio -i -H newc -d < /tmp/dev.tmp) diff --git a/etc/rc.initdiskless b/etc/rc.initdiskless index 07c68ae99b8f..6f19e3cd2819 100644 --- a/etc/rc.initdiskless +++ b/etc/rc.initdiskless @@ -62,6 +62,13 @@ chkerr() { esac } +mount_md() { + /sbin/mdconfig -a -t malloc -s $1 -u $3 + /sbin/disklabel -r -w md$3 auto + /sbin/newfs /dev/md$3c + /sbin/mount /dev/md$3c $2 +} + # DEBUGGING # # set -v @@ -93,12 +100,13 @@ echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" # Create an MFS /tmp to temporarily hold files from /etc until we # can bootstrap /etc as an MFS. -/sbin/mount_mfs -s 4096 -T qp120at dummy /tmp +mount_md 4096 /tmp 0 +chmod 1777 /tmp chkerr $? "MFS mount on /tmp" /bin/cp -Rp /etc /tmp chkerr $? "cp /etc to /tmp/etc MFS" -/sbin/mount_mfs -s 4096 -T qp120at dummy /etc +mount_md 4096 /etc 1 chkerr $? "MFS mount on /etc" /bin/chmod 755 /etc @@ -107,7 +115,7 @@ chkerr $? "cp /tmp/etc to /etc MFS" rm -rf /tmp/etc /sbin/umount /tmp - +/sbin/mdconfig -d -u 0 # Allow for override files to replace files in /etc. Use /conf/*/etc # to find the override files. First choice is default files that |
