NetBSD/etc/defaults/Makefile
jym f56903492e Modify etc/defaults/Makefile so that architectures can specify an additional
rc.conf file. This one should reside under etc/etc.${MACHINE}/, and will
get automatically appended to etc/defaults/rc.conf at build time if present.

This is used by i386 and amd64 to append a small MD rc.conf(5) configuration
at the end of the defaults/rc.conf file, so that powerd(8) can be started
by default when we are running in a Xen environment. This is needed to support
save/restore functions for domains.

From all the alternatives proposed to fix that issue (from /etc/rc.conf
parsing in postinstall to etc/defaults/rc.conf arch-hooks) I believe
this one will appease everyone because it:
- does not touch etc/defaults/rc.conf template file,
- patches it at build time for MD hooks only when required,
- does not need to parse/modify a user-specified file like /etc/rc.conf (which
is a complex, error-prone operation),
- only enables powerd(8) by default when conditions are met (Xen environment)
while still allowing root to shoot himself in the foot if he wants to
override this manually in /etc/rc.conf.

See also http://mail-index.netbsd.org/tech-userlevel/2011/07/25/msg005246.html
2011-08-22 18:54:05 +00:00

24 lines
545 B
Makefile

# $NetBSD: Makefile,v 1.4 2011/08/22 18:54:06 jym Exp $
.include <bsd.own.mk>
CONFIGFILES= daily.conf monthly.conf security.conf weekly.conf
FILESDIR= /etc/defaults
FILESMODE= ${NONBINMODE}
# Manage arch-specific rc.conf(5) file
CONFIGFILES+= rc_conf
FILESNAME_rc_conf= rc.conf
FILESBUILD_rc_conf= yes
RCCONF_SRCS= ${.CURDIR}/rc.conf
.if exists(../etc.${MACHINE}/rc.conf)
RCCONF_SRCS+= ${.CURDIR}/../etc.${MACHINE}/rc.conf
.endif
rc_conf: ${RCCONF_SRCS}
${_MKTARGET_CREATE}
${TOOL_CAT} ${RCCONF_SRCS} > ${.TARGET}
.include <bsd.prog.mk>