diff options
author | bsd <bsd@FreeBSD.org> | 2001-05-09 15:13:51 +0000 |
---|---|---|
committer | bsd <bsd@FreeBSD.org> | 2001-05-09 15:13:51 +0000 |
commit | 3cc4938297c88cc1f7b39876590c6593a9dd3211 (patch) | |
tree | a06d8b6079aefba80a37f57e231d3f3e36ad6e98 /etc/rc.d/tmp | |
parent | a968ca96b61c019a71445292f287bfb6efafc46f (diff) | |
download | FreeBSD-src-3cc4938297c88cc1f7b39876590c6593a9dd3211.zip FreeBSD-src-3cc4938297c88cc1f7b39876590c6593a9dd3211.tar.gz |
* Simplify the population of the /etc memory filesystem. To avoid
the null mount, we currently create a temporary mfs on /tmp, copy
/etc to /tmp, then mount /etc as mfs and copy everything back from
/tmp, then delete the /tmp mfs.
The patch eliminates the temporary /tmp mfs and the subsequent
copying and simply populates the /etc mfs by copying from
/conf/default/etc. This requires that /conf/default/etc contain a
complete copy of all the /etc stuff instead of just overrides. I
don't think that is too much of an extra step in setting up a
diskless environment.
* Provide the ability to make /tmp a memory filesystem independent
of /var. This removes the requirement that /tmp be a symlink to
/var/tmp and this makes the diskless code work with the default
filesystem layout. If a seperate /tmp memory filesystem is
created, the 'tmpsize' environment variable is used to determine
its size (default to 10 Meg).
* Reduce diffs between the -current and -stable versions of these
files to a bare minimum. Only the definition of the shell
function 'mount_md' is different.
Not Objected to by: -arch@, -small@
MFC after: 2 days
Diffstat (limited to 'etc/rc.d/tmp')
-rw-r--r-- | etc/rc.d/tmp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp index 37c1cf6..f297e24 100644 --- a/etc/rc.d/tmp +++ b/etc/rc.d/tmp @@ -29,10 +29,20 @@ # PROVIDE: diskless # REQUIRE: initdiskless mountcritlocal +# BEFORE: addswap random +# KEYWORD: FreeBSD +dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` +[ ${dlv:=0} -eq 0 ] && exit 0 + +name="diskless2" + +# Provide a function for normalizing the mounting of memory +# filesystems. This should allow the rest of the code here to remain +# as close as possible between 5-current and 4-stable. # $1 = size # $2 = mount point - /sbin/newfs /dev/md$3c +# $3 = md unit number (ignored in pre 5.0 systems) # $4 = (optional) bytes-per-inode mount_md() { @@ -46,7 +56,7 @@ mount_md() } echo "+++ mfs_mount of /var" -mount_md ${varsize:=65536} /var 2 +mount_md ${varsize:=65536} /var 1 if [ -r /etc/rc.subr ]; then . /etc/rc.subr load_rc_config $name @@ -63,11 +73,11 @@ fi if [ -d /conf/default/etc ]; then newaliases fi -# We assume that /tmp is symlinked to /var/tmp on the shared root -# partition. mount_null seems to have problems. -#if [ ! -h /tmp -a ! -h /var/tmp ]; then -# mount_null /var/tmp /tmp -#fi + +# +# /var/tmp, otherwise, use a small memory filesystem for /tmp. + mount_md ${tmpsize:=20480} /tmp 2 +# so if /var/tmp == /tmp, then you don't get a vi.recover. # if [ ! -h /tmp ]; then mount_md ${tmpsize:=64m} /tmp 2 @@ -75,7 +85,7 @@ if [ ! -h /tmp ]; then fi if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then - mount_mfs -s 4096 -i 512 -T qp120at dummy /dev + # we have DEVFS, no worries... true else # extract a list of device entries, then copy them to a writable fs |