From owner-freebsd-arch@FreeBSD.ORG Tue Sep 16 02:43:14 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C2831065678 for ; Tue, 16 Sep 2008 02:43:14 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 239F28FC0A for ; Tue, 16 Sep 2008 02:43:14 +0000 (UTC) (envelope-from sam@errno.com) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m8G2R5uX006314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 15 Sep 2008 19:27:06 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <48CF1979.90507@errno.com> Date: Mon, 15 Sep 2008 19:27:05 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: arch@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: Subject: the more build knobs bikeshed 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, 16 Sep 2008 02:43:14 -0000 Here is a patch against HEAD to add several knew MK_* knobs that can be used to trim the build for small-footprint applications: http://www.freebsd.org/~sam/build.patch With these changes I can build a nanobsd image for x86 or arm that is <1/2 the size you can get otherwise (using just the standard knobs). If you do not use the knobs you should get exactly what you're used to getting. My goal in doing this is to make nanobsd more useful for building embedded packages without bypassing the build process to purge stuff. This is still a LONG way from small enough to fit in many applications but seems like a useful start. FWIW I chose knobs using two criteria: 1. Does it save an appreciable amount of space. 2. Does it remove applications that you really don't want to be present. I'm sure folks will wonder about some choices. One can also argue that some of the groups I've added are wrong and/or we should have individual knobs for each application. Separate issues that I intend to work on: 1. Build time is way too long; paring down the target config should also reduce the build time but it does not because things like MK_TOOLCHAIN cannot be used when building; only when installing. 2. Some applications that you want are hugely bloated and may benefit from some TLC. bind comes to mind where I can crunchgen all the bits into a single binary but when built normally you get multiple huge executables. 3. Cross-build and package; I can use nanobsd to build arm images but the packaging facilities are inadequate. I've got a start on default setups for some boards/packages and would like to see this grow into a library that people can use for reference and/or extend. Anyway, I'm interested in getting the above patch committed so looking for constructive comments. I haven't included the files that go under src/tools/build/options (I've done them already). I also have mods for RELENG_7 that I've been using for a while. Sam