From a2cd8af64a791658c0e431c758f2a4bc93bac210 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 30 Jun 2007 05:54:03 +0000 Subject: [PATCH] Try to avoid accidental foot shooting by not allowing a virtual kernel to be installed unless DESTDIR is explicitly specified. --- sys/conf/kern.post.mk | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index d40d1f83d..5b3e52003 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -1,4 +1,4 @@ -# $DragonFly: src/sys/conf/kern.post.mk,v 1.10 2007/02/22 21:02:49 corecode Exp $ +# $DragonFly: src/sys/conf/kern.post.mk,v 1.11 2007/06/30 05:54:03 dillon Exp $ # # This Makefile covers the bottom part of the MI build instructions # @@ -106,7 +106,7 @@ kernel-tags: # Note: when moving the existing kernel to .old, it is by default stripped # so we do not have two full debug environments sitting in / eating up space. # -kernel-install: +kernel-install: kernel-installable @if [ ! -f ${SELECTEDKERNEL} ] ; then \ echo "You must build a kernel first." ; \ exit 1 ; \ @@ -134,7 +134,7 @@ kernel-install: ${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME} .endif -kernel-reinstall: +kernel-reinstall: kernel-installable .ifdef NOFSCHG ${INSTALL} -m 555 -o root -g wheel \ ${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME} @@ -143,6 +143,18 @@ kernel-reinstall: ${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME} .endif +# Require DESTDIR to be manually specified when installing a +# virtual kernel. +# +kernel-installable: +.if ${P} == vkernel +.if !defined(DESTDIR) + @echo "When installing a virtual kernel, DESTDIR must be manually specified" + @exit 1 +.endif +.endif + @exit 0 + .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) all: modules depend: modules-depend -- 2.11.4.GIT