Date: Wed, 02 Aug 2000 20:08:44 -0500 (CDT) From: Tim Zingelman <zingelman@fnal.gov> To: stable@FreeBSD.ORG Cc: marcel@scc.nl Subject: Makefile.inc1 & kernel names Message-ID: <Pine.GSO.4.21.0008021803530.16961-100000@nova.fnal.gov> In-Reply-To: <3988A2A1.2E1A2B39@urx.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.21.0008021803530.16961-100000>
