From owner-freebsd-questions@FreeBSD.ORG Fri Nov 25 17:13:14 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 9005A106566B for ; Fri, 25 Nov 2011 17:13:14 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 2626E8FC13 for ; Fri, 25 Nov 2011 17:13:13 +0000 (UTC) Received: by wwe5 with SMTP id 5so2340860wwe.31 for ; Fri, 25 Nov 2011 09:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=QCNF0E9ryHu9IF8rHWgjVdmtO8ao+kqBjXxwvWfqNCA=; b=rzNQwQoEj7BiREcYUgbaM3xiouFhVC64/W1EZW/dlt2oGkkEtBzvUHJlVtSZf2bivj RVPagsvu94GTNCpxH9nObeOdKZ/Ht64CTZefR+zSnEDIjvRX3ZlCf5N0LEthIpMcyBw7 ZLpPcAILkdrKYfb75pzHwV1wbyeiv78ytNA7s= MIME-Version: 1.0 Received: by 10.216.229.13 with SMTP id g13mr46985weq.52.1322241192317; Fri, 25 Nov 2011 09:13:12 -0800 (PST) Received: by 10.180.94.131 with HTTP; Fri, 25 Nov 2011 09:13:12 -0800 (PST) In-Reply-To: <4ecf1dca.22d1440a.2dd2.3464SMTPIN_ADDED@mx.google.com> References: <4ecf1dca.22d1440a.2dd2.3464SMTPIN_ADDED@mx.google.com> Date: Fri, 25 Nov 2011 17:13:12 +0000 Message-ID: From: "b. f." To: Thomas Mueller Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@freebsd.org 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: Fri, 25 Nov 2011 17:13:14 -0000 On 11/25/11, Thomas Mueller wrote: > from "b. f." : > >> 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. > > Suppose you want to build more than one kernel so as to be able to choose at > boot time. > > Then you might not want to build modules redundantly. So how would you make > the modules from /boot/kernel accessible when booting /boot/kernel2? > If the kernel versions were compatible, and the set of modules were the same, I suppose you could set MODULES_WITH_WORLD and KODIR=/boot/modules during buildworld and installworld, to build the modules as part of buildworld and install them in /boot/modules during installworld, rather than in /boot/kernel or /boot/kernel2. Then you could build and install both of your kernels with NO_MODULES, as previously discussed, and with your different choices of KODIR for each kernel. Because /boot/modules is part of the default module_path defined in /boot/defaults/loader.conf, the modules ought to load as usual for either kernel. If you wanted to place them in a different directory, you could alter KODIR during buildworld and installworld, and add the directory to module_path in /boot/loader.conf. I haven't tested this, but I think that it will work, and I'd be interested to hear whether it does. There are of course alternative methods. b.