From owner-freebsd-arm@freebsd.org Mon Aug 8 01:11:49 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 B79ABBA9E70 for ; Mon, 8 Aug 2016 01:11:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (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 7BF1B1E6D for ; Mon, 8 Aug 2016 01:11:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id 38so345214637iol.0 for ; Sun, 07 Aug 2016 18:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Hq56759vvpSpiC9tGKRt+tOmBPdSJe/08GraBkolqZ0=; b=qoyuIYDtQdeYe0lE6tpPEQauWUF0YfkX7A8qKbaIK+yhPCc/0rV7kz8Eo2qQkjXG2u Ug7ds8Gefy9T+SSj0+g9/ou9gROrffP2xNyuO0WPkdJplCFqvFwMn+T91dSaofMrcwvV 8F7ITn1vE4Yq1u3vNefGC8geIuDcsJxnvL+Ptwzet6AOv/ov8xAYOvj70wlWF+KYqaoK 6W8s7dZkf48VEfc8a4BFyS73i36kP56KkBhhntKh5BMA5mKVLMzIu0lhOoqAqwm+mfeO ZSzXpLTe4xNICC62sLrNv9rfPAx0z1pGEDo0Aq3rsLxVU/6gf9XFPaTN79zNa/fFBO/M fCWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Hq56759vvpSpiC9tGKRt+tOmBPdSJe/08GraBkolqZ0=; b=FS2D6QQnSYILyX9oZvoPuP00qQZ+ngK0nhMgHwBOdTm2cHF55GbJEJy0V9V7VFboGG MKmTPiNBmErYMIRWalpzaXZHkzY3K7h5fiQqWcxuFnPPIoj1P8dIS9mlU4GbG0eno7nF HM60yfdR1MgzjI4tg4LqI1BmohTM28yTaoT1I5fjUlr9Ha2FKC3DBQoElcuJv/E/b0VQ MvItSmGz2gQnPOfeNADfDFWdEQ4xD4UKePl/FW1SXgIhJ5/ODOppndEM/fR7bNXkDDER NQyfKHGrcV0qwfyihT5ucQrK07fB8ZQd82uR6JqpaA+qXJThVAXnHizWB7uUGEeQgJxU px2w== X-Gm-Message-State: AEkoouvYlGBJDDyL3OhKHV7z+Qh/mrxGzKyxzi+qEkwqg1kvYb1azCUKzDzVCC1ctV/d5w== X-Received: by 10.107.15.229 with SMTP id 98mr45771987iop.123.1470618708931; Sun, 07 Aug 2016 18:11:48 -0700 (PDT) Received: from mac.nflx.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id i191sm9143315itf.13.2016.08.07.18.11.47 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Aug 2016 18:11:48 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: out of tree kernel modules (was: compiling modules and FDT define) From: Warner Losh In-Reply-To: <20160807221319.GD34368@cicely7.cicely.de> Date: Sun, 7 Aug 2016 19:11:45 -0600 Cc: Adrian Chadd , "freebsd-arm@freebsd.org" , Bernd Walter Content-Transfer-Encoding: quoted-printable Message-Id: <53881075-AEC4-4B1A-B000-A340FAAB88CC@bsdimp.com> References: <20160805005433.GL18406@cicely7.cicely.de> <20160805134358.GN18406@cicely7.cicely.de> <20160807221319.GD34368@cicely7.cicely.de> To: ticso@cicely.de X-Mailer: Apple Mail (2.3124) 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 01:11:49 -0000 > On Aug 7, 2016, at 4:13 PM, Bernd Walter = wrote: >=20 > On Fri, Aug 05, 2016 at 08:20:11PM -0700, Adrian Chadd wrote: >> Hi, >>=20 >> Try adding opt_platform.h to SRCS in the module makefile? >>=20 >> 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. >>=20 >> here's what I do: >>=20 >> #!/bin/sh >>=20 >> 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/ad= rian/work/freebsd/head/src/sys/GERTRUDE/"} >> X_KMODOWN=3D${X_KMODOWN:=3D"adrian"} >> X_KMODGRP=3D${X_KMODGRP:=3D"adrian"} >>=20 >> # 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"" \ >> $@ >>=20 >> That gets me all the bits I need to be able to run make in module >> directories and get the correct includes/links setup. >=20 > 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. Warner=