Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2001 16:08:56 +0600 (YEKST)
From:      Anton Voronin <anton@urc.ac.ru>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   conf/31327: Fixes and improvements for rc.diskless* scripts
Message-ID:  <200110171008.f9HA8t010726@belle.rnoc.urc.ac.ru>

next in thread | raw e-mail | index | archive | help

>Number:         31327
>Category:       conf
>Synopsis:       Fixes and improvements for rc.diskless* scripts
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 17 03:20:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Anton Voronin
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
Southern Ural State University
>Environment:

-stable

>Description:

1. Fix for /etc/rc.diskless2 - utilities from /usr were used before mount -a
was called.
2. /etc/rc.diskless1: added configuration option "diskless_sync_pw" to take
password files from server's /etc, not from /conf/*/etc.

>How-To-Repeat:

	Try to boot diskless FreeBSD machine using FreeBSD NFS server

>Fix:

--- rc.diskless2.ORIG	Wed Oct 17 15:37:18 2001
+++ rc.diskless2	Wed Oct 17 15:37:28 2001
@@ -55,6 +55,9 @@
 echo "+++ mfs_mount of /var"
 mount_md ${varsize:=65536} /var 1
 
+mkdir /var/db	# for /var/db/mounttab updates to sucseed when doing mount -a
+mount /usr	# to access utilities in /usr
+
 echo "+++ populate /var using /etc/mtree/BSD.var.dist"
 /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
 
@@ -64,7 +67,7 @@
 	/usr/bin/touch $LOGFILES
 fi
 
-mount -a       # chown and chgrp are in /usr
+mount -a	# all the rest local filesystems including ones mounted under /var
 
 #
 # XXX make sure to create one dir for each printer as requested by lpd


--- rc.diskless1.ORIG	Wed Oct 17 15:37:18 2001
+++ rc.diskless1	Wed Oct 17 16:02:42 2001
@@ -93,13 +93,43 @@
 done
 echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}"
 
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/rc.conf ]; then
+	. /etc/defaults/rc.conf
+	source_rc_confs
+elif [ -r /etc/rc.conf ]; then
+	. /etc/rc.conf
+fi
 
-# Create an MFS /tmp to temporarily hold files from /etc until we
-# can bootstrap /etc as an MFS.
+# Sync password files with server (step 1)
+# Warning: variable sync_diskless_pw must be set via server's rc.conf.
+#
+case ${diskless_sync_pw} in
+[Yy][Ee][Ss])
+	mount_md 4096 /var 0
+	chkerr $? "MFS mount on temporary /var"
 
+	for pwfile in passwd master.passwd pwd.db spwd.db ; do
+		/bin/cp -p /etc/$pwfile /var
+	done
+        ;;
+esac
+
+# Create own /etc
+#
 mount_md 4096 /etc 0
 chkerr $? "MFS mount on /etc"
 /bin/chmod 755 /etc
+
+# Sync password files with server (step 2).
+#
+case ${diskless_sync_pw} in
+[Yy][Ee][Ss])
+	/bin/cp -p /var/* /etc
+	/sbin/umount /var
+        ;;
+esac
 
 /bin/cp -Rp /conf/default/etc/* /etc
 chkerr $? "cp /conf/default/etc to /etc MFS"
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110171008.f9HA8t010726>