From 3cc4938297c88cc1f7b39876590c6593a9dd3211 Mon Sep 17 00:00:00 2001 From: bsd Date: Wed, 9 May 2001 15:13:51 +0000 Subject: * 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 --- etc/rc.initdiskless | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'etc/rc.initdiskless') diff --git a/etc/rc.initdiskless b/etc/rc.initdiskless index 6f19e3c..fdf71c6 100644 --- a/etc/rc.initdiskless +++ b/etc/rc.initdiskless @@ -100,22 +100,12 @@ 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. -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" - -mount_md 4096 /etc 1 +mount_md 4096 /etc 0 chkerr $? "MFS mount on /etc" /bin/chmod 755 /etc -/bin/cp -Rp /tmp/etc/* /etc -chkerr $? "cp /tmp/etc to /etc MFS" - -rm -rf /tmp/etc -/sbin/umount /tmp -/sbin/mdconfig -d -u 0 +/bin/cp -Rp /conf/default/etc/* /etc +chkerr $? "cp /conf/default/etc to /etc MFS" # Allow for override files to replace files in /etc. Use /conf/*/etc # to find the override files. First choice is default files that @@ -127,7 +117,7 @@ rm -rf /tmp/etc # on separate subnets. # -for i in default ${bootp_ipbca} ${bootp_ipa} ; do +for i in ${bootp_ipbca} ${bootp_ipa} ; do if [ -d /conf/${i}/etc ]; then cp -Rp /conf/${i}/etc/* /etc fi -- cgit v1.1