svn commit: r448928 - in head/graphics: . drm-next-kmod
Johannes M Dieterich
jmd at freebsd.org
Wed Aug 30 02:32:40 UTC 2017
Jan Beich – Tue., 29. August 2017 19:25
> Jan Beich <jbeich at FreeBSD.org> writes:
>
> > Jan Beich <jbeich at FreeBSD.org> writes:
> >
> >> Johannes M Dieterich <jmd at freebsd.org> writes:
> >>
> >>> Jung-uk Kim – Tue., 29. August 2017 16:46
> >>>> On 08/29/2017 13:13, Jan Beich wrote:
> >>>> > Johannes M Dieterich <jmd at FreeBSD.org> writes:
> >>>> >
> >>>> >> 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= kmod uidfix
> >>>> >
> >>>> > Fails to build if SRC_BASE != /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".
> >>>> >
> >>>> > Maybe add MAKE_ENV = SRCTOP="${SRC_BASE}" to fix the following.
> >>>> >
> >>>> > $ make DISABLE_MAKE_JOBS=
> >>>> > ===> Building for drm-next-kmod-g20170825
> >>>> > ===> drm (all)
> >>>> > Warning: Object directory not changed from original
> >>>> > /usr/ports/graphics/drm-next-kmod/work/kms-drm-4ee5acb/drm
> >>>> > ===> 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-4ee5acb/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.
>
> --- Makefile.orig 2017-08-23 00:35:05 UTC
> +++ Makefile
> @@ -1,9 +1,5 @@
> # $FreeBSD$
>
> -SYSDIR?=${SRC_BASE}/sys
> -
> -.include "${SYSDIR}/conf/kern.opts.mk"
> -
> SUBDIR= drm \
> amd \
> i915 \
> @@ -19,7 +15,10 @@ SUBDIR= drm \
> # WARNING: THIS WILL CHANGE THE SOURCE TREE! ONLY USE IF THERE ARE NO OTHER
> # CHANGES THAT NEED TO BE RECOVERED!
> #
> +.if make(drm2-debug-source-changes)
> +SYSDIR?= /usr/src/sys
> DRM_DEBUG_EXCLUDES= 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' | \
> --- amd/Makefile.orig 2017-08-29 23:23:06 UTC
> +++ amd/Makefile
> @@ -1,7 +1,5 @@
> # $FreeBSD$
>
> -.include "${SYSDIR}/conf/kern.opts.mk"
> -
> .if ${MACHINE_CPUARCH} == "amd64"
> _amdgpu= amdgpu
> _amdkfd= amdkfd
> --- amd/amdgpu/Makefile.orig 2017-08-23 00:35:05 UTC
> +++ amd/amdgpu/Makefile
> @@ -135,7 +135,7 @@ SRCS= amdgpu_acpi.c \
>
> CFLAGS+= -I${.CURDIR:H:H}/linuxkpi/dummy/include
> CFLAGS+= -I${.CURDIR:H:H}/linuxkpi/gplv2/include
> -CFLAGS+= -I${SRC_BASE}/sys/compat/linuxkpi/common/include
> +CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include
>
> CFLAGS+= -I${.CURDIR:H:H}/include
> CFLAGS+= -I${.CURDIR:H:H}/include/drm
> --- amd/amdkfd/Makefile.orig 2017-08-23 00:35:05 UTC
> +++ amd/amdkfd/Makefile
> @@ -1,6 +1,6 @@
> # $FreeBSD$
>
> -#.PATH: ${SRCTOP}/sys/dev/drm/amd/amdkfd
> +#.PATH: ${SYSDIR}/dev/drm/amd/amdkfd
>
> KMOD = amdkfd
>
> @@ -36,7 +36,7 @@ SRCS = \
>
> CFLAGS+= -I${.CURDIR:H:H}/linuxkpi/dummy/include
> CFLAGS+= -I${.CURDIR:H:H}/linuxkpi/gplv2/include
> -CFLAGS+= -I${SRC_BASE}/sys/compat/linuxkpi/common/include
> +CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include
>
> CFLAGS+= -I${.CURDIR:H:H}/include
> CFLAGS+= -I${.CURDIR:H:H}/include/drm
> --- drm/Makefile.orig 2017-08-23 00:35:05 UTC
> +++ drm/Makefile
> @@ -83,7 +83,7 @@ SRCS= ati_pcigart.c \
>
> CFLAGS+= -I${.CURDIR:H}/linuxkpi/dummy/include
> CFLAGS+= -I${.CURDIR:H}/linuxkpi/gplv2/include
> -CFLAGS+= -I${SRC_BASE}/sys/compat/linuxkpi/common/include
> +CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include
> CFLAGS+= -I${.CURDIR}
> CFLAGS+= -I${.CURDIR}/ttm
> CFLAGS+= -I${.CURDIR:H}/include
> --- i915/Makefile.orig 2017-08-23 00:35:05 UTC
> +++ i915/Makefile
> @@ -93,7 +93,7 @@ CLEANFILES+= ${KMOD}.ko.full ${KMOD}.ko.debug
>
> CFLAGS+= -I${.CURDIR:H}/linuxkpi/dummy/include
> CFLAGS+= -I${.CURDIR:H}/linuxkpi/gplv2/include
> -CFLAGS+= -I${SRC_BASE}/sys/compat/linuxkpi/common/include
> +CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include
>
> CFLAGS+= -I${.CURDIR:H}/include
> CFLAGS+= -I${.CURDIR:H}/include/drm
> --- lindebugfs/Makefile.orig 2017-08-23 00:35:05 UTC
> +++ lindebugfs/Makefile
> @@ -9,6 +9,6 @@ SRCS= vnode_if.h \
>
> CFLAGS+= -I${.CURDIR}/../linuxkpi/dummy/include
> CFLAGS+= -I${.CURDIR}/../linuxkpi/gplv2/include
> -CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include
> +CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include
>
> .include <bsd.kmod.mk>
> --- linuxkpi/Makefile.orig 2017-08-23 00:35:05 UTC
> +++ linuxkpi/Makefile
> @@ -37,7 +37,7 @@ CFLAGS+= -include ${.CURDIR}/../drm/drm_os_config.h
> CFLAGS+= -I${.CURDIR}/../include
> CFLAGS+= -I${.CURDIR}/dummy/include
> CFLAGS+= -I${.CURDIR}/gplv2/include
> -CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include
> +CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include
> CFLAGS+= '-DKBUILD_MODNAME="${KMOD}"'
>
> .include <bsd.kmod.mk>
> --- radeon/Makefile.orig 2017-08-23 00:35:05 UTC
> +++ radeon/Makefile
> @@ -113,7 +113,7 @@ SRCS= atom.c \
>
> CFLAGS+= -I${.CURDIR:H}/linuxkpi/dummy/include
> CFLAGS+= -I${.CURDIR:H}/linuxkpi/gplv2/include
> -CFLAGS+= -I${SRC_BASE}/sys/compat/linuxkpi/common/include
> +CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include
>
> CFLAGS+= -I${.CURDIR:H}/include
> CFLAGS+= -I${.CURDIR:H}/include/drm
Thanks! As of r448954, graphics/gpu-firmware-kmod contains uidfix and sets licenses explicitly to allow packaging and graphics/drm-next-kmod is updated to a later git revision where I upstreamed above patch. I have successfully built graphics/drm-next-kmod with the kernel source moved away from /usr/src. Let me know if there are still issues for either of you.
Johannes
More information about the svn-ports-all
mailing list