Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Mar 2000 23:55:06 +0100 (CET)
From:      k@numeri.campus.luth.se
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/17536: KERNEL used both by Makefile.inc1 and Makefile.${MACHINE}
Message-ID:  <200003212255.XAA15924@numeri.campus.luth.se>

next in thread | raw e-mail | index | archive | help

>Number:         17536
>Category:       kern
>Synopsis:       KERNEL used both by Makefile.inc1 and Makefile.${MACHINE}
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 21 15:00:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Johan Karlsson
>Release:        FreeBSD 4.0-RELEASE i386
>Organization:
>Environment:

k@numeri /usr/src >ident Makefile.inc1
Makefile.inc1:
     $FreeBSD: src/Makefile.inc1,v 1.141 2000/03/09 06:28:19 kris Exp $


>Description:

	The variable KERNEL is used both by ${SRC}/Makefile.inc1 and
	${SRC}/sys/conf/Makefile.*

	When using the buildkernel/installkernel targets this 
	is a problem.

	By specifying two or more existing kernel config files to 
	these targets using the KERNEL variable (as suggested in 
	the makefile) the buildkernel target will link two (or more) 
	identical kernels with the given names.
 	The installkernel target will fail since 'install' do not know 
	how to handle this case.

	I propose to use KERNELS in Makefile.inc1 instead,
	see patch below.


	Also, since each config file generates a kernel with the 
	same name and the installed kernel get install under this 
	name, I suggest that all built kernels get install. 
	This way it will be easier to test them.
	For exampel I would like to get both GENERIC and my 
	custom kernel installed.
	However this is out of the scoop of this PR :-)

>How-To-Repeat:
	
	cd /usr/src; make KERNEL='GENERIC NEWCARD' buildkernel
	cd /usr/src; make KERNEL='GENERIC NEWCARD' installkernel
	
	on a x86 machine.
>Fix:

--- Makefile.inc1.orig	Thu Mar  9 07:28:19 2000
+++ Makefile.inc1	Tue Mar 21 22:54:33 2000
@@ -328,7 +328,7 @@
 # buildkernel and installkernel
 #
 # Which kernels to build and/or install is specified by setting
-# KERNEL. If not defined a GENERIC kernel is built/installed.
+# KERNELS. If not defined a GENERIC kernel is built/installed.
 # Only the existing (depending MACHINE) config files are used
 # for building kernels and only the first of these is designated
 # as the one being installed.
@@ -338,7 +338,7 @@
 # be set to cross-build, we have to make sure MACHINE is set
 # properly.
 
-KERNEL?=	GENERIC GENERIC98
+KERNELS?=	GENERIC GENERIC98
 
 # The only exotic MACHINE_ARCH/MACHINE combination valid at this
 # time is i386/pc98. In all other cases set MACHINE equal to
@@ -357,7 +357,7 @@
 
 BUILDKERNELS=
 INSTALLKERNEL=
-.for _kernel in ${KERNEL}
+.for _kernel in ${KERNELS}
 .if exists(${KRNLCONFDIR}/${_kernel})
 BUILDKERNELS+=	${_kernel}
 .if empty(INSTALLKERNEL)
@@ -384,8 +384,10 @@
 	cd ${KRNLOBJDIR}/${_kernel}; \
 		MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \
 		    ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile; \
-		${WMAKEENV} MACHINE=${MACHINE} ${MAKE} depend; \
-		${WMAKEENV} MACHINE=${MACHINE} ${MAKE} all
+		${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
+		    ${MAKE} depend; \
+		${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
+		    ${MAKE} all
 .endfor
 
 #
@@ -395,7 +397,8 @@
 #
 installkernel:
 	cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
-		${IMAKEENV} MACHINE=${MACHINE} ${MAKE} install
+		${IMAKEENV} MACHINE=${MACHINE} KERNEL=${INSTALLKERNEL} \
+		    ${MAKE} install
 
 #
 # update
	

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003212255.XAA15924>