diff options
| author | David E. O'Brien <obrien@FreeBSD.org> | 2002-04-22 21:42:18 +0000 |
|---|---|---|
| committer | David E. O'Brien <obrien@FreeBSD.org> | 2002-04-22 21:42:18 +0000 |
| commit | c1ab4f157d28f3f929eeed198ea57be36740d2c3 (patch) | |
| tree | 6ca8d1683cce4cd39851f681b6a184c845b742f7 | |
| parent | 96ab7da385302856ba4be4d8ce71e755ad4278c7 (diff) | |
Notes
| -rw-r--r-- | etc/rc.d/initdiskless | 21 | ||||
| -rw-r--r-- | etc/rc.diskless1 | 21 | ||||
| -rw-r--r-- | etc/rc.initdiskless | 21 |
3 files changed, 60 insertions, 3 deletions
diff --git a/etc/rc.d/initdiskless b/etc/rc.d/initdiskless index cc1562d24351f..4eb37fa4c7865 100644 --- a/etc/rc.d/initdiskless +++ b/etc/rc.d/initdiskless @@ -92,6 +92,12 @@ for i in ${iflist} ; do done echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" +if [ -z "`hostname -s`" ]; then + hostname=`kenv dhcp.host-name` + hostname $hostname + echo "Hostname is $hostname" +fi + if [ -d /conf/default/etc ]; then mount_md 4096 /etc 0 chkerr $? "MFS mount on /etc" @@ -109,12 +115,25 @@ fi # This way we have some flexibility to handle clusters of machines on # separate subnets. -for i in ${bootp_ipbca} ${bootp_ipa} ; do +for i in ${bootp_ipbca} ${bootp_ipa} ${hostname} ; do if [ -d /conf/${i}/etc ]; then cp -Rp /conf/${i}/etc/* /etc fi done +# +# if the info is available via dhcp/kenv +# build the resolv.conf +# +if [ ! -e /etc/resolv.conf ]; then + echo domain `kenv dhcp.domain-name` > /etc/resolv.conf + + set `kenv dhcp.domain-name-servers` + for ns in `IFS=','; echo $*`; do + echo nameserver $ns >> /etc/resolv.conf; + done +fi + # Tell /etc/rc to run the specified script after it does its mounts but # before it does anything else. # diff --git a/etc/rc.diskless1 b/etc/rc.diskless1 index cc1562d24351f..4eb37fa4c7865 100644 --- a/etc/rc.diskless1 +++ b/etc/rc.diskless1 @@ -92,6 +92,12 @@ for i in ${iflist} ; do done echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" +if [ -z "`hostname -s`" ]; then + hostname=`kenv dhcp.host-name` + hostname $hostname + echo "Hostname is $hostname" +fi + if [ -d /conf/default/etc ]; then mount_md 4096 /etc 0 chkerr $? "MFS mount on /etc" @@ -109,12 +115,25 @@ fi # This way we have some flexibility to handle clusters of machines on # separate subnets. -for i in ${bootp_ipbca} ${bootp_ipa} ; do +for i in ${bootp_ipbca} ${bootp_ipa} ${hostname} ; do if [ -d /conf/${i}/etc ]; then cp -Rp /conf/${i}/etc/* /etc fi done +# +# if the info is available via dhcp/kenv +# build the resolv.conf +# +if [ ! -e /etc/resolv.conf ]; then + echo domain `kenv dhcp.domain-name` > /etc/resolv.conf + + set `kenv dhcp.domain-name-servers` + for ns in `IFS=','; echo $*`; do + echo nameserver $ns >> /etc/resolv.conf; + done +fi + # Tell /etc/rc to run the specified script after it does its mounts but # before it does anything else. # diff --git a/etc/rc.initdiskless b/etc/rc.initdiskless index cc1562d24351f..4eb37fa4c7865 100644 --- a/etc/rc.initdiskless +++ b/etc/rc.initdiskless @@ -92,6 +92,12 @@ for i in ${iflist} ; do done echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" +if [ -z "`hostname -s`" ]; then + hostname=`kenv dhcp.host-name` + hostname $hostname + echo "Hostname is $hostname" +fi + if [ -d /conf/default/etc ]; then mount_md 4096 /etc 0 chkerr $? "MFS mount on /etc" @@ -109,12 +115,25 @@ fi # This way we have some flexibility to handle clusters of machines on # separate subnets. -for i in ${bootp_ipbca} ${bootp_ipa} ; do +for i in ${bootp_ipbca} ${bootp_ipa} ${hostname} ; do if [ -d /conf/${i}/etc ]; then cp -Rp /conf/${i}/etc/* /etc fi done +# +# if the info is available via dhcp/kenv +# build the resolv.conf +# +if [ ! -e /etc/resolv.conf ]; then + echo domain `kenv dhcp.domain-name` > /etc/resolv.conf + + set `kenv dhcp.domain-name-servers` + for ns in `IFS=','; echo $*`; do + echo nameserver $ns >> /etc/resolv.conf; + done +fi + # Tell /etc/rc to run the specified script after it does its mounts but # before it does anything else. # |
