From owner-svn-ports-all@freebsd.org Wed Aug 30 02:32:40 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E17DEC73A; Wed, 30 Aug 2017 02:32:40 +0000 (UTC) (envelope-from jmd@freebsd.org) Received: from www.poelloepaeae.de (v22017034403546374.happysrv.de [188.68.38.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D8187F5C1; Wed, 30 Aug 2017 02:32:39 +0000 (UTC) (envelope-from jmd@freebsd.org) Received: from mailman (www.poelloepaeae.de [192.168.1.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by www.poelloepaeae.de (Postfix) with ESMTPSA id 47D9018811D; Wed, 30 Aug 2017 04:27:23 +0200 (CEST) From: Johannes M Dieterich To: Jan Beich Cc: svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, Jung-uk Kim , ports-committers@freebsd.org Subject: Re: svn commit: r448928 - in head/graphics: . drm-next-kmod In-Reply-To: Message-ID: <20170830022723.Horde.x4Tqdxody5fHJ8ivEDeKjVp@www.poelloepaeae.de> User-Agent: Horde Application Framework 5 Date: Wed, 30 Aug 2017 02:27:23 +0000 Content-Type: text/plain; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2017 02:32:40 -0000 Jan Beich – Tue., 29. August 2017 19:25 > Jan Beich writes: > > > Jan Beich writes: > > > >> Johannes M Dieterich writes: > >> > >>> Jung-uk Kim – Tue., 29. August 2017 16:46 > >>>> On 08/29/2017 13:13, Jan Beich wrote: > >>>> > Johannes M Dieterich 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 , 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 > --- 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 > --- 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