From k@numeri.campus.luth.se  Mon Jul 31 13:25:21 2000
Return-Path: <k@numeri.campus.luth.se>
Received: from numeri.campus.luth.se (numeri.campus.luth.se [130.240.197.103])
	by hub.freebsd.org (Postfix) with ESMTP id 8F70C37BCD0
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 31 Jul 2000 13:25:19 -0700 (PDT)
	(envelope-from k@numeri.campus.luth.se)
Received: (from k@localhost)
	by numeri.campus.luth.se (8.9.3/8.9.3) id WAA04304;
	Mon, 31 Jul 2000 22:25:41 +0200 (CEST)
	(envelope-from k)
Message-Id: <200007312025.WAA04304@numeri.campus.luth.se>
Date: Mon, 31 Jul 2000 22:25:41 +0200 (CEST)
From: Johan Karlsson <k@numeri.campus.luth.se>
Reply-To: k@numeri.campus.luth.se
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] installkernel fails if DESTDIR is empty
X-Send-Pr-Version: 3.2

>Number:         20326
>Category:       misc
>Synopsis:       [PATCH] installkernel fails if DESTDIR is empty
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 31 13:30:01 PDT 2000
>Closed-Date:    Tue Mar 16 00:36:31 PST 2004
>Last-Modified:  Tue Mar 16 00:36:31 PST 2004
>Originator:     Johan Karlsson
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
>Environment:

src/Makefile.inc1:
     $FreeBSD: src/Makefile.inc1,v 1.163 2000/07/23 21:30:35 marcel Exp $

>Description:

	When building/installing world and a kernel by:

	# make buildworld
	# make buildkernel
	# make DESTDIR=foo installkernel
	# make DESTDIR=foo installworld
	
	the installkernel will fail if DESTDIR is an empty directory.

	Since this is the recomended way by src/UPDATING one would 
	expect this to work.

>How-To-Repeat:

	# make buildworld
	# make buildkernel
	# make DESTDIR=path_to_empty_dir installkernel

>Fix:
Index: Makefile.inc1
===================================================================
RCS file: /host/queeg.ludd/FreeBSD-mirror/ncvs/src/Makefile.inc1,v
retrieving revision 1.163
diff -u -r1.163 Makefile.inc1
--- Makefile.inc1	2000/07/23 21:30:35	1.163
+++ Makefile.inc1	2000/07/31 18:55:06
@@ -415,6 +415,9 @@
 # Install the kernel defined by INSTALLKERNEL
 #
 installkernel:
+	cd ${.CURDIR}; \
+		${CROSSENV} MACHINE=${MACHINE} \
+		    ${MAKE} -f Makefile.inc1 hierarchy
 	cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
 		${CROSSENV} MACHINE=${MACHINE} KERNEL=kernel ${MAKE} install
 



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->marcel 
Responsible-Changed-By: marcel 
Responsible-Changed-When: Mon Jul 31 14:03:06 PDT 2000 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=20326 

From: Johan Karlsson <k@numeri.campus.luth.se>
To: freebsd-gnats-submit@FreeBSD.org
Cc: obrien@FreeBSD.org
Subject: Re: misc/20326: [PATCH] installkernel fails if DESTDIR is empty
Date: Fri, 13 Oct 2000 21:19:55 +0200

 In current this will not fail any more due to changes in the 
 src/sys/module/*/Makefile, where David changes the install
 target to only install programs if the destdir exists.
 (eg. src/sys/modules/svr4/Makefile rev 1.19)
 
 However I belive this only hides the problem since some 
 programs will be missing if one only do:
 # make buildworld
 # make buildkernel
 # make DESTDIR=foo installkernel
 # make DESTDIR=foo installworld
 
 
 One still has to run the installkernel again after the installworld
 to get all the programs.
 
 In 4-Stable it will still fail.
 
 /Johan K
 
Responsible-Changed-From-To: marcel->ru 
Responsible-Changed-By: marcel 
Responsible-Changed-When: Sat Feb 14 00:16:01 PST 2004 
Responsible-Changed-Why:  
After mentioning this PR to Ruslan, he replied that he has been using 
a similar patch for a while. Re-assign to Ruslan at his invitation. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=20326 
State-Changed-From-To: open->patched 
State-Changed-By: ru 
State-Changed-When: Sun Mar 14 06:59:10 PST 2004 
State-Changed-Why:  
Fixed in 5.2-CURRENT, in src/Makefile.inc1,v 1.416. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20326 
State-Changed-From-To: patched->closed 
State-Changed-By: ru 
State-Changed-When: Tue Mar 16 00:35:28 PST 2004 
State-Changed-Why:  
Fixed in 4.9-STABLE, in src/Makefile.inc1,v 1.141.2.66. 


Responsible-Changed-From-To: ru->freebsd-bugs 
Responsible-Changed-By: ru 
Responsible-Changed-When: Tue Mar 16 00:35:28 PST 2004 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=20326 
>Unformatted:
