Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2017 01:25:08 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Johannes M Dieterich <jmd@freebsd.org>
Cc:        svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, Jung-uk Kim <jkim@freebsd.org>, ports-committers@freebsd.org
Subject:   Re: svn commit: r448928 - in head/graphics: . drm-next-kmod
Message-ID:  <r2vu-rm7f-wny@FreeBSD.org>
In-Reply-To: <fuca-t1hp-wny@FreeBSD.org> (Jan Beich's message of "Wed, 30 Aug 2017 01:09:38 %2B0200")
References:  <20170829205351.Horde.cJ-BkOZLFgXWSRXmqFSiczx@www.poelloepaeae.de> <4lsq-vvzq-wny@FreeBSD.org> <fuca-t1hp-wny@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Jan Beich <jbeich@FreeBSD.org> writes:

> Jan Beich <jbeich@FreeBSD.org> writes:
>
>> Johannes M Dieterich <jmd@freebsd.org> writes:
>>
>>> Jung-uk Kim =E2=80=93 Tue., 29. August 2017 16:46
>>>> On 08/29/2017 13:13, Jan Beich wrote:
>>>> > Johannes M Dieterich <jmd@FreeBSD.org> writes:
>>>> >=20
>>>> >> Author: jmd
>>>> >> Date: Tue Aug 29 16:32:19 2017
>>>> >> New Revision: 448928
>>>> >> URL: svnweb.freebsd.org/changeset/ports/448928
>>>> >>
>>>> >> Log:
>>>> >>   New port: graphics/drm-next-kmod.
>>>> > [...]
>>>> >> +USES=3D		kmod uidfix
>>>> >=20
>>>> > Fails to build if SRC_BASE !=3D /usr/src. With SRCTOP undefined the =
port
>>>> > relies on /sys symlink existing and pointing to a real location. The
>>>> > latter conflicts with $SRC_BASE/etc/Makefile hardcoding "usr/src/sys=
".
>>>> >=20
>>>> > Maybe add MAKE_ENV =3D SRCTOP=3D"${SRC_BASE}" to fix the following.
>>>> >=20
>>>> > $ make DISABLE_MAKE_JOBS=3D
>>>> > =3D=3D=3D>  Building for drm-next-kmod-g20170825
>>>> > =3D=3D=3D> drm (all)
>>>> > Warning: Object directory not changed from original
>>>> > /usr/ports/graphics/drm-next-kmod/work/kms-drm-4ee5acb/drm
>>>> > =3D=3D=3D> amd (all)
>>>> > make[3]:
>>>> > "/usr/ports/graphics/drm-next-kmod/work/kms-drm-4ee5acb/amd/Makefile"
>>>> > line 3: Cannot open /sys/conf/kern.opts.mk
>>>> > make[3]: Fatal errors encountered -- cannot continue
>>>> > make[3]: stopped in /usr/ports/graphics/drm-next-kmod/work/kms-drm-4=
ee5acb/amd
>>>> > *** Error code 1
>>>
>>> ... my understanding is that for kmods we require /usr/src?
>>
>> Custom base system source location when building kernel modules has been
>> supported for a long time, probably as long as non-root builds. Before
>> SRC_BASE existed such ports usually relied on SYSDIR directly which
>> is defined by bsd.kmod.mk.
>>
>>> I checked with kwm and he pointed out that people not
>>> running /non-usr/src systems should set SRC_BASE properly in their
>>> Mk/Uses/kmod.mk (I haven't tested this).
>>
>> I have both SRC_BASE and SYSDIR defined via environment. No issues with
>> other -kmod ports for >5 years.
>>
>> Did you miss that this port doesn't respect SRC_BASE at all?
>
> Why not get rid of SRC_BASE unnecessary abstraction in the vendor source?
> kern.opts.mk is already included by <bsd.kmod.mk>, so doing so manually
> and from the top-level Makefile is of dubious benefit.
>
> $ fgrep -r SRC_BASE /usr/share/mk
> Exit 1

Apologies, my previous version missed one more instance of kern.opts.mk
which broke out-of-ports-tree build.

=2D-- Makefile.orig	2017-08-23 00:35:05 UTC
+++ Makefile
@@ -1,9 +1,5 @@
 # $FreeBSD$
=20
=2DSYSDIR?=3D${SRC_BASE}/sys
=2D
=2D.include "${SYSDIR}/conf/kern.opts.mk"
=2D
 SUBDIR=3D	drm		\
 	amd		\
 	i915		\
@@ -19,7 +15,10 @@ SUBDIR=3D	drm		\
 # WARNING: THIS WILL CHANGE THE SOURCE TREE!  ONLY USE IF THERE ARE NO OTH=
ER
 #          CHANGES THAT NEED TO BE RECOVERED!
 #
+.if make(drm2-debug-source-changes)
+SYSDIR?=3D	/usr/src/sys
 DRM_DEBUG_EXCLUDES=3D	drm_mipi_dsi|drm_panel|linux_hdmi|ttm/ttm_object
+.endif
 drm2-debug-source-changes:
 	find ${SYSDIR}/dev/drm -name '*.[ch]' | \
 		egrep -v '(${DRM_DEBUG_EXCLUDES}).c' | \
=2D-- amd/Makefile.orig	2017-08-29 23:23:06 UTC
+++ amd/Makefile
@@ -1,7 +1,5 @@
 # $FreeBSD$
=20
=2D.include "${SYSDIR}/conf/kern.opts.mk"
=2D
 .if ${MACHINE_CPUARCH} =3D=3D "amd64"
 _amdgpu=3D	amdgpu
 _amdkfd=3D	amdkfd
=2D-- amd/amdgpu/Makefile.orig	2017-08-23 00:35:05 UTC
+++ amd/amdgpu/Makefile
@@ -135,7 +135,7 @@ SRCS=3D	amdgpu_acpi.c \
=20
 CFLAGS+=3D -I${.CURDIR:H:H}/linuxkpi/dummy/include
 CFLAGS+=3D -I${.CURDIR:H:H}/linuxkpi/gplv2/include
=2DCFLAGS+=3D -I${SRC_BASE}/sys/compat/linuxkpi/common/include
+CFLAGS+=3D -I${SYSDIR}/compat/linuxkpi/common/include
=20
 CFLAGS+=3D -I${.CURDIR:H:H}/include
 CFLAGS+=3D -I${.CURDIR:H:H}/include/drm
=2D-- amd/amdkfd/Makefile.orig	2017-08-23 00:35:05 UTC
+++ amd/amdkfd/Makefile
@@ -1,6 +1,6 @@
 # $FreeBSD$
=20
=2D#.PATH:	${SRCTOP}/sys/dev/drm/amd/amdkfd
+#.PATH:	${SYSDIR}/dev/drm/amd/amdkfd
=20
 KMOD	=3D amdkfd
=20
@@ -36,7 +36,7 @@ SRCS	=3D \
=20
 CFLAGS+=3D -I${.CURDIR:H:H}/linuxkpi/dummy/include
 CFLAGS+=3D -I${.CURDIR:H:H}/linuxkpi/gplv2/include
=2DCFLAGS+=3D -I${SRC_BASE}/sys/compat/linuxkpi/common/include
+CFLAGS+=3D -I${SYSDIR}/compat/linuxkpi/common/include
=20
 CFLAGS+=3D -I${.CURDIR:H:H}/include
 CFLAGS+=3D -I${.CURDIR:H:H}/include/drm
=2D-- drm/Makefile.orig	2017-08-23 00:35:05 UTC
+++ drm/Makefile
@@ -83,7 +83,7 @@ SRCS=3D	ati_pcigart.c \
=20
 CFLAGS+=3D -I${.CURDIR:H}/linuxkpi/dummy/include
 CFLAGS+=3D -I${.CURDIR:H}/linuxkpi/gplv2/include
=2DCFLAGS+=3D -I${SRC_BASE}/sys/compat/linuxkpi/common/include
+CFLAGS+=3D -I${SYSDIR}/compat/linuxkpi/common/include
 CFLAGS+=3D -I${.CURDIR}
 CFLAGS+=3D -I${.CURDIR}/ttm
 CFLAGS+=3D -I${.CURDIR:H}/include
=2D-- i915/Makefile.orig	2017-08-23 00:35:05 UTC
+++ i915/Makefile
@@ -93,7 +93,7 @@ CLEANFILES+=3D ${KMOD}.ko.full ${KMOD}.ko.debug
=20
 CFLAGS+=3D -I${.CURDIR:H}/linuxkpi/dummy/include
 CFLAGS+=3D -I${.CURDIR:H}/linuxkpi/gplv2/include
=2DCFLAGS+=3D -I${SRC_BASE}/sys/compat/linuxkpi/common/include
+CFLAGS+=3D -I${SYSDIR}/compat/linuxkpi/common/include
=20
 CFLAGS+=3D -I${.CURDIR:H}/include
 CFLAGS+=3D -I${.CURDIR:H}/include/drm
=2D-- lindebugfs/Makefile.orig	2017-08-23 00:35:05 UTC
+++ lindebugfs/Makefile
@@ -9,6 +9,6 @@ SRCS=3D	vnode_if.h \
=20
 CFLAGS+=3D -I${.CURDIR}/../linuxkpi/dummy/include
 CFLAGS+=3D -I${.CURDIR}/../linuxkpi/gplv2/include
=2DCFLAGS+=3D -I${SRCTOP}/sys/compat/linuxkpi/common/include
+CFLAGS+=3D -I${SYSDIR}/compat/linuxkpi/common/include
=20
 .include <bsd.kmod.mk>
=2D-- linuxkpi/Makefile.orig	2017-08-23 00:35:05 UTC
+++ linuxkpi/Makefile
@@ -37,7 +37,7 @@ CFLAGS+=3D -include ${.CURDIR}/../drm/drm_os_config.h
 CFLAGS+=3D -I${.CURDIR}/../include
 CFLAGS+=3D -I${.CURDIR}/dummy/include
 CFLAGS+=3D -I${.CURDIR}/gplv2/include
=2DCFLAGS+=3D -I${SRCTOP}/sys/compat/linuxkpi/common/include
+CFLAGS+=3D -I${SYSDIR}/compat/linuxkpi/common/include
 CFLAGS+=3D '-DKBUILD_MODNAME=3D"${KMOD}"'
=20
 .include <bsd.kmod.mk>
=2D-- radeon/Makefile.orig	2017-08-23 00:35:05 UTC
+++ radeon/Makefile
@@ -113,7 +113,7 @@ SRCS=3D	atom.c \
=20
 CFLAGS+=3D -I${.CURDIR:H}/linuxkpi/dummy/include
 CFLAGS+=3D -I${.CURDIR:H}/linuxkpi/gplv2/include
=2DCFLAGS+=3D -I${SRC_BASE}/sys/compat/linuxkpi/common/include
+CFLAGS+=3D -I${SYSDIR}/compat/linuxkpi/common/include
=20
 CFLAGS+=3D -I${.CURDIR:H}/include
 CFLAGS+=3D -I${.CURDIR:H}/include/drm

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQF8BAEBCgBmBQJZpffUXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF
NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bBMMH/RhD4s8sBBfFkr0n93Q1lbEj
b2qGTLlnMMokyqatt9xUZ3GA8//LetGv3vq15Qx1i+QIe1FDc8eOhqAiUhLN+V7f
MSQKmEpSI18rqvpHfl7HrXKBKXx7a08uMrd88DP23eRtsoAwnv2X26SRxSKJGbkJ
S4okbymwhqnXtjFV5mNnQnNkIoVvfYgf4mpKeA9U1ktNwCJuXFBd6HY3DVdbwFre
GAPHdoZtcsXwLlilxrCDYZqTCSyk149FnkdFECuAENaCLToq/C3N5DMRwdrspy0T
n/KGw8mh3Nv6Yki/8cyjY6xv3ESpvsSknX3qYKsMr649vz4ao1QrG1s0LunL1vw=
=t8bS
-----END PGP SIGNATURE-----
--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?r2vu-rm7f-wny>