Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2016 20:22:41 -0800
From:      Kevin Oberman <rkoberman@gmail.com>
To:        "Herbert J. Skuhra" <herbert@mailbox.org>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: make buildkernel does not respect KERNCONF or JOBS in /etc/make.conf
Message-ID:  <CAN6yY1vT3jd8t1-ywk1aCTRrarssEsxe7vdHRtpuj=jkS4UmPQ@mail.gmail.com>
In-Reply-To: <86pokwptmd.wl-herbert@mailbox.org>
References:  <201612120138.uBC1cA59025994@sdf.org> <86r35dd46x.wl-herbert@mailbox.org> <9B.7B.16304.3F86E485@dnvrco-omsmta02> <15672f53-1a34-3120-0aa8-03aa6401be54@zyxst.net> <CAN6yY1sQOtkONb0fdSr_1p2LpV=UsqqvnzxO_GnRO%2BdueC4DOg@mail.gmail.com> <86pokwptmd.wl-herbert@mailbox.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 12, 2016 at 4:20 PM, Herbert J. Skuhra <herbert@mailbox.org>
wrote:

> Kevin Oberman skrev:
> >
> > Clearly the documentation is a bit behind the times. For some time people
> > have used KERNCONF to build multiple kernels, but that was a lucky things
> > that was not officially supported. It just happened to work. Then, with
> > 11.0, it no longer did in many cases sue to changes in the kernel build
> > system. When people complained, there did not seem to be a way to fix
> this
> > without blocking future goals in speeding up and enhancinghte standard
> > kernel build.
> >
> > The result was BUILDKERNELS. It was specifically designed to allow the
> > building of multiple kernels and the appropriate modules. This would
> always
> > take longer and use more disk space, but it would work reliably. Now, bit
> > building a single, local kernel, KERNCONF is the best way, though I
> suspect
> > that it make only a small difference until new capabilities are added
> later
> > in the life of 11.
> >
> > So, while it seems the man pages need to catch up, building multiple
> > kernels should be done with KERNCONF in either make.conf or src.conf and
> > multiple kernels with BUILDKERNELS.
> >
> > This is from my recollection of the discussion thread. I'll admit to
> being
> > too lazy to go find and read all of it. I suspect it was on current@,
> but
> > I'm not even sure of that.
>
> ???
>
> From /usr/src/Makefile.inc1:
>
>    1137 .if ${TARGET_ARCH} == "powerpc64"
>    1138 KERNCONF?=      GENERIC64
>    1139 .else
>    1140 KERNCONF?=      GENERIC
>    1141 .endif
>    [...]
>    1149 BUILDKERNELS=
>    1150 INSTALLKERNEL=
>    1151 .if defined(NO_INSTALLKERNEL)
>    1152 # All of the BUILDKERNELS loops start at index 1.
>    1153 BUILDKERNELS+= dummy
>    1154 .endif
>    1155 .for _kernel in ${KERNCONF}
>    1156 .if exists(${KERNCONFDIR}/${_kernel})
>    1157 BUILDKERNELS+=  ${_kernel}
>    1158 .if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL)
>    1159 INSTALLKERNEL= ${_kernel}
>    1160 .endif
>    1161 .endif
>    1162 .endfor
>
> So setting BUILDKERNELS has no effect.
>
> --
> Herbert
>

I think you miss the significance. BUILDKERNELS only is used to build the
kernels. It is not used by installkernel as installing two kernels does not
make sense. It is ONLY used to build multiple kernels. KERNCONF is still
used to specify the kernel, with attendant modules, to be installed.

I should also mention that, if you want to install a new kernel without
overwriting the old kernel and modules (/boot/kernel.old/), "make
reinstallkernel". It replaces the existing kernel instead of renaming the
kernel directory to kernel.old. I find this very handy, but it is poorly
documented. So, if you want to install GENERIC and not lose your last
working kernel, "make reinstallkernel KERNCONF=GENERIC". That will blow
away the bad kernel and modules and install GENERIC. Note that it does not
touch the /usr/obj directory that PUMPKIN is built in, so PUMPKIN and
similarly be reinstalled.

The man page for src.conf is automatically generated and only lists those
values which are specific to src.conf (WITH_ and WITHOUT_) and describes
its use. It is used as input for system builds and installs but should not
be accessed for any other purpose. make.conf is always read by make with no
regard to what is being made. (N.B. I believe that some people have ignored
this in some ports stuff.) Anything that is put into make.conf may be
placed in src,conf if you only want to have it used when
building/installing the kernel and world.

I'm probably forgetting something, but I hope this explains it a bit.
--
Kevin Oberman, Retired Network Engineer and kid herder



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN6yY1vT3jd8t1-ywk1aCTRrarssEsxe7vdHRtpuj=jkS4UmPQ>