Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Aug 2016 19:54:26 -0700
From:      Adrian Chadd <adrian.chadd@gmail.com>
To:        Warner Losh <wlosh@bsdimp.com>
Cc:        ticso@cicely.de, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>,  Bernd Walter <ticso@cicely7.cicely.de>
Subject:   Re: out of tree kernel modules (was: compiling modules and FDT define)
Message-ID:  <CAJ-Vmom_rv=ifnz=NZn21N64%2BryzOitcm-v2uVhwB_NyqFYPjQ@mail.gmail.com>
In-Reply-To: <53881075-AEC4-4B1A-B000-A340FAAB88CC@bsdimp.com>
References:  <20160805005433.GL18406@cicely7.cicely.de> <20160805134358.GN18406@cicely7.cicely.de> <CAJ-VmonNG1XycPWUH%2BrrpcKBUKH8R6u_aD=odmbPB17r8UyM0A@mail.gmail.com> <20160807221319.GD34368@cicely7.cicely.de> <53881075-AEC4-4B1A-B000-A340FAAB88CC@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7 August 2016 at 18:11, Warner Losh <wlosh@bsdimp.com> wrote:
>
>> On Aug 7, 2016, at 4:13 PM, Bernd Walter <ticso@cicely7.cicely.de> wrote=
:
>>
>> On Fri, Aug 05, 2016 at 08:20:11PM -0700, Adrian Chadd wrote:
>>> Hi,
>>>
>>> Try adding opt_platform.h to SRCS in the module makefile?
>>>
>>> You don't need to add it to the tree. You just have to setup your path
>>> to point things /at/ a kernel build tree withall the opt_xxx.h in
>>> them.
>>>
>>> here's what I do:
>>>
>>> #!/bin/sh
>>>
>>> X_SRCDIR=3D${X_SRCDIR:=3D"/home/adrian/work/freebsd/head/src/"}
>>> X_KERNDIR=3D${X_KERNDIR:=3D"/home/adrian/work/freebsd/head/obj/usr/home=
/adrian/work/freebsd/head/src/sys/GERTRUDE/"}
>>> X_KMODOWN=3D${X_KMODOWN:=3D"adrian"}
>>> X_KMODGRP=3D${X_KMODGRP:=3D"adrian"}
>>>
>>> # This allows for -HEAD includes for net80211 ..
>>> env CFLAGS=3D"-I../../../sys/" \
>>> make \
>>>    MODULES_OVERRIDE=3D"" \
>>>    DEBUG_FLAGS=3D"-g" \
>>>    DEBUG_FLAGS=3D"-g" \
>>>    KMODDIR=3D"/home/adrian/git/github/erikarn/athp/otus/freebsd/modules=
/" \
>>>    KMODOWN=3D"${X_KMODOWN}" \
>>>    KMODGRP=3D"${X_KMODGRP}" \
>>>    MAKESYSPATH=3D"${X_SRCDIR}/share/mk" \
>>>    SYSDIR=3D"${X_SRCDIR}/sys/" \
>>>    KERNBUILDDIR=3D"${X_KERNDIR}" \
>>>    KERN_DEBUGDIR=3D"" \
>>>    $@
>>>
>>> That gets me all the bits I need to be able to run make in module
>>> directories and get the correct includes/links setup.
>>
>> Oh damn - it used to be much easier than that.
>> I'm still used to "make all install" for out of tree kernel modules.
>> How is it handled for the few kmods in ports?
>
> Mostly by setting KERNBUILDDIR correctly. If we have to jump through all =
these hoops too,
> then I=E2=80=99ll take a look at fixing things=E2=80=A6. The above looks =
more complex than should be
> required.

* You don't need KMOD* unless you're installing somewhere other than
/boot/modules as root; I set that so I can build/install as adrian
* the last time I checked, KERNBUILDDIR didn't seem to be enough



-adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmom_rv=ifnz=NZn21N64%2BryzOitcm-v2uVhwB_NyqFYPjQ>