problem with LOCAL_MODULES

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with LOCAL_MODULES

Gary Jennejohn-6
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 "".

--
Gary Jennejohnl
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: problem with LOCAL_MODULES

John Baldwin
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


--
John Baldwin
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: problem with LOCAL_MODULES

Gary Jennejohn-6
On Fri, 16 Aug 2019 17:37:56 -0700
John Baldwin <[hidden email]> 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
>

Nope, the same error as before with the patch applied and
LOCAL_MODULES="" .

--
Gary Jennejohn
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: problem with LOCAL_MODULES

Kyle Evans-3
In reply to this post by John Baldwin
On Fri, Aug 16, 2019 at 7:38 PM John Baldwin <[hidden email]> 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.

Thanks,

Kyle Evans
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: problem with LOCAL_MODULES

Warner Losh
On Fri, Aug 30, 2019 at 11:42 AM Kyle Evans <[hidden email]> wrote:

> On Fri, Aug 16, 2019 at 7:38 PM John Baldwin <[hidden email]> 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
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: problem with LOCAL_MODULES

John Baldwin
In reply to this post by Kyle Evans-3
On 8/30/19 10:42 AM, Kyle Evans wrote:

> On Fri, Aug 16, 2019 at 7:38 PM John Baldwin <[hidden email]> 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.

Did this work for you?  Gary said in a followup that it didn't work,
so that's why I hadn't committed it.

--
John Baldwin
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: problem with LOCAL_MODULES

Kyle Evans-3
On Fri, Aug 30, 2019 at 2:11 PM John Baldwin <[hidden email]> wrote:

>
> On 8/30/19 10:42 AM, Kyle Evans wrote:
> > On Fri, Aug 16, 2019 at 7:38 PM John Baldwin <[hidden email]> 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.
>
> Did this work for you?  Gary said in a followup that it didn't work,
> so that's why I hadn't committed it.
>

Hmm... I went back and tested his exact scenario, and no-
LOCAL_MODULES isn't empty at this point because word processing that
leaves us with an empty string hasn't yet been done. An .if
!empty(module) inside the loop is much happier- I'm not seeing any
modifiers that would give us the behavior we wanted for figuring this
out before entering the loop.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: problem with LOCAL_MODULES

Kyle Evans-3
On Fri, Aug 30, 2019 at 2:26 PM Kyle Evans <[hidden email]> wrote:

>
> On Fri, Aug 30, 2019 at 2:11 PM John Baldwin <[hidden email]> wrote:
> >
> > On 8/30/19 10:42 AM, Kyle Evans wrote:
> > > On Fri, Aug 16, 2019 at 7:38 PM John Baldwin <[hidden email]> 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.
> >
> > Did this work for you?  Gary said in a followup that it didn't work,
> > so that's why I hadn't committed it.
> >
>
> Hmm... I went back and tested his exact scenario, and no-
> LOCAL_MODULES isn't empty at this point because word processing that
> leaves us with an empty string hasn't yet been done. An .if
> !empty(module) inside the loop is much happier- I'm not seeing any
> modifiers that would give us the behavior we wanted for figuring this
> out before entering the loop.

It turns out I'm silly... this is sufficient for both of our problems
(because it's the same problem) and hopefully my mail client doesn't
goof this up:

diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index ff10daf1a0a..09bfffad095 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -77,10 +77,12 @@ modules-${target}:
            ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
 .endif
 .for module in ${LOCAL_MODULES}
+.if !empty(module)
        @${ECHODIR} "===> ${module}
(${target:S/^reinstall$/install/:S/^clobber$/cleandir/})"
        @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \
            DIRPRFX="${module}/" \
            ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
+.endif
 .endfor
 .endif
 .endfor
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: problem with LOCAL_MODULES

Gary Jennejohn-6
On Fri, 30 Aug 2019 14:33:06 -0500
Kyle Evans <[hidden email]> wrote:

> On Fri, Aug 30, 2019 at 2:26 PM Kyle Evans <[hidden email]> wrote:
> >
> > On Fri, Aug 30, 2019 at 2:11 PM John Baldwin <[hidden email]> wrote:  
> > >
> > > On 8/30/19 10:42 AM, Kyle Evans wrote:  
> > > > On Fri, Aug 16, 2019 at 7:38 PM John Baldwin <[hidden email]> 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.  
> > >
> > > Did this work for you?  Gary said in a followup that it didn't work,
> > > so that's why I hadn't committed it.
> > >  
> >
> > Hmm... I went back and tested his exact scenario, and no-
> > LOCAL_MODULES isn't empty at this point because word processing that
> > leaves us with an empty string hasn't yet been done. An .if
> > !empty(module) inside the loop is much happier- I'm not seeing any
> > modifiers that would give us the behavior we wanted for figuring this
> > out before entering the loop.  
>
> It turns out I'm silly... this is sufficient for both of our problems
> (because it's the same problem) and hopefully my mail client doesn't
> goof this up:
>
> diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
> index ff10daf1a0a..09bfffad095 100644
> --- a/sys/conf/kern.post.mk
> +++ b/sys/conf/kern.post.mk
> @@ -77,10 +77,12 @@ modules-${target}:
>             ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
>  .endif
>  .for module in ${LOCAL_MODULES}
> +.if !empty(module)
>         @${ECHODIR} "===> ${module}
> (${target:S/^reinstall$/install/:S/^clobber$/cleandir/})"
>         @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \
>             DIRPRFX="${module}/" \
>             ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
> +.endif
>  .endfor
>  .endif
>  .endfor

Yes, this patch works correctly.

--
Gary Jennejohn
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"