From owner-freebsd-questions@FreeBSD.ORG Thu Nov 24 15:17:13 2011 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B008E106564A for ; Thu, 24 Nov 2011 15:17:13 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4AA288FC12 for ; Thu, 24 Nov 2011 15:17:12 +0000 (UTC) Received: by faap15 with SMTP id p15so4318851faa.13 for ; Thu, 24 Nov 2011 07:17:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=Vp8JSHx1oWsACO4GJ+NogKFNHJB47YJQGDbXGTAoxqM=; b=CYcrVHzOMq0vZm5OhzgS/wzm0/n0+LosUlMLQ0Ud4gJuGw7IE05cv3LG70WxstDWc4 qlhBX9F4t1jP0whEudA4PLna/UvFksj/N3vs5k826kIkHMO/hbOAgquRZgwguUUieDG4 pgm58IMY/hjo8SoIt/ZdpBeg/N1Hl8uvN51Z4= MIME-Version: 1.0 Received: by 10.180.7.198 with SMTP id l6mr29569880wia.3.1322147831368; Thu, 24 Nov 2011 07:17:11 -0800 (PST) Received: by 10.180.94.131 with HTTP; Thu, 24 Nov 2011 07:17:11 -0800 (PST) Date: Thu, 24 Nov 2011 15:17:11 +0000 Message-ID: From: "b. f." To: freebsd-questions@FreeBSD.org, Brett Glass Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: Quick build of stripped-down kernel X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 15:17:13 -0000 > Happy Thanksgiving! This week, I've been building FreeBSD 9.0-RC2 And to you, too. > kernels for various machines, and on some of the older and slower > ones it's been taking quite a long time. One of the reasons for > this is that even if you strip 98% of the drivers out of the > kernel, they are all still built as loadable modules. The machines > in question will NEVER use those modules, so it's a waste of time > and disk space. > > How hard would it be to create a build target for "make" that would > avoid building the loadable modules and just leave them out of the > directory where the new kernel is placed after installation? I am > not intimately familiar with the cascade of makefiles that does the > build.... I could probably figure out what to tweak, but if someone > who is expert in this can help it would be appreciated. It would > save me countless hours. If you are going to build most of the modules, but only want to exclude a few, then add the directories of the modules to be excluded (relative to /usr/src/sys/modules) to WITHOUT_MODULES, for example in /etc/make.conf. If you are only going to build a few modules, and want to exclude the majority of the modules, then add the directories of the modules that are to be built to MODULES_OVERRIDE. For no modules at all, set NO_MODULES. See /usr/src/sys/modules/Makefile and /usr/src/sys/conf/kern.post.mk for details. You may also save some time by using one of your faster machines to build the OS for the slower machines. b.