make buildkernel does not respect KERNCONF or JOBS in /etc/make.conf

Ian Lepore ian at freebsd.org
Tue Dec 13 17:16:52 UTC 2016


On Tue, 2016-12-13 at 10:13 -0700, Ian Lepore wrote:
> On Tue, 2016-12-13 at 10:00 +0000, tech-lists wrote:
> > 
> > On 12/12/2016 23:40, Herbert J. Skuhra wrote:
> > > 
> > > 
> > > PORTS_MODULES does not work if KERNCONF contains multiple
> > > kernels:
> > > 
> > > The problem is obviously in /usr/src/sys/conf/kern.post.mk (line
> > > 66):
> > > 
> > > WRKDIRPREFIX?=  ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF}
> > hmm! I didn't know that.
> > 
> > I can't confirm exactly when the old way stopped working and when
> > I 
> > started defining modules in src.conf.
> > 
> > If I wanted to install a known, good kernel as /boot/workingkernel
> > with 
> > all of its modules, so that I can avoid kernel.old being a bad
> > kernel 
> > and kernel being non-bootable, how would I go about doing it?
> > 
> > many thanks,
> > 
> I think the problem might have started with some changes to the
> kernel
> build infrastructure that result in reading make.conf and/or src.conf
> when they didn't used to, so now KERNCONF with multiple entries is
> defined differently in kern.post.mk than it used to be.
> 
> I wonder if this patch might fix it (I'm not in a position to test it
> myself right now -- this is purely a shot in the dark)...
> 
> iIndex: sys/conf/kern.post.mk
> ===================================================================
> --- sys/conf/kern.post.mk	(revision 302505)
> +++ sys/conf/kern.post.mk	(working copy)
> @@ -63,7 +63,7 @@ OSRELDATE!=	awk
> '/^\#define[[:space:]]*__FreeBSD_v
>  		    ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate
> .h
>  .endif
>  # Keep the related ports builds in the obj directory so that they
> are only rebuilt once per kernel build
> -WRKDIRPREFIX?=	${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF}
> +WRKDIRPREFIX?=	${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${.OBJDIR}
>  PORTSMODULESENV=\
>  	PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \
>  	SRC_BASE=${SRC_BASE} \
> 
> -- Ian

Actually, now that I look at it again, I wonder if it should be just:

+WRKDIRPREFIX?=	${.OBJDIR}

-- Ian



More information about the freebsd-stable mailing list