mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-09 02:26:27 +00:00
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:
parent
1928e20e95
commit
9f474ffc5c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75931
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
11
etc/rc.d/tmp
11
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
|
||||
|
11
etc/rc.d/var
11
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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user