From owner-freebsd-arch@FreeBSD.ORG Tue Jan 3 19:02:11 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2A76106567C; Tue, 3 Jan 2012 19:02:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4F05C8FC1E; Tue, 3 Jan 2012 19:02:11 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id q03IulTj010827 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 3 Jan 2012 11:56:49 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Tue, 3 Jan 2012 11:56:42 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <15285562-E9BA-431B-A2C1-D0547DFB2663@bsdimp.com> <201201030924.44493.jhb@freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 03 Jan 2012 11:56:49 -0700 (MST) Cc: freebsd-arch@freebsd.org Subject: Re: Request for help: how do teach module building about kernel options? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 19:02:11 -0000 On Jan 3, 2012, at 10:30 AM, Adrian Chadd wrote: > On 3 January 2012 06:24, John Baldwin wrote: >=20 >>> Working off the cuff, I'd propose the following API: >>>=20 >>> KERNOPTS=3Dfoo baz >>> SRC_FOO =3D foo.c >>> SRC_BAZ =3D baz.c >>> SRC=3D a.c b.c d.c >>>=20 >>> And have the magic needed to conditionally add SRC_FOO and SRC_BAZ = to SRC in bsd.kern.mk. >=20 > I'd be happy with the former to begin with, based on all the options. > Devices would be nice too, but that can come later. > How about: >=20 > KERNOPTS=3Dfoo baz > KERNDEVICES=3Da b c d e I think you are misunderstanding what I'm trying to say. This isn't = "options foo and bar from the kernel config file" but rather "please let = me build things based on what's in the opt_foo.h and opt_bar.h files" > Or if we're goign for linux-like config.mk (which would save on line > length issues, for very large kernel config files?): >=20 > KERNOPTS_foo=3D > KERNOPTS_bar=3DXXX > KERNOPTS_baz=3DYYY >=20 >> Not only that, but it would be nice if the list of modules to be = built could >> be tailored to what options are enabled. For example, if I build a = kernel that >> doesn't have inet or inet6 then it shouldn't try to build ipfw, etc. >=20 > That'd be nice too, but it's almost like we'd need another domain > specific language just to describe how to build sys/modules/Makefile. > :-) Right now MODULES_OVERRIDE provides an adequate hook for this. > So how about we do up say, the KERNOPTS field first, which would be a > big win. Then KERNDEVICES too, if that's possible? I'd only planned on doing KERNOPTS :) Warner=