From owner-freebsd-questions@FreeBSD.ORG Fri Oct 29 20:26:10 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C3A916A4CE for ; Fri, 29 Oct 2004 20:26:10 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BD4543D54 for ; Fri, 29 Oct 2004 20:26:09 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b163.otenet.gr [212.205.244.171]) i9TKQ6qG007436; Fri, 29 Oct 2004 23:26:07 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i9TKQ5LY001414; Fri, 29 Oct 2004 23:26:05 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i9TKQ5fU001413; Fri, 29 Oct 2004 23:26:05 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 29 Oct 2004 23:26:05 +0300 From: Giorgos Keramidas To: Brad Waite Message-ID: <20041029202605.GC1046@gothmog.gr> References: <2614.67.165.234.240.1099073745.squirrel@webmail.wcubed.net> <20041029183742.GB76157@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041029183742.GB76157@dan.emsphone.com> cc: freebsd-questions@FreeBSD.org Subject: Re: Building part of world X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2004 20:26:10 -0000 On 2004-10-29 13:37, Dan Nelson wrote: > In the last episode (Oct 29), Brad Waite said: > > I'm trying to update my sys/pci/if_sk.c and would like to be able to > > build several versions without having to build the entire world. > > Since that's a kernel driver, you only have to build a new kernel. An even better approach in the case of a single kernel driver is to leave it commented out in the kernel config file. Then it will be built as a module by default. After at least one buildworld/buildkernel cycle has finished correctly with this configuration, you can use the already populated /usr/obj tree to build just this module: # cd /usr/src/sys/i386/conf # config -g -d /usr/obj/usr/src/sys/MYKERNEL MYKERNEL # cd /usr/obj/usr/src/sys/MYKERNEL # make depend && make && make install If you have only touched a single .c file, the 'make depend' step is AFAIK optional. The rest should finish pretty fast. Brave people might even get away by building the sk module only, by emulating the specific part of the kernel build: # cd /usr/src/sys/modules/sk # env MAKEOBJDIRPREFIX=/tmp/sk \ KMODDIR=/boot/kernel DEBUG_FLAGS="-g" MACHINE=i386 \ KERNBUILDDIR="/usr/obj/usr/src/sys/MYKERNEL" make obj # env MAKEOBJDIRPREFIX=/tmp/sk \ KMODDIR=/boot/kernel DEBUG_FLAGS="-g" MACHINE=i386 \ KERNBUILDDIR="/usr/obj/usr/src/sys/MYKERNEL" make all If all this works, you can just kldload the new if_sk.ko from `/tmp/sk/usr/src/sys/modules/sk' to test your changes. HTH, Giorgos