Synchronize old rc.diskless scripts from new rc.d/ scripts
This commit is contained in:
parent
a6c5babf64
commit
c8029eccc0
@ -152,8 +152,9 @@ for i in base default ${bootp_ipbca} ${bootp_ipa} ; do
|
||||
# NFS remount
|
||||
#
|
||||
if [ -d $j -a -f $j/diskless_remount ]; then
|
||||
mount_nfs `/bin/cat $j/diskless_remount` $j
|
||||
chkerr $? "mount_nfs `/bin/cat $j/diskless_remount` $j"
|
||||
nfspt=`/bin/cat $j/diskless_remount`
|
||||
mount_nfs $nfspt $j
|
||||
chkerr $? "mount_nfs $nfspt $j"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
@ -55,16 +55,36 @@ elif [ -r /etc/rc.conf ]; then
|
||||
. /etc/rc.conf
|
||||
fi
|
||||
|
||||
echo "+++ mount_md of /var"
|
||||
mount_md ${varsize:=32m} /var 1
|
||||
# If we do not have a writable /var, create a memory
|
||||
# filesystem for /var. We don't have /usr yet so
|
||||
# use mkdir instead of touch to test. We want mount
|
||||
# to record its mounts so we have to make sure /var/db
|
||||
# exists before doing the mount -a.
|
||||
#
|
||||
if (/bin/mkdir /var/.diskless 2> /dev/null); then
|
||||
rmdir /var/.diskless
|
||||
else
|
||||
echo "+++ mount_md of /var"
|
||||
mount_md ${varsize:=32m} /var 1
|
||||
fi
|
||||
|
||||
if [ ! -d /var/db ]; then
|
||||
mkdir /var/db
|
||||
fi
|
||||
|
||||
# Now we need the rest of our mounts, particularly /usr
|
||||
#
|
||||
mount -a # chown and chgrp are in /usr
|
||||
|
||||
# Populate /var
|
||||
#
|
||||
echo "+++ populate /var using /etc/mtree/BSD.var.dist"
|
||||
/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
|
||||
/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var > /dev/null
|
||||
case ${sendmail_enable} in
|
||||
[Nn][Oo][Nn][Ee])
|
||||
;;
|
||||
*)
|
||||
/usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p /
|
||||
/usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p / > /dev/null
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -77,34 +97,42 @@ fi
|
||||
echo "+++ create lastlog"
|
||||
/usr/bin/touch /var/log/lastlog
|
||||
|
||||
mount -a # chown and chgrp are in /usr
|
||||
|
||||
# Since we are starting with a very fresh /etc on an MFS:
|
||||
if [ -d /conf/default/etc ]; then
|
||||
newaliases
|
||||
fi
|
||||
|
||||
# Make sure our aliases database is uptodate, the aliases may have
|
||||
# been overriden in /conf.
|
||||
#
|
||||
/usr/bin/newaliases
|
||||
|
||||
# XXX make sure to create one dir for each printer as requested by lpd
|
||||
#
|
||||
|
||||
# If /tmp is a symlink, assume it points to somewhere writable, like
|
||||
# /var/tmp, otherwise, use a small memory filesystem for /tmp.
|
||||
# If we do not have a writable /tmp, create a memory
|
||||
# filesystem for /tmp. If /tmp is a symlink (e.g. to /var/tmp,
|
||||
# then it should already be writable).
|
||||
#
|
||||
# XXX: mtree runs too early to create any directories needed in /tmp,
|
||||
# so if /var/tmp == /tmp, then you don't get a vi.recover.
|
||||
#
|
||||
if [ ! -L /tmp ]; then
|
||||
mount_md ${tmpsize:=64m} /tmp 2
|
||||
chmod 01777 /tmp
|
||||
if (/bin/mkdir /tmp/.diskless 2> /dev/null); then
|
||||
rmdir /tmp/.diskless
|
||||
else
|
||||
if [ -h /tmp ]; then
|
||||
echo "*** /tmp is a symlink to a non-writable area!"
|
||||
echo "dropping into shell, ^D to continue anyway."
|
||||
/bin/sh
|
||||
else
|
||||
mount_md ${tmpsize:=20480} /tmp 2
|
||||
chmod 01777 /tmp
|
||||
fi
|
||||
fi
|
||||
|
||||
if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
|
||||
# we have DEVFS, no worries...
|
||||
true
|
||||
elif (/bin/mkdir /dev/.diskless 2> /dev/null); then
|
||||
# if /dev is writable assume it has already been populated
|
||||
# via rc.diskless1
|
||||
#
|
||||
rmdir /dev/.diskless
|
||||
else
|
||||
# extract a list of device entries, then copy them to a writable fs
|
||||
(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
|
||||
mount_md 4096 /dev 3 512
|
||||
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
|
||||
rm -f /tmp/dev.tmp
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user