From owner-freebsd-stable Wed Aug 2 21:52:58 2000 Delivered-To: freebsd-stable@freebsd.org Received: from evil.2y.net (ztown1-3-26.adsl.one.net [216.23.21.26]) by hub.freebsd.org (Postfix) with ESMTP id 389EA37B565 for ; Wed, 2 Aug 2000 21:52:48 -0700 (PDT) (envelope-from cokane@evil.2y.net) Received: (from cokane@localhost) by evil.2y.net (8.9.3/8.9.3) id BAA07506; Thu, 3 Aug 2000 01:01:00 -0400 (EDT) (envelope-from cokane) Date: Thu, 3 Aug 2000 01:01:00 -0400 From: Coleman Kane To: Tim Zingelman Cc: stable@FreeBSD.ORG, marcel@scc.nl Subject: Re: Makefile.inc1 & kernel names Message-ID: <20000803010100.A7407@cokane.yi.org> References: <3988A2A1.2E1A2B39@urx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from zingelman@fnal.gov on Wed, Aug 02, 2000 at 09:10:12PM -0400 X-Vim: vim:tw=70:ts=4:sw=4 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Don't forget to do something in the unlikely event that KERNEL=old Tim Zingelman had the audacity to say: > [I've cc'd the person who, if I'm seeing correctly, has most recently > changed this part of Makefile.inc1 in -CURRENT. Since this keeps > coming up here, and we need -CURRENT to DTRT so we can then get a > MFC to make us happy here in -STABLE] > > > > > [ mv /kernel /kernel.old && mv /YOUR_KERNEL_HERE /kernel ] > > > > > Actually, make installkernel was fixed so that you don't need to do > > > > > this. [ONLY fixed in -CURRENT NOT in -STABLE] > > > > makeoptions KERNEL=kernel #Build kernel "foo" and install "/foo" > > > to your kernel config file it will install it as /kernel without this > > > change; and back up your old one as /kernel.old. I would expect this > > > I have to make a point here and that is I like the current > > arrangement. I would much rather have installkernel make a file called > > MYKERNEL than have it make all kernel's as "kernel".... > > Historically the generic kernel has been named /kernel.GENERIC, not > /GENERIC. If you add 'makeoptions KERNEL=kernel.GENERIC' to the > GENERIC config file, and 'makeoptions KERNEL=kernel' to your custom > kernel config file, you get "close" to an answer... > > IMHO the 'right thing' to do is something like this: > > Allow KERNEL to specify a list of config files (so one can define > KERNEL="MYCUSTOM GENERIC" for instance). > > Have the 'make buildkernel' target build the first one in the list with > KERNEL=kernel, and all the others with KERNEL=kernel.NAME. (in my above > example, MYCUSTOM would get built as kernel and GENERIC would get built > as kernel.GENERIC. > > Have the 'make installkernel' target install the first one in the KERNEL > list with KERNEL=kernel, and all the others with KERNEL=kernel.NAME. > (again my example would install MYCUSTOM in /kernel and GENERIC in > /kernel.GENERIC. > > It would be nice if in this whole process the modules only got built once, > and the pre-existing /kernel got preserved as /kernel.old. Though I think > that all works ok already. > > Here is a patch against Makefile.inc1 from -STABLE, but IT DOES NOT WORK!! > Can someone explain to me what I'm doing wrong? make says: > > "/usr/src/Makefile.inc1", line 1: Malformed conditional (CUSTOM == ${INSTALLKERNEL}) > > That's a 'make buildkernel' with 'KERNEL=CUSTOM GENERIC' in /etc/make.conf > > Thanks, > > - Tim > > Index: Makefile.inc1 > =================================================================== > RCS file: /usr/cvs/src/Makefile.inc1,v > retrieving revision 1.141.2.4 > diff -c -r1.141.2.4 Makefile.inc1 > *** Makefile.inc1 2000/06/17 03:43:06 1.141.2.4 > --- Makefile.inc1 2000/08/03 01:00:06 > *************** > *** 330,337 **** > # Which kernels to build and/or install is specified by setting > # KERNEL. 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. > # > # Note that we have to use MACHINE instead of MACHINE_ARCH when > # we're in kernel-land. Since only MACHINE_ARCH is (expected) to > --- 330,339 ---- > # Which kernels to build and/or install is specified by setting > # KERNEL. If not defined a GENERIC kernel is built/installed. > # Only the existing (depending MACHINE) config files are used > ! # for building kernels. The first is installed as /kernel, the > ! # remaining are installed as /kernel.NAME. So setting > ! # KERNEL= CUSTOM GENERIC will result in your CUSTOM kernel installed > ! # as /kernel and GENERIC installed as /kernel.GENERIC > # > # Note that we have to use MACHINE instead of MACHINE_ARCH when > # we're in kernel-land. Since only MACHINE_ARCH is (expected) to > *************** > *** 361,367 **** > .if exists(${KRNLCONFDIR}/${_kernel}) > BUILDKERNELS+= ${_kernel} > .if empty(INSTALLKERNEL) > ! INSTALLKERNEL= ${_kernel} > .endif > .endif > .endfor > --- 363,369 ---- > .if exists(${KRNLCONFDIR}/${_kernel}) > BUILDKERNELS+= ${_kernel} > .if empty(INSTALLKERNEL) > ! INSTALLKERNEL= ${_kernel} > .endif > .endif > .endfor > *************** > *** 377,383 **** > @echo ">>> Rebuilding kernel(s)" > @echo "--------------------------------------------------------------" > .for _kernel in ${BUILDKERNELS} > ! @echo "===> ${_kernel}" > mkdir -p ${KRNLOBJDIR} > cd ${KRNLCONFDIR}; \ > PATH=${TMPPATH} \ > --- 379,390 ---- > @echo ">>> Rebuilding kernel(s)" > @echo "--------------------------------------------------------------" > .for _kernel in ${BUILDKERNELS} > ! .if ${_kernel} == ${INSTALLKERNEL} > ! KERNELNAME= kernel > ! .else > ! KERNELNAME= kernel.${_kernel} > ! .endif > ! @echo "===> ${KERNELNAME}" > mkdir -p ${KRNLOBJDIR} > cd ${KRNLCONFDIR}; \ > PATH=${TMPPATH} \ > *************** > *** 385,405 **** > cd ${KRNLOBJDIR}/${_kernel}; \ > MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \ > ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile; \ > ! ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \ > ${MAKE} depend; \ > ! ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} ${MAKE} all > .endfor > > # > # installkernel > # > ! # Install the kernel defined by INSTALLKERNEL > # > installkernel: > cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ > ! ${IMAKEENV} MACHINE=${MACHINE} KERNEL=${INSTALLKERNEL} \ > ${MAKE} install > ! > # > # update > # > --- 392,420 ---- > cd ${KRNLOBJDIR}/${_kernel}; \ > MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \ > ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile; \ > ! ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${KERNELNAME} \ > ${MAKE} depend; \ > ! ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${KERNELNAME} ${MAKE} all > .endfor > > # > # installkernel > # > ! # Install the kernel defined by INSTALLKERNEL as /kernel, > ! # Install all others as kernel.NAME > # > installkernel: > + .for _kernel in ${BUILDKERNELS} > + .if ${_kernel} == ${INSTALLKERNEL} > + KERNELNAME= kernel > + .else > + KERNELNAME= kernel.${_kernel} > + .endif > + @echo "===> ${KERNELNAME}" > cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ > ! ${IMAKEENV} MACHINE=${MACHINE} KERNEL=${KERNELNAME} \ > ${MAKE} install > ! .endfor > # > # update > # > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message > -- Coleman Kane President, UC Free O.S. Users Group - http://pohl.ececs.uc.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message