From owner-freebsd-arm@freebsd.org Mon Aug 8 02:54:27 2016 Return-Path: Delivered-To: freebsd-arm@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 CF4D8BB0BBB for ; Mon, 8 Aug 2016 02:54:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 977D91A70 for ; Mon, 8 Aug 2016 02:54:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x234.google.com with SMTP id x130so64120824ite.1 for ; Sun, 07 Aug 2016 19:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=mEKfDt4s5Ni4G8zrh6sK0jLwA+ss6naLOsJLQZPsga4=; b=EIec35iLGz71XYbCL/F65AEYaSfV0+aPF5ZABSIiifMmHobLspMhmvId2uaam98cYk wH8VKMrJOxTS/iogObwDOroT5KoNPEd0mvj+s2iRp6boeDso/ISCjb6SX0m/u81FwEH3 1W8MhbdwSqklWJK31w3g9h4dBe94U6BYlCmybMBZigjO56dtUyDxe/sfbZMMPYk5BoMh EIYmWYxrYkRVIwm5BGLVMFpUfhGwupNrWQOp6riRaTZuIK1W4m/G4LFAsCfsrZuZJ/70 lJmwT+n6x+cIe1wZHPxIrNTSMPCu2NJ/hCM27/B8zl62Pcfka78fuu/kVdAOVpKafEwJ BXRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=mEKfDt4s5Ni4G8zrh6sK0jLwA+ss6naLOsJLQZPsga4=; b=N1uZqjzFOeMkEV4XEjgBd7DR7tdAc+04D1YDwu9A+XAbANw9+YQ1vO+2ZnyFTGwQt/ J94fYVwb3EfMo7gzyBw/Swb7EKoHvkc84QUB20VAdjrFpxYml3lr8iKfETQbbjCMMJV6 bIWyxfEq996S5zFRjVznCjPDX5Ib9esxE6LwHXNdx/5VckB9FBR+02t/GvaBXG2v2BjM vcRtmQAb7N+TWwqYV1J1AaZmILpQPHuVv7zDzUp1cSA5Kns5tPI0V1MB5cj3ad0KcNcp d8Dw8reM0jN62MomYn6+5YEZY1rJRoFsMd1OxtPBs7cLl/dSVBOgaqTf6s2l6upnbpI9 wDvQ== X-Gm-Message-State: AEkoouvr4PhYqBDhHNrrGpH7DPPh8i/HwiLnu+ccmaoEAVuyBd0tyVXdYQVbm7rKcGa0TSMzbvrzOVcAJhNesQ== X-Received: by 10.36.212.6 with SMTP id x6mr14582284itg.71.1470624866973; Sun, 07 Aug 2016 19:54:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Sun, 7 Aug 2016 19:54:26 -0700 (PDT) In-Reply-To: <53881075-AEC4-4B1A-B000-A340FAAB88CC@bsdimp.com> References: <20160805005433.GL18406@cicely7.cicely.de> <20160805134358.GN18406@cicely7.cicely.de> <20160807221319.GD34368@cicely7.cicely.de> <53881075-AEC4-4B1A-B000-A340FAAB88CC@bsdimp.com> From: Adrian Chadd Date: Sun, 7 Aug 2016 19:54:26 -0700 Message-ID: Subject: Re: out of tree kernel modules (was: compiling modules and FDT define) To: Warner Losh Cc: ticso@cicely.de, "freebsd-arm@freebsd.org" , Bernd Walter Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2016 02:54:27 -0000 On 7 August 2016 at 18:11, Warner Losh wrote: > >> On Aug 7, 2016, at 4:13 PM, Bernd Walter 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