Linux: Specifying A Build Directory

Submitted by Jeremy
on August 19, 2003 - 8:43pm

Sam Ravnborg posted a set of patches to the lkml for the 2.6.0-test development kernel that adds support for specifying a build directory that's different than the source directory. In other words, with one kernel source tree it would be possible to build multiple binary kernels each using different build configurations. This new functionality also makes it possible to compile the Linux kernel directly from source code stored on a read-only device such as a CD-ROM. Sam explains:

"The patch has been in existence [for] several months but only lately becoming in a suitable state ready for inclusion. It is developed based on an initial concept made by Kai Germaschewski, but refined a lot since then. It works with a kernel based on [the] default configuration (make defconfig)."


From: Sam Ravnborg [email blocked]
To: Linus Torvalds [email blocked]
Subject: kbuild: Separate ouput directory support
Date: 	Tue, 19 Aug 2003 23:41:44 +0200

The following set of patches introduce support for
separate output directory when building a kernel.
Typical usage is building several kernels with different configurations -
but based on the same kernel src.

Consider the following setup:
/home/sam/bk/linux-2.6		<= kernel src

/home/sam/kernel/mars		<= My workstation
/home/sam/kernel/defconfig	<= defconfig for compiletime testing

Then in order to handle the two different configurations I just have to do:
cd /home/sam/bk/linux-2.6
make O=../../kernel/mars

And the same for the defconfig version.

All output files are stored in the output directory, including .config.
[Thanks to Roman Zippel which made this loong time ago in kconfig].

The patch has been in existence in several months but only lately becoming
in a suitable state ready for inclusion. It is developed based on an initial
concept made by Kai Germaschewski, but refined a lot since then.
It works with a kernel based on default configuration (make defconfig).

It is divided up in the following parts:
core	the kbuild changes to support separate output directory
ieee	Fix in ieee Makefile
i386	Fix in i386 Makefiles + new syntax enabled for always
	This was required because i386 had an executable located in
	a subdirectory.
include	Fixes for errornous include paths, and one place where a generated
	.c file references a .h file in the kernel tree.
	

Please pull from
	bk pull bk://linux-sam.bkbits.net/kbuild

Patches follows this mail.

	Sam

Patches:
[core] [ieee] [i386] [include]

From: Jeff Garzik [email blocked] Subject: Re: kbuild: Separate ouput directory support Date: Tue, 19 Aug 2003 17:53:33 -0400 Sam Ravnborg wrote: > The following set of patches introduce support for > separate output directory when building a kernel. > Typical usage is building several kernels with different configurations - > but based on the same kernel src. Thanks, this is some pretty neat stuff. Is it possible, with your patches, to build from a kernel tree on a read-only medium? Jeff
From: Sam Ravnborg [email blocked] Subject: Re: kbuild: Separate ouput directory support Date: Tue, 19 Aug 2003 23:56:56 +0200 On Tue, Aug 19, 2003 at 05:53:33PM -0400, Jeff Garzik wrote: > Is it possible, with your patches, to build from a kernel tree on a > read-only medium? Yes, thats possible. But I have seen that as a secondary possibility. But I know people has asked about the possibility to build a kernel from src located on a CD. And thats possible with this patch. Sam
From: Mike Fedyk [email blocked] Subject: Re: kbuild: Separate ouput directory support Date: Tue, 19 Aug 2003 15:13:58 -0700 On Tue, Aug 19, 2003 at 11:56:56PM +0200, Sam Ravnborg wrote: > On Tue, Aug 19, 2003 at 05:53:33PM -0400, Jeff Garzik wrote: > > Is it possible, with your patches, to build from a kernel tree on a > > read-only medium? > > Yes, thats possible. But I have seen that as a secondary possibility. > But I know people has asked about the possibility to build a kernel > from src located on a CD. And thats possible with this patch. That also means you can run multiple builds over nfs or even on the same machine from the same tree (or a different tree, that was cp -al and then patched). Thanks.

Related Links:

That could be kind of neat fo

telcor
on
August 20, 2003 - 11:38am

That could be kind of neat for certain situations. Place the Kernel source in a central location and have several computers building their new kernels from it. Probably too late for 2.6 inclusion however....sad

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.