From 0181ec6bebca000e87aa168d3c1cbb186b98a311 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 19 Nov 2012 14:36:33 +0100 Subject: [PATCH] etcforce and etcfiles fixup The way etcfiles was re-implemented was wrong as it would overwrite the password database. This patch adds back a proper etcfiles (safe) target, and a etcforce (unsafe) target. Change-Id: I141c37b29a449fca1ee362b7416750be0298dbfb --- Makefile | 9 ++++++--- etc/Makefile | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 96a897179..7c2ce1ef1 100644 --- a/Makefile +++ b/Makefile @@ -244,7 +244,7 @@ BUILDTARGETS+= do-lib .if !defined(__MINIX) # LSC Not used in MINIX3 BUILDTARGETS+= do-compat-lib -.endif # !defiend(__MINIX) +.endif # !defined(__MINIX) BUILDTARGETS+= do-build .if ${MKX11} != "no" BUILDTARGETS+= do-x11 @@ -270,15 +270,18 @@ START_TIME!= date .if defined(__MINIX) world: build .PHONY .MAKE - ${MAKEDIRTARGET} . etcforce + ${MAKEDIRTARGET} . etcfiles @echo "WARNING: " @echo "WARNING: The 'world' target is obsolete, please use 'build' instead." @echo "WARNING: " +etcfiles: .PHONY .MAKE + ${MAKEDIRTARGET} etc install-etc-files-safe DESTDIR=${DESTDIR:U/} + etcforce: .PHONY .MAKE ${MAKEDIRTARGET} etc install-etc-files DESTDIR=${DESTDIR:U/} -.endif # defiend(__MINIX) +.endif # defined(__MINIX) build: .PHONY .MAKE .if defined(BUILD_DONE) diff --git a/etc/Makefile b/etc/Makefile index b49bfa457..9cd11e6c6 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -317,13 +317,29 @@ CONFIGSYMLINKS+= \ # install-etc-files -- # Install etc (config) files; not performed by "make build" # -# LSC Minix administrator group is operator, not wheel install-etc-files: .PHONY .MAKE check_DESTDIR MAKEDEV ${_MKMSG_INSTALL} ${DESTDIR}/etc/master.passwd ${ETC_INSTALL_FILE} -o root -g operator -m 600 \ master.passwd ${DESTDIR}/etc ${TOOL_PWD_MKDB} -p ${PWD_MKDB_ENDIAN} -d ${DESTDIR}/ \ ${DESTDIR}/etc/master.passwd +.if defined(__MINIX) +# LSC: We need a safe install target for etc files, as this is expected from +# our current user base. This safe version only leaves out the master.passwd +# file in order not to loose any user account created. +# +# LSC: To ensure minimal modifications, the logic is a bit contrived, i.e. the +# NetBSD build system expect install-etc-files to be unsafe, so what was done +# is to separate that step into two steps, with the unsafe version refering +# (not by dependency, to ensure correct order of actions) the safe step, and +# use the following mapping in the main Makefile: +# etcforce -> install-etc-files (default NetBSD target) +# etcfiles -> install-etc-files-safe (new -safe- target) + ${MAKEDIRTARGET} . install-etc-files-safe + +install-etc-files-safe: .PHONY .MAKE check_DESTDIR MAKEDEV +# LSC Minix administrator group is operator, not wheel +.endif # defined(__MINIX) .if ${MKUNPRIVED} != "no" ( \ for metaent in passwd pwd.db spwd.db; do \