summaryrefslogtreecommitdiffstats
path: root/etc/rc.initdiskless
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-08-17 00:28:38 +0000
committerbrooks <brooks@FreeBSD.org>2005-08-17 00:28:38 +0000
commite7d53d1ef4a88573e6636ed147683b993b130525 (patch)
treede3b33a6ed2110f39bbffb955df9a9724db5682d /etc/rc.initdiskless
parentbdfa6fbbb1a31a1cc16eb732d011224eeb422ce6 (diff)
downloadFreeBSD-src-e7d53d1ef4a88573e6636ed147683b993b130525.zip
FreeBSD-src-e7d53d1ef4a88573e6636ed147683b993b130525.tar.gz
Add two new template sources, /conf/bcast/${ipbca} and /conf/ip/${ip}.
These allow large installations to keep their /conf directory down to a managable number of entries. Clean up the handling of dhcp_cookie.
Diffstat (limited to 'etc/rc.initdiskless')
-rw-r--r--etc/rc.initdiskless25
1 files changed, 18 insertions, 7 deletions
diff --git a/etc/rc.initdiskless b/etc/rc.initdiskless
index b536021..4552656 100644
--- a/etc/rc.initdiskless
+++ b/etc/rc.initdiskless
@@ -43,16 +43,19 @@
# default secondary universal base, typically overriding some
# of the files in the original root;
# ${ipba} where ${ipba} is the assigned broadcast IP address
+# bcast/${ipba} same as above
# ${class} where ${class} is a list of directories supplied by
# bootp/dhcp through the T134 option.
# ${ipba} and ${class} are typicall used to configure features
# for group of diskless clients, or even individual features;
# ${ip} where ${ip} is the machine's assigned IP address, typically
# used to set host-specific features;
+# ip/${ip} same as above
#
# Template directories are scanned in the order they are listed above,
# with each sucessive directory overriding (merged into) the previous one;
-# non-existing directories are ignored.
+# non-existing directories are ignored. The subdirectory forms exist to
+# help keep the top level /conf managable in large installations.
#
# The existence of a directory /conf/T/M causes this script to create a
# memory filesystem mounted as /M on the client.
@@ -169,6 +172,7 @@ create_md() {
bootp_ifc=""
bootp_ipa=""
bootp_ipbca=""
+class=""
if [ ${dlv:=0} -ne 0 ] ; then
iflist=`ifconfig -l`
for i in ${iflist} ; do
@@ -186,12 +190,10 @@ if [ ${dlv:=0} -ne 0 ] ; then
break
fi
done
- # Insert the directories passed with the T134 bootp cookie
- # in the list of paths used for templates.
- i="`/sbin/sysctl -n kern.bootp_cookie`"
- [ "${i}" != "" ] && bootp_ipbca="${bootp_ipbca} ${i}"
+ # Get the values passed with the T134 bootp cookie.
+ class="`/sbin/sysctl -n kern.bootp_cookie`"
- echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}"
+ echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca} ${class}"
fi
# Figure out our NFS root path
@@ -206,7 +208,16 @@ while [ $# -ge 1 ] ; do
done
# The list of directories with template files
-templates="base default ${bootp_ipbca} ${bootp_ipa}"
+templates="base default"
+if [ -n "${bootp_ipbca}" ]; then
+ templates="${templates} ${bootp_ipbca} bcast/${bootp_ipbca}"
+fi
+if [ -n "${class}" ]; then
+ templates="${templates} ${class}"
+fi
+if [ -n "${bootp_ipa}" ]; then
+ templates="${templates} ${bootp_ipa} ip/${bootp_ipa}"
+fi
# The list of filesystems to umount after the copy
to_umount=""
OpenPOWER on IntegriCloud