Wed May 26 20:22:28 2021 UTC ()
use the date tool


(christos)
diff -r1.449 -r1.450 src/etc/Makefile

cvs diff -r1.449 -r1.450 src/etc/Makefile (switch to unified diff)

--- src/etc/Makefile 2020/12/29 16:46:44 1.449
+++ src/etc/Makefile 2021/05/26 20:22:28 1.450
@@ -1,709 +1,709 @@ @@ -1,709 +1,709 @@
1# $NetBSD: Makefile,v 1.449 2020/12/29 16:46:44 martin Exp $ 1# $NetBSD: Makefile,v 1.450 2021/05/26 20:22:28 christos Exp $
2# from: @(#)Makefile 8.7 (Berkeley) 5/25/95 2# from: @(#)Makefile 8.7 (Berkeley) 5/25/95
3 3
4# Environment variables without default values: 4# Environment variables without default values:
5# DESTDIR must be set before anything in this file will work. 5# DESTDIR must be set before anything in this file will work.
6# RELEASEDIR is where the tarred up stuff for a snapshot or 6# RELEASEDIR is where the tarred up stuff for a snapshot or
7# release will be placed. 7# release will be placed.
8# 8#
9# Environment variables with default values: 9# Environment variables with default values:
10# LOCALTIME will set the default local time for the system you 10# LOCALTIME will set the default local time for the system you
11# build; it determines what /etc/localtime is symlink'd to. 11# build; it determines what /etc/localtime is symlink'd to.
12# KERNSRCDIR points to kernel source; it is set by default to ../sys, 12# KERNSRCDIR points to kernel source; it is set by default to ../sys,
13# but can be overridden. 13# but can be overridden.
14# KERNOBJDIR is the kernel build directory, it defaults to 14# KERNOBJDIR is the kernel build directory, it defaults to
15# ${KERNSRCDIR}/arch/${MACHINE}/compile, but can be overridden. 15# ${KERNSRCDIR}/arch/${MACHINE}/compile, but can be overridden.
16# KERNCONFDIR is where the configuration files for kernels are found; 16# KERNCONFDIR is where the configuration files for kernels are found;
17# default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden. 17# default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden.
18# MKPOSTFIX; if not `no', install postfix configuration 18# MKPOSTFIX; if not `no', install postfix configuration
19# MKUNPRIVED; if not `no', allow non-root installs. 19# MKUNPRIVED; if not `no', allow non-root installs.
20# MKUPDATE; if not `no', don't do a 'make clean' before kernel compile 20# MKUPDATE; if not `no', don't do a 'make clean' before kernel compile
21# 21#
22# Targets: 22# Targets:
23# distribution: makes a full NetBSD distribution in DESTDIR. If 23# distribution: makes a full NetBSD distribution in DESTDIR. If
24# INSTALL_DONE is set, it will not do a `make install.' 24# INSTALL_DONE is set, it will not do a `make install.'
25# if DISTRIBUTION_DONE is set, it will not do anything. 25# if DISTRIBUTION_DONE is set, it will not do anything.
26# distrib-dirs: creates an empty NetBSD directory tree in DESTDIR. 26# distrib-dirs: creates an empty NetBSD directory tree in DESTDIR.
27# Called by distribution. 27# Called by distribution.
28# snapshot: calls distribution, above, and then tars up the files 28# snapshot: calls distribution, above, and then tars up the files
29# into a release(7) format in RELEASEDIR/${RELEASEMACHINEDIR}. 29# into a release(7) format in RELEASEDIR/${RELEASEMACHINEDIR}.
30# Any port-dependent stuff for this target is found in 30# Any port-dependent stuff for this target is found in
31# etc.${MACHINE}/Makefile.inc. 31# etc.${MACHINE}/Makefile.inc.
32# release: a synonym for `snapshot' 32# release: a synonym for `snapshot'
33# 33#
34 34
35# For MK* vars 35# For MK* vars
36.include <bsd.own.mk> 36.include <bsd.own.mk>
37 37
38.include <bsd.kernobj.mk> # For KERNSRCDIR, KERNOBJDIR, ... 38.include <bsd.kernobj.mk> # For KERNSRCDIR, KERNOBJDIR, ...
39.include <bsd.endian.mk> # For TARGET_ENDIANNESS 39.include <bsd.endian.mk> # For TARGET_ENDIANNESS
40 40
41.MAKEOVERRIDES+= USETOOLS 41.MAKEOVERRIDES+= USETOOLS
42 42
43TZDIR= /usr/share/zoneinfo 43TZDIR= /usr/share/zoneinfo
44LOCALTIME?= UTC 44LOCALTIME?= UTC
45CKSUM?= ${TOOL_CKSUM} 45CKSUM?= ${TOOL_CKSUM}
46MAKESUMS= MAKE=${MAKE:Q} CKSUM=${CKSUM:Q} ${HOST_SH} ${NETBSDSRCDIR}/distrib/sets/makesums 46MAKESUMS= MAKE=${MAKE:Q} CKSUM=${CKSUM:Q} ${HOST_SH} ${NETBSDSRCDIR}/distrib/sets/makesums
47DISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh 47DISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
48 48
49GZIP_FLAGS= -9 ${GZIP_N_FLAG} 49GZIP_FLAGS= -9 ${GZIP_N_FLAG}
50 50
51# Flags for creating ISO CDROM image 51# Flags for creating ISO CDROM image
52# mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrtools 52# mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrtools
53# Note: At least mkisofs 2.0 should be used. 53# Note: At least mkisofs 2.0 should be used.
54# 54#
55.if !defined(MKISOFS) 55.if !defined(MKISOFS)
56MKISOFS!= (which mkisofs || echo true) 2>/dev/null 56MKISOFS!= (which mkisofs || echo true) 2>/dev/null
57.endif 57.endif
58DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s 58DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s
59# ISO 9660 volume ID. Note that this can only contain [A-Z0-9_]. 59# ISO 9660 volume ID. Note that this can only contain [A-Z0-9_].
60ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z 60ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z
61MKISOFS_FLAGS+= -J -l -hide-joliet-trans-tbl -r -T \ 61MKISOFS_FLAGS+= -J -l -hide-joliet-trans-tbl -r -T \
62 -V ${ISO_VOLID} \ 62 -V ${ISO_VOLID} \
63 -publisher "The NetBSD Project" \ 63 -publisher "The NetBSD Project" \
64 -m "${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom" 64 -m "${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom"
65.if ${MKISOFS_FLAGS:N-v} 65.if ${MKISOFS_FLAGS:N-v}
66MKISOFS_FLAGS+= -quiet 66MKISOFS_FLAGS+= -quiet
67.endif 67.endif
68  68
69# Reproducible build parameters 69# Reproducible build parameters
70.if ${MKREPRO:Uno} == "no" 70.if ${MKREPRO:Uno} == "no"
71BUILDER!= echo $${USER-root}@$$(hostname) 71BUILDER!= echo $${USER-root}@$$(hostname)
72.else 72.else
73BUILDER= builder@localhost.NetBSD.org 73BUILDER= builder@localhost.NetBSD.org
74.endif 74.endif
75.if ${MKREPRO_TIMESTAMP:Uno} == "no" 75.if ${MKREPRO_TIMESTAMP:Uno} == "no"
76PAX_TIMESTAMP= 76PAX_TIMESTAMP=
77BUILD_DATE!= date -u 77BUILD_DATE!= date -u
78.else 78.else
79PAX_TIMESTAMP=--timestamp "${MKREPRO_TIMESTAMP}" 79PAX_TIMESTAMP=--timestamp "${MKREPRO_TIMESTAMP}"
80BUILD_DATE!= date -u -r "${MKREPRO_TIMESTAMP}" 80BUILD_DATE!= ${TOOL_DATE} -u -r "${MKREPRO_TIMESTAMP}"
81.endif 81.endif
82 82
83# MD Makefile.inc may append MD targets to BIN[123]. Make sure all 83# MD Makefile.inc may append MD targets to BIN[123]. Make sure all
84# are empty, to preserve the old semantics of setting them below with "+=". 84# are empty, to preserve the old semantics of setting them below with "+=".
85# 85#
86BIN1= 86BIN1=
87BIN2= 87BIN2=
88BIN3= 88BIN3=
89 89
90# Directories to build in ${RELEASEDIR}/${RELEASEMACHINEDIR}. 90# Directories to build in ${RELEASEDIR}/${RELEASEMACHINEDIR}.
91# MD Makefile.inc files can add to this. 91# MD Makefile.inc files can add to this.
92# NOTE: Parent directories must be listed before subdirectories. 92# NOTE: Parent directories must be listed before subdirectories.
93# 93#
94INSTALLATION_DIRS= binary binary/sets binary/kernel installation 94INSTALLATION_DIRS= binary binary/sets binary/kernel installation
95 95
96.if exists(etc.${RELEASEMACHINE}/Makefile.inc) 96.if exists(etc.${RELEASEMACHINE}/Makefile.inc)
97.include "etc.${RELEASEMACHINE}/Makefile.inc" 97.include "etc.${RELEASEMACHINE}/Makefile.inc"
98.endif 98.endif
99 99
100# -rw-r--r-- 100# -rw-r--r--
101BINOWN= root 101BINOWN= root
102BINGRP= wheel 102BINGRP= wheel
103UTMPGRP= utmp 103UTMPGRP= utmp
104BIN1+= auto_master bootptab changelist csh.cshrc csh.login \ 104BIN1+= auto_master bootptab changelist csh.cshrc csh.login \
105 csh.logout daily daily.conf dm.conf envsys.conf floppytab ftpchroot \ 105 csh.logout daily daily.conf dm.conf envsys.conf floppytab ftpchroot \
106 ftpusers gettytab gpio.conf group hosts hosts.lpd inetd.conf \ 106 ftpusers gettytab gpio.conf group hosts hosts.lpd inetd.conf \
107 locate.conf login.conf mailer.conf man.conf monthly monthly.conf \ 107 locate.conf login.conf mailer.conf man.conf monthly monthly.conf \
108 mrouted.conf named.conf netconfig networks newsyslog.conf \ 108 mrouted.conf named.conf netconfig networks newsyslog.conf \
109 nsswitch.conf ntp.conf passwd.conf pkgpath.conf phones printcap \ 109 nsswitch.conf ntp.conf passwd.conf pkgpath.conf phones printcap \
110 profile protocols rbootd.conf rc rc.conf rc.local rc.subr \ 110 profile protocols rbootd.conf rc rc.conf rc.local rc.subr \
111 rc.shutdown remote rpc security security.conf services shells \ 111 rc.shutdown remote rpc security security.conf services shells \
112 shrc sysctl.conf syslog.conf weekly weekly.conf wscons.conf 112 shrc sysctl.conf syslog.conf weekly weekly.conf wscons.conf
113 113
114# Use machine-specific disktab if it exists, or the MI one otherwise 114# Use machine-specific disktab if it exists, or the MI one otherwise
115.if exists(etc.${MACHINE}/disktab) 115.if exists(etc.${MACHINE}/disktab)
116BIN1+= etc.${MACHINE}/disktab 116BIN1+= etc.${MACHINE}/disktab
117.else 117.else
118BIN1+= disktab 118BIN1+= disktab
119.endif 119.endif
120 120
121.if exists(etc.${MACHINE}/ld.so.conf) && \ 121.if exists(etc.${MACHINE}/ld.so.conf) && \
122 empty(MACHINE_ARCH:M*arm*hf*) && empty(MACHINE_ARCH:Maarch64*) 122 empty(MACHINE_ARCH:M*arm*hf*) && empty(MACHINE_ARCH:Maarch64*)
123BIN1+= etc.${MACHINE}/ld.so.conf 123BIN1+= etc.${MACHINE}/ld.so.conf
124.endif 124.endif
125 125
126.if exists(etc.${MACHINE}/ttyaction) 126.if exists(etc.${MACHINE}/ttyaction)
127BIN1+= etc.${MACHINE}/ttyaction 127BIN1+= etc.${MACHINE}/ttyaction
128.endif 128.endif
129 129
130# -rw-rw-r-- 130# -rw-rw-r--
131BIN2+= motd 131BIN2+= motd
132FILESBUILD_motd= YES 132FILESBUILD_motd= YES
133 133
134# -rw------- 134# -rw-------
135BIN3+= hosts.equiv wpa_supplicant.conf 135BIN3+= hosts.equiv wpa_supplicant.conf
136 136
137SYSPKG= etc 137SYSPKG= etc
138ETC_PKG=-T etc_pkg 138ETC_PKG=-T etc_pkg
139BASE_PKG=-T base_pkg 139BASE_PKG=-T base_pkg
140ETC_INSTALL_FILE=cd ${.CURDIR} && ${INSTALL_FILE} ${ETC_PKG} 140ETC_INSTALL_FILE=cd ${.CURDIR} && ${INSTALL_FILE} ${ETC_PKG}
141ETC_INSTALL_OBJ_FILE=cd ${.OBJDIR} && ${INSTALL_FILE} ${ETC_PKG} 141ETC_INSTALL_OBJ_FILE=cd ${.OBJDIR} && ${INSTALL_FILE} ${ETC_PKG}
142 142
143.if ${TARGET_ENDIANNESS} == "1234" 143.if ${TARGET_ENDIANNESS} == "1234"
144PWD_MKDB_ENDIAN= -L 144PWD_MKDB_ENDIAN= -L
145.elif ${TARGET_ENDIANNESS} == "4321" 145.elif ${TARGET_ENDIANNESS} == "4321"
146PWD_MKDB_ENDIAN= -B 146PWD_MKDB_ENDIAN= -B
147.else 147.else
148PWD_MKDB_ENDIAN= 148PWD_MKDB_ENDIAN=
149.endif 149.endif
150 150
151 151
152# distribution -- 152# distribution --
153# Build a distribution 153# Build a distribution
154# 154#
155distribution: .PHONY .MAKE check_DESTDIR distrib-dirs 155distribution: .PHONY .MAKE check_DESTDIR distrib-dirs
156.if !defined(DISTRIBUTION_DONE) 156.if !defined(DISTRIBUTION_DONE)
157.if !defined(INSTALL_DONE) 157.if !defined(INSTALL_DONE)
158 ${MAKEDIRTARGET} ${NETBSDSRCDIR} include _DISTRIB= 158 ${MAKEDIRTARGET} ${NETBSDSRCDIR} include _DISTRIB=
159 ${MAKEDIRTARGET} ${NETBSDSRCDIR} install _DISTRIB= 159 ${MAKEDIRTARGET} ${NETBSDSRCDIR} install _DISTRIB=
160.endif # !INSTALL_DONE 160.endif # !INSTALL_DONE
161 ${MAKEDIRTARGET} . install-etc-files 161 ${MAKEDIRTARGET} . install-etc-files
162. if ${MKX11} != "no" 162. if ${MKX11} != "no"
163 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/mit/xorg distribution 163 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/mit/xorg distribution
164. endif 164. endif
165. if ${MKEXTSRC} != "no" 165. if ${MKEXTSRC} != "no"
166 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/extsrc distribution 166 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/extsrc distribution
167. endif 167. endif
168 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets makesetfiles 168 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets makesetfiles
169.endif # !DISTRIBUTION_DONE 169.endif # !DISTRIBUTION_DONE
170 170
171 171
172# motd is copied from a different ${MOTD_SOURCE} depending on DISTRIBVER 172# motd is copied from a different ${MOTD_SOURCE} depending on DISTRIBVER
173# 173#
174.if !empty(DISTRIBVER:M*.99.*) 174.if !empty(DISTRIBVER:M*.99.*)
175MOTD_SOURCE= motd.current 175MOTD_SOURCE= motd.current
176.elif !empty(DISTRIBVER:M*BETA*) 176.elif !empty(DISTRIBVER:M*BETA*)
177MOTD_SOURCE= motd.beta 177MOTD_SOURCE= motd.beta
178.elif !empty(DISTRIBVER:M*RC*) 178.elif !empty(DISTRIBVER:M*RC*)
179MOTD_SOURCE= motd.rc 179MOTD_SOURCE= motd.rc
180.else 180.else
181MOTD_SOURCE= motd.default 181MOTD_SOURCE= motd.default
182.endif 182.endif
183CLEANFILES+= motd 183CLEANFILES+= motd
184motd: ${.CURDIR}/${MOTD_SOURCE} ${_NETBSD_VERSION_DEPENDS} 184motd: ${.CURDIR}/${MOTD_SOURCE} ${_NETBSD_VERSION_DEPENDS}
185 ${_MKTARGET_CREATE} 185 ${_MKTARGET_CREATE}
186 ${HOST_INSTALL_FILE} ${.CURDIR}/${MOTD_SOURCE} ${.TARGET} 186 ${HOST_INSTALL_FILE} ${.CURDIR}/${MOTD_SOURCE} ${.TARGET}
187 187
188CLEANFILES+= MAKEDEV 188CLEANFILES+= MAKEDEV
189MAKEDEV_MACHINE=${"${MACHINE_CPU}" == "aarch64":?${MACHINE_CPU}:${MACHINE}} 189MAKEDEV_MACHINE=${"${MACHINE_CPU}" == "aarch64":?${MACHINE_CPU}:${MACHINE}}
190MAKEDEV: ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \ 190MAKEDEV: ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \
191 ${.CURDIR}/etc.${MAKEDEV_MACHINE}/MAKEDEV.conf 191 ${.CURDIR}/etc.${MAKEDEV_MACHINE}/MAKEDEV.conf
192 ${_MKTARGET_CREATE} 192 ${_MKTARGET_CREATE}
193 MACHINE=${MAKEDEV_MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \ 193 MACHINE=${MAKEDEV_MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
194 NETBSDSRCDIR=${NETBSDSRCDIR:Q} \ 194 NETBSDSRCDIR=${NETBSDSRCDIR:Q} \
195 ${TOOL_AWK} -f ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \ 195 ${TOOL_AWK} -f ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \
196 > ${.TARGET} 196 > ${.TARGET}
197 197
198.include "${NETBSDSRCDIR}/etc/Makefile.params" 198.include "${NETBSDSRCDIR}/etc/Makefile.params"
199 199
200CLEANFILES+= etc-release 200CLEANFILES+= etc-release
201etc-release: .EXEC .MAKE 201etc-release: .EXEC .MAKE
202 ${_MKTARGET_CREATE} 202 ${_MKTARGET_CREATE}
203 @( echo "NetBSD ${DISTRIBVER}/${MACHINE}"; \ 203 @( echo "NetBSD ${DISTRIBVER}/${MACHINE}"; \
204 echo ; \ 204 echo ; \
205 cat ${NETBSDSRCDIR}/sys/conf/copyright; \ 205 cat ${NETBSDSRCDIR}/sys/conf/copyright; \
206 echo ; \ 206 echo ; \
207 echo "Build information:"; \ 207 echo "Build information:"; \
208 printf "%20s %s\n" "Build date" "${BUILD_DATE}"; \ 208 printf "%20s %s\n" "Build date" "${BUILD_DATE}"; \
209 printf "%20s %s\n" "Built by" "${BUILDER}"; \ 209 printf "%20s %s\n" "Built by" "${BUILDER}"; \
210 if [ -n "${BUILDID}" ]; then \ 210 if [ -n "${BUILDID}" ]; then \
211 printf "%20s %s\n" "Build ID" "${BUILDID}" ; \ 211 printf "%20s %s\n" "Build ID" "${BUILDID}" ; \
212 fi ; \ 212 fi ; \
213 if [ -n "${BUILDINFO}" ]; then \ 213 if [ -n "${BUILDINFO}" ]; then \
214 echo ; \ 214 echo ; \
215 info="$$(printf "%b" ${BUILDINFO:Q})" ; \ 215 info="$$(printf "%b" ${BUILDINFO:Q})" ; \
216 printf "%s\n" "$${info}" \ 216 printf "%s\n" "$${info}" \
217 | ${TOOL_SED} -e 's/^/ /' ; \ 217 | ${TOOL_SED} -e 's/^/ /' ; \
218 fi ; \ 218 fi ; \
219 echo ; \ 219 echo ; \
220 echo "Build settings:"; \ 220 echo "Build settings:"; \
221 echo ; \ 221 echo ; \
222 ${PRINT_PARAMS} ; \ 222 ${PRINT_PARAMS} ; \
223 ) >${.OBJDIR}/${.TARGET} 223 ) >${.OBJDIR}/${.TARGET}
224 224
225install-etc-release: .PHONY etc-release 225install-etc-release: .PHONY etc-release
226 ${_MKMSG_INSTALL} etc/release 226 ${_MKMSG_INSTALL} etc/release
227 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 444 \ 227 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 444 \
228 etc-release ${DESTDIR}/etc/release 228 etc-release ${DESTDIR}/etc/release
229 229
230 230
231FILESDIR= /etc 231FILESDIR= /etc
232CONFIGFILES= 232CONFIGFILES=
233CONFIGSYMLINKS= 233CONFIGSYMLINKS=
234 234
235.for file in ${BIN1} 235.for file in ${BIN1}
236CONFIGFILES+= ${file} 236CONFIGFILES+= ${file}
237FILESMODE_${file:T}= 644 237FILESMODE_${file:T}= 644
238.endfor 238.endfor
239 239
240.for file in ${BIN2} 240.for file in ${BIN2}
241CONFIGFILES+= ${file} 241CONFIGFILES+= ${file}
242FILESMODE_${file:T}= 664 242FILESMODE_${file:T}= 664
243.endfor 243.endfor
244 244
245.for file in ${BIN3} 245.for file in ${BIN3}
246CONFIGFILES+= ${file} 246CONFIGFILES+= ${file}
247FILESMODE_${file:T}= 600 247FILESMODE_${file:T}= 600
248.endfor 248.endfor
249 249
250.if (${MKPOSTFIX} != "no") 250.if (${MKPOSTFIX} != "no")
251CONFIGFILES+= aliases 251CONFIGFILES+= aliases
252FILESDIR_aliases= /etc/mail 252FILESDIR_aliases= /etc/mail
253FILESMODE_aliases= 644 253FILESMODE_aliases= 644
254.endif 254.endif
255 255
256CONFIGFILES+= MAKEDEV.local 256CONFIGFILES+= MAKEDEV.local
257FILESDIR_MAKEDEV.local= /dev 257FILESDIR_MAKEDEV.local= /dev
258FILESMODE_MAKEDEV.local=${BINMODE} 258FILESMODE_MAKEDEV.local=${BINMODE}
259 259
260CONFIGFILES+= crontab 260CONFIGFILES+= crontab
261FILESDIR_crontab= /var/cron/tabs 261FILESDIR_crontab= /var/cron/tabs
262FILESNAME_crontab= root 262FILESNAME_crontab= root
263FILESMODE_crontab= 600 263FILESMODE_crontab= 600
264 264
265CONFIGFILES+= minfree 265CONFIGFILES+= minfree
266FILESDIR_minfree= /var/crash 266FILESDIR_minfree= /var/crash
267FILESMODE_minfree= 600 267FILESMODE_minfree= 600
268 268
269CONFIGSYMLINKS+= ${TZDIR}/${LOCALTIME} /etc/localtime \ 269CONFIGSYMLINKS+= ${TZDIR}/${LOCALTIME} /etc/localtime \
270 /usr/sbin/rmt /etc/rmt 270 /usr/sbin/rmt /etc/rmt
271 271
272 272
273# install-etc-files -- 273# install-etc-files --
274# Install etc (config) files; not performed by "make build" 274# Install etc (config) files; not performed by "make build"
275# 275#
276install-etc-files: .PHONY .MAKE check_DESTDIR MAKEDEV 276install-etc-files: .PHONY .MAKE check_DESTDIR MAKEDEV
277 ${_MKMSG_INSTALL} ${DESTDIR}/etc/master.passwd 277 ${_MKMSG_INSTALL} ${DESTDIR}/etc/master.passwd
278 ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 278 ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
279 master.passwd ${DESTDIR}/etc 279 master.passwd ${DESTDIR}/etc
280 ${TOOL_PWD_MKDB} -p ${PWD_MKDB_ENDIAN} -d ${DESTDIR}/ \ 280 ${TOOL_PWD_MKDB} -p ${PWD_MKDB_ENDIAN} -d ${DESTDIR}/ \
281 ${DESTDIR}/etc/master.passwd 281 ${DESTDIR}/etc/master.passwd
282.if ${MKUNPRIVED} != "no" 282.if ${MKUNPRIVED} != "no"
283 ( \ 283 ( \
284 mode=0600; \ 284 mode=0600; \
285 for metaent in spwd.db passwd pwd.db; do \ 285 for metaent in spwd.db passwd pwd.db; do \
286 echo "./etc/$${metaent} type=file mode=$${mode} uname=root gname=wheel tags=etc_pkg"; \ 286 echo "./etc/$${metaent} type=file mode=$${mode} uname=root gname=wheel tags=etc_pkg"; \
287 mode=0644; \ 287 mode=0644; \
288 done; \ 288 done; \
289 ) | ${METALOG.add} 289 ) | ${METALOG.add}
290.endif # MKUNPRIVED != no 290.endif # MKUNPRIVED != no
291 ${_MKMSG_INSTALL} ${DESTDIR}/etc/ttys 291 ${_MKMSG_INSTALL} ${DESTDIR}/etc/ttys
292.if exists(${.CURDIR}/etc.${MACHINE}/ttys) 292.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
293 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 293 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
294 ${.CURDIR}/etc.${MACHINE}/ttys ${DESTDIR}/etc 294 ${.CURDIR}/etc.${MACHINE}/ttys ${DESTDIR}/etc
295.else 295.else
296 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 296 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
297 ${.CURDIR}/etc.${MACHINE_CPU}/ttys ${DESTDIR}/etc 297 ${.CURDIR}/etc.${MACHINE_CPU}/ttys ${DESTDIR}/etc
298.endif 298.endif
299.if exists(etc.${MACHINE}/boot.cfg) 299.if exists(etc.${MACHINE}/boot.cfg)
300 ${_MKMSG_INSTALL} ${DESTDIR}/boot.cfg 300 ${_MKMSG_INSTALL} ${DESTDIR}/boot.cfg
301 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 301 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
302 ${.CURDIR}/etc.${MACHINE}/boot.cfg ${DESTDIR}/ 302 ${.CURDIR}/etc.${MACHINE}/boot.cfg ${DESTDIR}/
303.endif 303.endif
304 ${_MKMSG_INSTALL} ${DESTDIR}/dev/MAKEDEV 304 ${_MKMSG_INSTALL} ${DESTDIR}/dev/MAKEDEV
305 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \ 305 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
306 MAKEDEV ${DESTDIR}/dev 306 MAKEDEV ${DESTDIR}/dev
307.for owner group mode file in \ 307.for owner group mode file in \
308 ${BINOWN} operator 664 /etc/dumpdates \ 308 ${BINOWN} operator 664 /etc/dumpdates \
309 ${BINOWN} operator 600 /etc/skeykeys \ 309 ${BINOWN} operator 600 /etc/skeykeys \
310 root wheel 600 /var/at/at.deny \ 310 root wheel 600 /var/at/at.deny \
311 root wheel 644 /var/db/locate.database \ 311 root wheel 644 /var/db/locate.database \
312 ${BINOWN} ${BINGRP} 600 /var/log/authlog \ 312 ${BINOWN} ${BINGRP} 600 /var/log/authlog \
313 root wheel 600 /var/log/cron \ 313 root wheel 600 /var/log/cron \
314 ${BINOWN} ${UTMPGRP} 664 /var/log/lastlog \ 314 ${BINOWN} ${UTMPGRP} 664 /var/log/lastlog \
315 ${BINOWN} ${UTMPGRP} 664 /var/log/lastlogx \ 315 ${BINOWN} ${UTMPGRP} 664 /var/log/lastlogx \
316 ${BINOWN} ${BINGRP} 640 /var/log/lpd-errs \ 316 ${BINOWN} ${BINGRP} 640 /var/log/lpd-errs \
317 ${BINOWN} ${BINGRP} 600 /var/log/maillog \ 317 ${BINOWN} ${BINGRP} 600 /var/log/maillog \
318 ${BINOWN} ${BINGRP} 644 /var/log/messages \ 318 ${BINOWN} ${BINGRP} 644 /var/log/messages \
319 ${BINOWN} ${BINGRP} 600 /var/log/secure \ 319 ${BINOWN} ${BINGRP} 600 /var/log/secure \
320 ${BINOWN} ${UTMPGRP} 664 /var/log/wtmp \ 320 ${BINOWN} ${UTMPGRP} 664 /var/log/wtmp \
321 ${BINOWN} ${UTMPGRP} 664 /var/log/wtmpx \ 321 ${BINOWN} ${UTMPGRP} 664 /var/log/wtmpx \
322 ${BINOWN} ${BINGRP} 600 /var/log/xferlog \ 322 ${BINOWN} ${BINGRP} 600 /var/log/xferlog \
323 daemon staff 664 /var/msgs/bounds \ 323 daemon staff 664 /var/msgs/bounds \
324 ${BINOWN} ${UTMPGRP} 664 /var/run/utmp \ 324 ${BINOWN} ${UTMPGRP} 664 /var/run/utmp \
325 ${BINOWN} ${UTMPGRP} 664 /var/run/utmpx \ 325 ${BINOWN} ${UTMPGRP} 664 /var/run/utmpx \
326 games games 664 /var/games/atc_score \ 326 games games 664 /var/games/atc_score \
327 games games 664 /var/games/battlestar.log \ 327 games games 664 /var/games/battlestar.log \
328 games games 664 /var/games/cfscores \ 328 games games 664 /var/games/cfscores \
329 games games 664 /var/games/criblog \ 329 games games 664 /var/games/criblog \
330 games games 660 /var/games/hackdir/perm \ 330 games games 660 /var/games/hackdir/perm \
331 games games 660 /var/games/hackdir/record \ 331 games games 660 /var/games/hackdir/record \
332 games games 664 /var/games/larn/llog12.0 \ 332 games games 664 /var/games/larn/llog12.0 \
333 games games 664 /var/games/larn/lscore12.0 \ 333 games games 664 /var/games/larn/lscore12.0 \
334 games games 664 /var/games/larn/playerids \ 334 games games 664 /var/games/larn/playerids \
335 games games 664 /var/games/robots_roll \ 335 games games 664 /var/games/robots_roll \
336 games games 664 /var/games/rogue.scores \ 336 games games 664 /var/games/rogue.scores \
337 games games 664 /var/games/saillog \ 337 games games 664 /var/games/saillog \
338 games games 664 /var/games/snakerawscores \ 338 games games 664 /var/games/snakerawscores \
339 games games 664 /var/games/snake.log \ 339 games games 664 /var/games/snake.log \
340 games games 664 /var/games/tetris.scores 340 games games 664 /var/games/tetris.scores
341 ${_MKMSG_INSTALL} ${DESTDIR}${file} 341 ${_MKMSG_INSTALL} ${DESTDIR}${file}
342 if [ ! -e ${DESTDIR}${file} -o -s ${DESTDIR}${file} ]; then \ 342 if [ ! -e ${DESTDIR}${file} -o -s ${DESTDIR}${file} ]; then \
343 ${ETC_INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} \ 343 ${ETC_INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} \
344 /dev/null ${DESTDIR}${file}; \ 344 /dev/null ${DESTDIR}${file}; \
345 else true; fi 345 else true; fi
346.endfor 346.endfor
347.for subdir in . defaults autofs bluetooth iscsi mtree namedb pam.d powerd rc.d root skel ssh 347.for subdir in . defaults autofs bluetooth iscsi mtree namedb pam.d powerd rc.d root skel ssh
348 ${MAKEDIRTARGET} ${subdir} configinstall 348 ${MAKEDIRTARGET} ${subdir} configinstall
349.endfor 349.endfor
350 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/dhcpcd/sbin/dhcpcd configinstall 350 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/dhcpcd/sbin/dhcpcd configinstall
351 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.bin/mail configinstall 351 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.bin/mail configinstall
352.if (${MKPF} != "no") 352.if (${MKPF} != "no")
353 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.sbin/pf configinstall 353 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.sbin/pf configinstall
354.endif 354.endif
355 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/crypto/external/bsd/openssh/bin configinstall 355 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/crypto/external/bsd/openssh/bin configinstall
356.if (${MKPOSTFIX} != "no") 356.if (${MKPOSTFIX} != "no")
357 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/ibm-public/postfix configinstall 357 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/ibm-public/postfix configinstall
358.endif 358.endif
359.if (${MKATF} != "no") 359.if (${MKATF} != "no")
360 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/atf/etc/atf configinstall 360 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/atf/etc/atf configinstall
361.endif 361.endif
362.if (${MKKYUA} != "no") 362.if (${MKKYUA} != "no")
363 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/kyua-cli/etc/kyua configinstall 363 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/kyua-cli/etc/kyua configinstall
364.endif 364.endif
365 365
366 366
367# install-obsolete-lists -- 367# install-obsolete-lists --
368# Install var/db/obsolete set lists; this is performed by "make build" 368# Install var/db/obsolete set lists; this is performed by "make build"
369# 369#
370OBSOLETE.dir= ${.OBJDIR}/obsolete.dir 370OBSOLETE.dir= ${.OBJDIR}/obsolete.dir
371OBSOLETE.files= base comp etc games man misc rescue text 371OBSOLETE.files= base comp etc games man misc rescue text
372.if ${MKDEBUG} != "no" 372.if ${MKDEBUG} != "no"
373OBSOLETE.files+= debug 373OBSOLETE.files+= debug
374.endif 374.endif
375.if ${MKDTB} != "no" 375.if ${MKDTB} != "no"
376OBSOLETE.files+= dtb 376OBSOLETE.files+= dtb
377.endif 377.endif
378.if ${MKKMOD} != "no" 378.if ${MKKMOD} != "no"
379OBSOLETE.files+= modules 379OBSOLETE.files+= modules
380.endif 380.endif
381.if ${MKATF} != "no" 381.if ${MKATF} != "no"
382OBSOLETE.files+= tests 382OBSOLETE.files+= tests
383.endif 383.endif
384.if ${MKX11} != "no" 384.if ${MKX11} != "no"
385OBSOLETE.files+= xbase xcomp xetc xfont xserver 385OBSOLETE.files+= xbase xcomp xetc xfont xserver
386.if ${MKDEBUG} != "no" 386.if ${MKDEBUG} != "no"
387OBSOLETE.files+= xdebug 387OBSOLETE.files+= xdebug
388.endif 388.endif
389.endif 389.endif
390 390
391# XXX make "makeobsolete" set wise; then generate files respectively 391# XXX make "makeobsolete" set wise; then generate files respectively
392install-obsolete-lists: .PHONY .MAKE 392install-obsolete-lists: .PHONY .MAKE
393 mkdir -p ${OBSOLETE.dir} 393 mkdir -p ${OBSOLETE.dir}
394.if ${MKX11} != "no" 394.if ${MKX11} != "no"
395 (cd ${NETBSDSRCDIR}/distrib/sets && \ 395 (cd ${NETBSDSRCDIR}/distrib/sets && \
396 AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -b -t ${OBSOLETE.dir}) 396 AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -b -t ${OBSOLETE.dir})
397.else 397.else
398 (cd ${NETBSDSRCDIR}/distrib/sets && \ 398 (cd ${NETBSDSRCDIR}/distrib/sets && \
399 AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -t ${OBSOLETE.dir}) 399 AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -t ${OBSOLETE.dir})
400.endif 400.endif
401.for file in ${OBSOLETE.files} 401.for file in ${OBSOLETE.files}
402 ${_MKMSG_INSTALL} ${DESTDIR}/var/db/obsolete/${file} 402 ${_MKMSG_INSTALL} ${DESTDIR}/var/db/obsolete/${file}
403 if [ ! -e ${DESTDIR}/var/db/obsolete/${file} ] || \ 403 if [ ! -e ${DESTDIR}/var/db/obsolete/${file} ] || \
404 ! cmp -s ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete/${file}; then \ 404 ! cmp -s ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete/${file}; then \
405 ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 405 ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
406 ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete; \ 406 ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete; \
407 else true; fi 407 else true; fi
408.endfor 408.endfor
409 409
410 410
411# distrib-dirs -- 411# distrib-dirs --
412# Populate $DESTDIR with directories needed by NetBSD 412# Populate $DESTDIR with directories needed by NetBSD
413# 413#
414distrib-dirs: .PHONY check_DESTDIR 414distrib-dirs: .PHONY check_DESTDIR
415 cd ${NETBSDSRCDIR}/etc/mtree && ${MAKE} distrib-dirs 415 cd ${NETBSDSRCDIR}/etc/mtree && ${MAKE} distrib-dirs
416 416
417COMPRESS_PROGRAM=${"${USE_XZ_SETS:Uno}"!="no":?${TOOL_XZ}:${TOOL_GZIP}} 417COMPRESS_PROGRAM=${"${USE_XZ_SETS:Uno}"!="no":?${TOOL_XZ}:${TOOL_GZIP}}
418XZ_OPT=-9 418XZ_OPT=-9
419TAR_SUFF=${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz} 419TAR_SUFF=${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz}
420 420
421# release, snapshot -- 421# release, snapshot --
422# Build a full distribution including kernels & install media. 422# Build a full distribution including kernels & install media.
423# 423#
424release snapshot: .PHONY .MAKE check_DESTDIR check_RELEASEDIR snap_md_post 424release snapshot: .PHONY .MAKE check_DESTDIR check_RELEASEDIR snap_md_post
425 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets sets 425 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets sets
426 ${MAKESUMS} -A -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets \ 426 ${MAKESUMS} -A -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets \
427 ${KERNEL_SETS:@.SETS.@kern-${.SETS.}.${TAR_SUFF}@} 427 ${KERNEL_SETS:@.SETS.@kern-${.SETS.}.${TAR_SUFF}@}
428 ${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel '*.gz' 428 ${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel '*.gz'
429 429
430 430
431# iso-image -- 431# iso-image --
432# Standalone target to create a CDROM image after the release 432# Standalone target to create a CDROM image after the release
433# was composed. Should be run after "make release" in src and xsrc. 433# was composed. Should be run after "make release" in src and xsrc.
434# The do-iso-image is to be called from etc.$MACHINE/Makefile.inc 434# The do-iso-image is to be called from etc.$MACHINE/Makefile.inc
435# 435#
436# Note: At least mkisofs 2.0 should be used. 436# Note: At least mkisofs 2.0 should be used.
437# 437#
438CDROM_NAME_ADD?= 438CDROM_NAME_ADD?=
439CDROM_IMAGE?=${RELEASEDIR}/images/NetBSD-${DISTRIBVER}-${MACHINE}.iso 439CDROM_IMAGE?=${RELEASEDIR}/images/NetBSD-${DISTRIBVER}-${MACHINE}.iso
440CDROM.dir= ${.OBJDIR}/cdrom.dir 440CDROM.dir= ${.OBJDIR}/cdrom.dir
441CDROM.pathlist= ${.OBJDIR}/cdrom.pathlist 441CDROM.pathlist= ${.OBJDIR}/cdrom.pathlist
442 442
443iso-image: 443iso-image:
444 444
445.if ${MKISOFS} != true 445.if ${MKISOFS} != true
446do-iso-image: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-post 446do-iso-image: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-post
447 ${MAKESUMS} -t ${RELEASEDIR}/images/ '*.iso' 447 ${MAKESUMS} -t ${RELEASEDIR}/images/ '*.iso'
448 @echo "iso-image created as: ${CDROM_IMAGE}" 448 @echo "iso-image created as: ${CDROM_IMAGE}"
449.else 449.else
450do-iso-image: 450do-iso-image:
451 @echo iso-image: mkisofs not found 451 @echo iso-image: mkisofs not found
452.endif 452.endif
453 453
454iso-image-setup: .PHONY check_RELEASEDIR 454iso-image-setup: .PHONY check_RELEASEDIR
455 rm -f ${CDROM.pathlist} 455 rm -f ${CDROM.pathlist}
456.for extra in README SOURCE_DATE source 456.for extra in README SOURCE_DATE source
457.if exists(${RELEASEDIR}/${extra}) 457.if exists(${RELEASEDIR}/${extra})
458 echo "${extra}=${RELEASEDIR}/${extra}" >> ${CDROM.pathlist} 458 echo "${extra}=${RELEASEDIR}/${extra}" >> ${CDROM.pathlist}
459.endif 459.endif
460.endfor 460.endfor
461 echo "${MACHINE}/=${RELEASEDIR}/${RELEASEMACHINEDIR}/" >> ${CDROM.pathlist} 461 echo "${MACHINE}/=${RELEASEDIR}/${RELEASEMACHINEDIR}/" >> ${CDROM.pathlist}
462 mkdir -p ${CDROM.dir} 462 mkdir -p ${CDROM.dir}
463 463
464check_imagedir: 464check_imagedir:
465 mkdir -p ${RELEASEDIR}/images 465 mkdir -p ${RELEASEDIR}/images
466 466
467# iso-image-mi -- 467# iso-image-mi --
468# Create the image after the MD operations have completed. 468# Create the image after the MD operations have completed.
469# 469#
470iso-image-mi: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-pre check_imagedir 470iso-image-mi: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-pre check_imagedir
471 @if ! ${MKISOFS} --version; then \ 471 @if ! ${MKISOFS} --version; then \
472 echo "install pkgsrc/sysutils/cdrtools and run 'make iso-image'." ; \ 472 echo "install pkgsrc/sysutils/cdrtools and run 'make iso-image'." ; \
473 false; \ 473 false; \
474 fi 474 fi
475 ${MKISOFS} ${MKISOFS_FLAGS} -graft-points -path-list ${CDROM.pathlist} \ 475 ${MKISOFS} ${MKISOFS_FLAGS} -graft-points -path-list ${CDROM.pathlist} \
476 -o ${CDROM_IMAGE} ${CDROM.dir} 476 -o ${CDROM_IMAGE} ${CDROM.dir}
477 477
478# iso-image-md-pre -- 478# iso-image-md-pre --
479# Setup ${CDROM.dir} to produce a bootable CD image. 479# Setup ${CDROM.dir} to produce a bootable CD image.
480# Overridden by etc.$MACHINE/Makefile.inc 480# Overridden by etc.$MACHINE/Makefile.inc
481# 481#
482iso-image-md-pre: .PHONY check_DESTDIR check_RELEASEDIR iso-image-setup 482iso-image-md-pre: .PHONY check_DESTDIR check_RELEASEDIR iso-image-setup
483# (empty -- look in the machine-dependent Makefile.inc) 483# (empty -- look in the machine-dependent Makefile.inc)
484 484
485# iso-image-md-post -- 485# iso-image-md-post --
486# Fixup the CD-image to be bootable. 486# Fixup the CD-image to be bootable.
487# Overridden by etc.$MACHINE/Makefile.inc 487# Overridden by etc.$MACHINE/Makefile.inc
488# 488#
489iso-image-md-post: .PHONY check_DESTDIR check_RELEASEDIR iso-image-mi 489iso-image-md-post: .PHONY check_DESTDIR check_RELEASEDIR iso-image-mi
490# (empty -- look in the machine-dependent Makefile.inc) 490# (empty -- look in the machine-dependent Makefile.inc)
491 491
492 492
493# live-image -- 493# live-image --
494# Standalone target to create live images after the release was composed. 494# Standalone target to create live images after the release was composed.
495# Should be run after "make release" in src and xsrc. 495# Should be run after "make release" in src and xsrc.
496# LIVEIMG_RELEASEDIR specifies where to install live images and 496# LIVEIMG_RELEASEDIR specifies where to install live images and
497# it can be set in MD etc.${MACHINE}/Makefile.inc. 497# it can be set in MD etc.${MACHINE}/Makefile.inc.
498# 498#
499LIVEIMG_RELEASEDIR?= ${RELEASEDIR}/images 499LIVEIMG_RELEASEDIR?= ${RELEASEDIR}/images
500 500
501live-image: .PHONY check_DESTDIR check_RELEASEDIR 501live-image: .PHONY check_DESTDIR check_RELEASEDIR
502 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib live_image \ 502 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib live_image \
503 LIVEIMG_RELEASEDIR=${LIVEIMG_RELEASEDIR} 503 LIVEIMG_RELEASEDIR=${LIVEIMG_RELEASEDIR}
504 ${MAKESUMS} -t ${LIVEIMG_RELEASEDIR} '*.img.gz' 504 ${MAKESUMS} -t ${LIVEIMG_RELEASEDIR} '*.img.gz'
505 505
506# install-image -- 506# install-image --
507# Standalone target to create installation images 507# Standalone target to create installation images
508# after the release was composed. 508# after the release was composed.
509# Should be run after "make release" in src and xsrc. 509# Should be run after "make release" in src and xsrc.
510# INSTIMG_RELEASEDIR specifies where to install live images and 510# INSTIMG_RELEASEDIR specifies where to install live images and
511# it can be set in MD etc.${MACHINE}/Makefile.inc. 511# it can be set in MD etc.${MACHINE}/Makefile.inc.
512# 512#
513INSTIMG_RELEASEDIR?= ${RELEASEDIR}/images 513INSTIMG_RELEASEDIR?= ${RELEASEDIR}/images
514 514
515install-image: .PHONY check_DESTDIR check_RELEASEDIR 515install-image: .PHONY check_DESTDIR check_RELEASEDIR
516 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib install_image \ 516 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib install_image \
517 INSTIMG_RELEASEDIR=${INSTIMG_RELEASEDIR} 517 INSTIMG_RELEASEDIR=${INSTIMG_RELEASEDIR}
518 ${MAKESUMS} -t ${INSTIMG_RELEASEDIR} '*.img.gz' 518 ${MAKESUMS} -t ${INSTIMG_RELEASEDIR} '*.img.gz'
519 519
520# snap_pre -- 520# snap_pre --
521# Create ${RELEASEDIR} and necessary subdirectories. 521# Create ${RELEASEDIR} and necessary subdirectories.
522# 522#
523snap_pre: .PHONY check_DESTDIR check_RELEASEDIR distribution 523snap_pre: .PHONY check_DESTDIR check_RELEASEDIR distribution
524 ${INSTALL} -d -m 755 ${RELEASEDIR} 524 ${INSTALL} -d -m 755 ${RELEASEDIR}
525.if ${MKUPDATE} == "no" 525.if ${MKUPDATE} == "no"
526# Could be a mount point, ignore the errors 526# Could be a mount point, ignore the errors
527 -/bin/rm -rf ${RELEASEDIR}/${RELEASEMACHINEDIR} 527 -/bin/rm -rf ${RELEASEDIR}/${RELEASEMACHINEDIR}
528.endif 528.endif
529 ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR} 529 ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}
530.for dir in ${INSTALLATION_DIRS} 530.for dir in ${INSTALLATION_DIRS}
531 ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}/${dir} 531 ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}/${dir}
532.endfor 532.endfor
533 533
534# snap_post -- 534# snap_post --
535# Build the install media and notes from distrib 535# Build the install media and notes from distrib
536# 536#
537snap_post: .PHONY .MAKE build_kernelsets build_releasekernels 537snap_post: .PHONY .MAKE build_kernelsets build_releasekernels
538.if ${MKUPDATE} == "no" 538.if ${MKUPDATE} == "no"
539 cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir 539 cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir
540.endif 540.endif
541 cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \ 541 cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \
542 ${MAKE} release 542 ${MAKE} release
543 543
544# build kernels -- 544# build kernels --
545# This target builds the kernels specified by each port. 545# This target builds the kernels specified by each port.
546# A port may specify the following kernels: 546# A port may specify the following kernels:
547# 547#
548# KERNEL_SETS The list of kernels that will be 548# KERNEL_SETS The list of kernels that will be
549# packaged into sets, named 549# packaged into sets, named
550# kern-${kernel}.tgz (or .tar.xz). 550# kern-${kernel}.tgz (or .tar.xz).
551# These kernels are also placed in the 551# These kernels are also placed in the
552# binary/kernel area of the release package 552# binary/kernel area of the release package
553# as netbsd-${kernel}.gz. 553# as netbsd-${kernel}.gz.
554# 554#
555# EXTRA_KERNELS Additional kernels to place in the 555# EXTRA_KERNELS Additional kernels to place in the
556# binary/kernel area of the release 556# binary/kernel area of the release
557# package as netbsd-${kernel}.gz, but 557# package as netbsd-${kernel}.gz, but
558# which are not placed into sets. This 558# which are not placed into sets. This
559# allows a port to provide e.g. a netbootable 559# allows a port to provide e.g. a netbootable
560# installation kernel containing a ramdisk. 560# installation kernel containing a ramdisk.
561# 561#
562# BUILD_KERNELS Additional kernels to build which are 562# BUILD_KERNELS Additional kernels to build which are
563# not placed into sets nor into the 563# not placed into sets nor into the
564# binary/kernel area of the release 564# binary/kernel area of the release
565# package. These are typically kernels 565# package. These are typically kernels
566# that are built for inclusion only in 566# that are built for inclusion only in
567# installation disk/CD-ROM/tape images. 567# installation disk/CD-ROM/tape images.
568# 568#
569# A port may also specify KERNEL_SUFFIXES, which is an optional list 569# A port may also specify KERNEL_SUFFIXES, which is an optional list
570# of filename suffixes for kernels to include in the kernel sets and 570# of filename suffixes for kernels to include in the kernel sets and
571# in the binary/kernel area of the release package (e.g. "netbsd" vs. 571# in the binary/kernel area of the release package (e.g. "netbsd" vs.
572# "netbsd.ecoff" and "netbsd.srec"). It is not an error if kernels 572# "netbsd.ecoff" and "netbsd.srec"). It is not an error if kernels
573# with these suffixes do not exist in the kernel build directory. 573# with these suffixes do not exist in the kernel build directory.
574# 574#
575# 575#
576# A list of all the kernels to build, which can be overridden from 576# A list of all the kernels to build, which can be overridden from
577# external sources (such as make(1)'s environment or command line) 577# external sources (such as make(1)'s environment or command line)
578# 578#
579ALL_KERNELS?= ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS} 579ALL_KERNELS?= ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS}
580.export ALL_KERNELS 580.export ALL_KERNELS
581 581
582GETKERNELAWK= ${TOOL_AWK} '/^config/ {print $$2; found=1} \ 582GETKERNELAWK= ${TOOL_AWK} '/^config/ {print $$2; found=1} \
583 END{ if (found == 0) print "netbsd"; }' 583 END{ if (found == 0) print "netbsd"; }'
584 584
585build_kernels: .PHONY 585build_kernels: .PHONY
586# Configure & compile kernels listed in ${ALL_KERNELS} 586# Configure & compile kernels listed in ${ALL_KERNELS}
587# 587#
588.if !defined(KERNELS_DONE) # { 588.if !defined(KERNELS_DONE) # {
589.for configfile in ${ALL_KERNELS:O:u} # { 589.for configfile in ${ALL_KERNELS:O:u} # {
590build_kernels: kern-${configfile} 590build_kernels: kern-${configfile}
591kern-${configfile}: .PHONY .MAKE 591kern-${configfile}: .PHONY .MAKE
592 cd ${KERNCONFDIR} && ${TOOL_CONFIG} ${CONFIGOPTS} -s ${KERNSRCDIR} \ 592 cd ${KERNCONFDIR} && ${TOOL_CONFIG} ${CONFIGOPTS} -s ${KERNSRCDIR} \
593 -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile} 593 -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile}
594.if ${MKUPDATE} == "no" 594.if ${MKUPDATE} == "no"
595 ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} distclean 595 ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} distclean
596.endif 596.endif
597 ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} depend && \ 597 ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} depend && \
598 ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///}  598 ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///}
599.endfor # ALL_KERNELS # } 599.endfor # ALL_KERNELS # }
600.endif # KERNELS_DONE # } 600.endif # KERNELS_DONE # }
601 601
602build_kernelsets: .PHONY 602build_kernelsets: .PHONY
603# Create kernel sets from ${KERNEL_SETS} into 603# Create kernel sets from ${KERNEL_SETS} into
604# ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets 604# ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
605# 605#
606.for configfile in ${KERNEL_SETS:O:u} # { 606.for configfile in ${KERNEL_SETS:O:u} # {
607.for configsel in ${ALL_KERNELS:O:u} 607.for configsel in ${ALL_KERNELS:O:u}
608.if ${configfile} == ${configsel} 608.if ${configfile} == ${configsel}
609build_kernelsets: kernset-${configfile} 609build_kernelsets: kernset-${configfile}
610kernset-${configfile}: .PHONY build_kernels snap_pre 610kernset-${configfile}: .PHONY build_kernels snap_pre
611 @kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile}); \ 611 @kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile}); \
612 kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \ 612 kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
613 kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \ 613 kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \
614 kern_tgz=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets/kern-${configfile}.${TAR_SUFF}; \ 614 kern_tgz=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets/kern-${configfile}.${TAR_SUFF}; \
615 pax_cmd="GZIP=${GZIP_FLAGS:Q} XZ_OPT=${XZ_OPT:Q} ${TOOL_PAX} ${PAX_TIMESTAMP} --use-compress-program ${COMPRESS_PROGRAM:Q} -O -w -M -N ${NETBSDSRCDIR}/etc -f $${kern_tgz}"; \ 615 pax_cmd="GZIP=${GZIP_FLAGS:Q} XZ_OPT=${XZ_OPT:Q} ${TOOL_PAX} ${PAX_TIMESTAMP} --use-compress-program ${COMPRESS_PROGRAM:Q} -O -w -M -N ${NETBSDSRCDIR}/etc -f $${kern_tgz}"; \
616 cd $${kerndir} && { \ 616 cd $${kerndir} && { \
617 kernels=; newest=; \ 617 kernels=; newest=; \
618 for kernel in $${kernlist}; do \ 618 for kernel in $${kernlist}; do \
619 for s in "" $${kernsuffixes}; do \ 619 for s in "" $${kernsuffixes}; do \
620 ks="$${kernel}$${s}"; \ 620 ks="$${kernel}$${s}"; \
621 [ -f $${ks} ] || continue; \ 621 [ -f $${ks} ] || continue; \
622 kernels="$${kernels} $${ks}"; \ 622 kernels="$${kernels} $${ks}"; \
623 [ -z "$${newest}" -o $${ks} \ 623 [ -z "$${newest}" -o $${ks} \
624 -nt "$${newest}" ] && newest=$${ks}; \ 624 -nt "$${newest}" ] && newest=$${ks}; \
625 done; \ 625 done; \
626 done; \ 626 done; \
627 [ $${kern_tgz} -nt "$${newest}" ] || { \ 627 [ $${kern_tgz} -nt "$${newest}" ] || { \
628 echo "echo $${kernels} | $${pax_cmd}"; \ 628 echo "echo $${kernels} | $${pax_cmd}"; \
629 if [ ${KERNEL_DIR} = "yes" ]; then \ 629 if [ ${KERNEL_DIR} = "yes" ]; then \
630 tmpdir=kernel$$; \ 630 tmpdir=kernel$$; \
631 trap "rm -fr $${tmpdir}" 0 1 2 3 15; \ 631 trap "rm -fr $${tmpdir}" 0 1 2 3 15; \
632 mkdir -p $${tmpdir}/netbsd; \ 632 mkdir -p $${tmpdir}/netbsd; \
633 d=./netbsd; \ 633 d=./netbsd; \
634 cd $${tmpdir}; \ 634 cd $${tmpdir}; \
635 else \ 635 else \
636 d=.; \ 636 d=.; \
637 fi; \ 637 fi; \
638 ( echo "/set uname=${BINOWN} gname=${BINGRP}"; \ 638 ( echo "/set uname=${BINOWN} gname=${BINGRP}"; \
639 echo ". type=dir optional"; \ 639 echo ". type=dir optional"; \
640 if [ ${KERNEL_DIR} = "yes" ]; then \ 640 if [ ${KERNEL_DIR} = "yes" ]; then \
641 echo "./netbsd type=dir optional"; \ 641 echo "./netbsd type=dir optional"; \
642 fi; \ 642 fi; \
643 for kernel in $${kernels}; do \ 643 for kernel in $${kernels}; do \
644 if [ ${KERNEL_DIR} = "yes" ]; then \ 644 if [ ${KERNEL_DIR} = "yes" ]; then \
645 newname=$$(echo $${kernel} | \ 645 newname=$$(echo $${kernel} | \
646 ${TOOL_SED} -e s/netbsd/kernel/); \ 646 ${TOOL_SED} -e s/netbsd/kernel/); \
647 ln ../$${kernel} ./netbsd/$${newname}; \ 647 ln ../$${kernel} ./netbsd/$${newname}; \
648 else \ 648 else \
649 newname=$${kernel}; \ 649 newname=$${kernel}; \
650 fi; \ 650 fi; \
651 echo "$${d}/$${newname} type=file"; \ 651 echo "$${d}/$${newname} type=file"; \
652 done ) | eval $${pax_cmd}; \ 652 done ) | eval $${pax_cmd}; \
653 if [ ${KERNEL_DIR} = "yes" ]; then \ 653 if [ ${KERNEL_DIR} = "yes" ]; then \
654 mv $${kern_tgz} ..; \ 654 mv $${kern_tgz} ..; \
655 fi; \ 655 fi; \
656 } \ 656 } \
657 } 657 }
658.endif 658.endif
659.endfor 659.endfor
660.endfor # KERNEL_SETS # } 660.endfor # KERNEL_SETS # }
661 661
662build_releasekernels: .PHONY 662build_releasekernels: .PHONY
663# Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into 663# Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into
664# ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel 664# ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel
665# 665#
666.for configfile in ${KERNEL_SETS:O:u} ${EXTRA_KERNELS:O:u} # { 666.for configfile in ${KERNEL_SETS:O:u} ${EXTRA_KERNELS:O:u} # {
667.for configsel in ${ALL_KERNELS:O:u} 667.for configsel in ${ALL_KERNELS:O:u}
668.if ${configfile} == ${configsel} 668.if ${configfile} == ${configsel}
669build_releasekernels: releasekern-${configfile} 669build_releasekernels: releasekern-${configfile}
670releasekern-${configfile}: .PHONY build_kernels snap_pre 670releasekern-${configfile}: .PHONY build_kernels snap_pre
671 @kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}); \ 671 @kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}); \
672 kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \ 672 kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
673 kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \ 673 kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \
674 dest="${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel"; \ 674 dest="${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel"; \
675 cd $${kerndir} && { \ 675 cd $${kerndir} && { \
676 for kernel in $${kernlist}; do \ 676 for kernel in $${kernlist}; do \
677 for s in "" $${kernsuffixes}; do \ 677 for s in "" $${kernsuffixes}; do \
678 ks="$${kernel}$${s}"; \ 678 ks="$${kernel}$${s}"; \
679 [ ! -f $${ks} ] && continue; \ 679 [ ! -f $${ks} ] && continue; \
680 knl_gz="$${dest}/$${kernel}-${configfile:C/.*\///}$${s}.gz"; \ 680 knl_gz="$${dest}/$${kernel}-${configfile:C/.*\///}$${s}.gz"; \
681 [ $${knl_gz} -nt $${ks} ] && continue; \ 681 [ $${knl_gz} -nt $${ks} ] && continue; \
682 rm -f $${knl_gz}; \ 682 rm -f $${knl_gz}; \
683 echo "${TOOL_GZIP} ${GZIP_FLAGS} -c < $${kerndir}/$${ks} > $${knl_gz}"; \ 683 echo "${TOOL_GZIP} ${GZIP_FLAGS} -c < $${kerndir}/$${ks} > $${knl_gz}"; \
684 ${TOOL_GZIP} ${GZIP_FLAGS} -c < $${ks} > $${knl_gz}; \ 684 ${TOOL_GZIP} ${GZIP_FLAGS} -c < $${ks} > $${knl_gz}; \
685 done; \ 685 done; \
686 done; \ 686 done; \
687 } 687 }
688.endif 688.endif
689.endfor 689.endfor
690.endfor # KERNEL_SETS EXTRA_KERNELS # } 690.endfor # KERNEL_SETS EXTRA_KERNELS # }
691 691
692# snap_md_post -- 692# snap_md_post --
693# Machine dependent distribution media operations. 693# Machine dependent distribution media operations.
694# Overridden by etc.$MACHINE/Makefile.inc 694# Overridden by etc.$MACHINE/Makefile.inc
695# 695#
696snap_md_post: .PHONY check_DESTDIR check_RELEASEDIR snap_post 696snap_md_post: .PHONY check_DESTDIR check_RELEASEDIR snap_post
697# (empty -- look in the machine-dependent Makefile.inc) 697# (empty -- look in the machine-dependent Makefile.inc)
698 698
699 699
700clean: 700clean:
701 -rm -rf ${CDROM.dir} ${CDROM.pathlist} ${OBSOLETE.dir} 701 -rm -rf ${CDROM.dir} ${CDROM.pathlist} ${OBSOLETE.dir}
702 702
703SUBDIR= defaults rc.d mtree 703SUBDIR= defaults rc.d mtree
704 704
705.include <bsd.prog.mk> 705.include <bsd.prog.mk>
706.include <bsd.subdir.mk> 706.include <bsd.subdir.mk>
707 707
708test: 708test:
709 @echo ${OBSOLETE.files} 709 @echo ${OBSOLETE.files}