Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Aug 2019 11:47:51 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Kyle Evans <kevans@freebsd.org>
Cc:        John Baldwin <jhb@freebsd.org>, Gary Jennejohn <gljennjohn@gmail.com>, current <current@freebsd.org>
Subject:   Re: problem with LOCAL_MODULES
Message-ID:  <CANCZdfrCiMi7DLK825HrH84A-4TVevTWWCkYaSn2NBmVd1ndpA@mail.gmail.com>
In-Reply-To: <CACNAnaGhfs8ynJJ9t5y0JSwCcP%2BB7nEeoH9L2tbGvjw=YE6yYg@mail.gmail.com>
References:  <20190816120524.21b7fd19@ernst.home> <e1010b9b-26a6-9ce6-873c-10e503dc2030@FreeBSD.org> <CACNAnaGhfs8ynJJ9t5y0JSwCcP%2BB7nEeoH9L2tbGvjw=YE6yYg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 30, 2019 at 11:42 AM Kyle Evans <kevans@freebsd.org> wrote:

> On Fri, Aug 16, 2019 at 7:38 PM John Baldwin <jhb@freebsd.org> wrote:
> >
> > On 8/16/19 3:05 AM, Gary Jennejohn wrote:
> > > I tried to build a kernel today and it failed in modules-all even
> > > though I had LOCAL_MODULES="" in /etc/src.conf, as recommended by
> > > jhb.
> > >
> > > That's wrong.  It has to be LOCAL_MODULES=, otherwise
> > > /sys/conf/kern.post.mk seems to conclude that there should be a
> > > module under /usr/local/sys/modules with the name "".
> >
> > I think this will permit both versions to work:
> >
> > Index: sys/conf/kern.post.mk
> > ===================================================================
> > --- kern.post.mk        (revision 351151)
> > +++ kern.post.mk        (working copy)
> > @@ -76,6 +76,7 @@ modules-${target}:
> >         cd $S/modules; ${MKMODULESENV} ${MAKE} \
> >             ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
> >  .endif
> > +.if !empty(LOCAL_MODULES)
> >  .for module in ${LOCAL_MODULES}
> >         @${ECHODIR} "===> ${module}
> (${target:S/^reinstall$/install/:S/^clobber$/cleandir/})"
> >         @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \
> > @@ -83,6 +84,7 @@ modules-${target}:
> >             ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
> >  .endfor
> >  .endif
> > +.endif
> >  .endfor
> >
> >  # Handle ports (as defined by the user) that build kernel modules
> >
>
> I think I'd like to see this with !empty(LOCAL_MODULES) &&
> EXISTS(${LOCAL_MODULES_DIR}) or maybe just the latter condition to
> prevent accidental foot-shooting... I was testing a problem with doing
> this stuff in a poudriere build for swills@ and set LOCAL_MODULES=""
> only to get an error because LOCAL_MODULES_DIR doesn't yet exist on
> the machine I was testing with -- which we can trivially avoid.
>

There's also an unfortunate interaction with MODULES_OVERRIDE="" in that
the local modules are built / installed. This breaks the workflow I've used
in the past of 'make reinstallkernel MODULES_OVERRIDE=""' to get just the
kernel reinstalled w/o messing with the modules that I know are fine and
don't want to change. Not a huge deal, but still annoying.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrCiMi7DLK825HrH84A-4TVevTWWCkYaSn2NBmVd1ndpA>