make buildkernel does not respect KERNCONF or JOBS in /etc/make.conf
Herbert J. Skuhra
herbert at mailbox.org
Wed Dec 14 09:31:35 UTC 2016
Ian Lepore skrev:
>
> 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}
Yeah, this could work:
Before:
===> Ports module x11/nvidia-driver (all)
cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CPP PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin SRC_BASE=/usr/src OSVERSION=1100506 WRKDIRPREFIX=/usr/obj/usr/src/sys/WS01 GENERIC make -B clean all
After:
===> Ports module x11/nvidia-driver (all)
cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CPP PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin SRC_BASE=/usr/src OSVERSION=1100506 WRKDIRPREFIX=/usr/obj/usr/src/sys/WS01 make -B clean all
--
Herbert
More information about the freebsd-stable
mailing list