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
This commit is contained in:
Warner Losh 2001-04-25 05:46:40 +00:00
parent 1928e20e95
commit 9f474ffc5c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75931
8 changed files with 78 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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