generate ipnodes.{byname,byaddr} for IPv4/v6 lookups.

hosts.{byname,byaddr} is still an IPv4 only mapping.
obeys solaris8 practice.  see comments in ypinit/Makefile.yp for details.

TODO: interop test with solaris8 (any takers?)
This commit is contained in:
itojun 2000-07-30 02:33:13 +00:00
parent 863848734f
commit f96e3b36f6
2 changed files with 40 additions and 4 deletions

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile.main,v 1.4 1999/04/25 06:28:10 lukem Exp $
# $NetBSD: Makefile.main,v 1.5 2000/07/30 02:33:13 itojun Exp $
SUBDIR=
TARGETS+= passwd aliases amd.home ethers group hosts netgroup \
TARGETS+= passwd aliases amd.home ethers group hosts ipnodes netgroup \
networks protocols rpc services netid
.include <bsd.subdir.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.yp,v 1.9 1999/11/19 16:55:25 abs Exp $
# $NetBSD: Makefile.yp,v 1.10 2000/07/30 02:33:13 itojun Exp $
#
# This is the YP Makefile, used to create and push YP maps.
#
@ -46,7 +46,7 @@ YPPUSH= /usr/sbin/yppush
# We have a rule for ypservers, but we don't build it by default, since
# it seldom changes (only when slaves are added/deleted).
all: passwd aliases amd.home ethers group hosts netgroup networks rpc services protocols netid
all: passwd aliases amd.home ethers group hosts ipnodes netgroup networks rpc services protocols netid
passwd.time: ${DIR}/master.passwd
@ -191,6 +191,19 @@ group.time: ${DIR}/group
fi
# Solaris 8 does the following:
# - /etc/hosts and hosts.{byname,byaddr} are IPv4 only.
# - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol
# independent name-to-address mapping.
#
# For local name resolution, we made /etc/hosts protocol independent.
# For NIS name resolution, we obey Solaris 8 practice.
# - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8
# clients.
# - ipnodes.{byname,byaddr} is used for protocol independent mapping.
# We generate all the mappings from /etc/hosts, for compatibility with NetBSD
# local name resolution.
#
hosts.time: ${DIR}/hosts
-@if [ -f ${.ALLSRC} ]; then \
${STDHOSTS} ${.ALLSRC} | ${SED} -e s/#.*$$// | \
@ -213,6 +226,28 @@ hosts.time: ${DIR}/hosts
fi
ipnodes.time: ${DIR}/hosts
-@if [ -f ${.ALLSRC} ]; then \
${STDHOSTS} -n ${.ALLSRC} | ${SED} -e s/#.*$$// | \
${AWK} '{for (i = 2; i <= NF; i++) print $$i, $$0 }' | \
${SORT} | ${MAKEDBM} - ipnodes.byname; \
${STDHOSTS} -n ${.ALLSRC} | \
${AWK} 'BEGIN { OFS="\t"; } { print $$1, $$0 }' | \
${SORT} | ${MAKEDBM} - ipnodes.byaddr; \
${TOUCH} ${.TARGET}; \
${ECHO} "updated ipnodes"; \
if [ ! ${NOPUSH} ]; then \
${YPPUSH} -d ${DOMAIN} ipnodes.byname; \
${YPPUSH} -d ${DOMAIN} ipnodes.byaddr; \
${ECHO} "pushed ipnodes"; \
else \
: ; \
fi \
else \
${ECHO} "couldn't find ${.ALLSRC}"; \
fi
netgroup.time: ${DIR}/netgroup
-@if [ -f ${.ALLSRC} ]; then \
${CAT} ${.ALLSRC} | ${SORT} | ${MAKEDBM} - netgroup; \
@ -346,6 +381,7 @@ ypservers.time: ${.CURDIR}/ypservers
passwd: passwd.time
group: group.time
hosts: hosts.time
ipnodes: ipnodes.time
aliases: aliases.time
amd.home: amd.home.time
ethers: ethers.time