summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-04-25 05:46:40 +0000
committerimp <imp@FreeBSD.org>2001-04-25 05:46:40 +0000
commitfa79914ebab0270b0ddf10d91be058d619e2c088 (patch)
treefa0eb22c0abbc2cc056385e256defa2df2f7d2c8 /etc/rc.d
parent3b8fad2c5973912ad3f2cbc7ac26dc242ab95134 (diff)
downloadFreeBSD-src-fa79914ebab0270b0ddf10d91be058d619e2c088.zip
FreeBSD-src-fa79914ebab0270b0ddf10d91be058d619e2c088.tar.gz
Move to using md.
o create a simple wrapper function mount_md that makes it easy to move from mount_mfs. # NOTE: you will need to MAKEDEV md[0123] in order for this to work. Reviewed by: bsd, keichii
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/diskless11
-rw-r--r--etc/rc.d/initdiskless14
-rw-r--r--etc/rc.d/resolv11
-rw-r--r--etc/rc.d/tmp11
-rw-r--r--etc/rc.d/var11
5 files changed, 47 insertions, 11 deletions
diff --git a/etc/rc.d/diskless b/etc/rc.d/diskless
index 858261d..a19c068 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 07c68ae..6f19e3c 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 858261d..a19c068 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 858261d..a19c068 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 858261d..a19c068 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
OpenPOWER on IntegriCloud