Re: buildkernel doesn't respect PORTSDIR with PORTS_MODULES

2022-11-24 Thread Yuri
Juraj Lutter wrote:
> 
> 
>> On 24 Nov 2022, at 15:16, Juraj Lutter  wrote:
>>>
>>> bsd.port.mk and bsd.port.subdir.mk use _PORTSDIR.  You could try adding
>>> that to your list.
>>>
>>
>> PORTS_MODULES are being built from within kern.post.mk. I’d put PORTSDIR 
>> into src-env.conf instead of /etc/src.conf, for that purpose.
> 
> Fingers are quicker than the brain: I’d put PORTSDIR into /etc/src.conf 
> instead of /etc/make.conf for that purpose.

Does it work for you?  I have tried putting it in all of the
/etc/src.conf, /etc/src-env.conf, and /etc/make.conf; still /usr/ports
is being used.

Looks like the expansion does not happen properly (for me, at least) in
kern.post.mk and the following seems to help (with PORTSDIR specified in
one of those 3 conf files or in environment):

diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index d08dfe30d7d..7b208510483 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -133,7 +133,7 @@ PORTSMODULESENV=\
 all:
 .for __i in ${PORTS_MODULES}
@${ECHO} "===> Ports module ${__i} (all)"
-   cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE}
-B clean build
+   cd ${PORTSDIR:U/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B
clean build
 .endfor

 .for __target in install reinstall clean
@@ -141,7 +141,7 @@ ${__target}: ports-${__target}
 ports-${__target}:
 .for __i in ${PORTS_MODULES}
@${ECHO} "===> Ports module ${__i} (${__target})"
-   cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE}
-B ${__target:C/(re)?install/deinstall reinstall/}
+   cd ${PORTSDIR:U/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B
${__target:C/(re)?install/deinstall reinstall/} .endfor
 .endfor
 .endif



Re: buildkernel doesn't respect PORTSDIR with PORTS_MODULES

2022-11-24 Thread Juraj Lutter



> On 24 Nov 2022, at 15:16, Juraj Lutter  wrote:
>> 
>> bsd.port.mk and bsd.port.subdir.mk use _PORTSDIR.  You could try adding
>> that to your list.
>> 
> 
> PORTS_MODULES are being built from within kern.post.mk. I’d put PORTSDIR into 
> src-env.conf instead of /etc/src.conf, for that purpose.

Fingers are quicker than the brain: I’d put PORTSDIR into /etc/src.conf instead 
of /etc/make.conf for that purpose.

otis

—
Juraj Lutter
o...@freebsd.org




Re: buildkernel doesn't respect PORTSDIR with PORTS_MODULES

2022-11-24 Thread Juraj Lutter



> On 24 Nov 2022, at 15:05, Gary Jennejohn  wrote:
> 
> On Thu, 24 Nov 2022 12:02:35 +
> Nuno Teixeira  wrote:
> 
>> Hello,
>> 
>> I'm trying PORT_MODULES with make.conf:
>> ---
>> PORTSDIR=/work/freebsd/ports
>> DISTDIR=/work/DISTFILES
>> PORTS_MODULES=graphics/drm-kmod x11/nvidia-driver
>> 
> 
> bsd.port.mk and bsd.port.subdir.mk use _PORTSDIR.  You could try adding
> that to your list.
> 

PORTS_MODULES are being built from within kern.post.mk. I’d put PORTSDIR into 
src-env.conf instead of /etc/src.conf, for that purpose.

—
Juraj Lutter
o...@freebsd.org




Re: buildkernel doesn't respect PORTSDIR with PORTS_MODULES

2022-11-24 Thread Gary Jennejohn
On Thu, 24 Nov 2022 12:02:35 +
Nuno Teixeira  wrote:

> Hello,
>
> I'm trying PORT_MODULES with make.conf:
> ---
> PORTSDIR=/work/freebsd/ports
> DISTDIR=/work/DISTFILES
> PORTS_MODULES=graphics/drm-kmod x11/nvidia-driver
> ---
> and `make buildkernel` fails:
> ---
> linking kernel.full
> ctfmerge -L VERSION -g -o kernel.full ...
>   text  data   bssdec hex   filename
>   22977071   1848409   4437760   29263240   0x1be8588   kernel.full
> cd: /usr/ports/graphics/drm-kmod: No such file or directory
> ---
>
> Any hint?
> Thanks,
>

bsd.port.mk and bsd.port.subdir.mk use _PORTSDIR.  You could try adding
that to your list.

--
Gary Jennejohn



buildkernel doesn't respect PORTSDIR with PORTS_MODULES

2022-11-24 Thread Nuno Teixeira
Hello,

I'm trying PORT_MODULES with make.conf:
---
PORTSDIR=/work/freebsd/ports
DISTDIR=/work/DISTFILES
PORTS_MODULES=graphics/drm-kmod x11/nvidia-driver
---
and `make buildkernel` fails:
---
linking kernel.full
ctfmerge -L VERSION -g -o kernel.full ...
  text  data   bssdec hex   filename
  22977071   1848409   4437760   29263240   0x1be8588   kernel.full
cd: /usr/ports/graphics/drm-kmod: No such file or directory
---

Any hint?
Thanks,

-- 
Nuno Teixeira
FreeBSD Committer (ports)