2007-09-12 23:25:52

by Chris Wedgwood

[permalink] [raw]
Subject: [RFC PATCH] Add a 'minimal tree install' target

This is a somewhat rough first-pass at making a 'minimal tree'
installation target. This installs a partial source-tree which you
can use to build external modules against. It feels pretty unclean
but I'm not aware of a much better way to do some of this.

This patch works for me, even when using O=<buildtree>. It probably
needs further cleanups.

Comments?

-----
Add a 'mintree-install' makefile target.

Red Hat and other distributions typically have some logic in their
kernel package build system to create/install 'minimalist source tree'
which contains enough state to build external modules against but is
much smaller than the entire build-tree.

This introduces similar logic, the guts of this was taken from a
Fedora Core spec file and mutilated to make it work for O=<...>
builds.
-----


diff --git a/Makefile b/Makefile
index 3067f6a..1246939 100644
--- a/Makefile
+++ b/Makefile
@@ -1085,6 +1085,11 @@ package-dir := $(srctree)/scripts/package
$(Q)$(MAKE) $(build)=$(package-dir) $@
rpm: include/config/kernel.release FORCE
$(Q)$(MAKE) $(build)=$(package-dir) $@
+# /usr/src/linux to match what most distro's do
+#export INSTALL_MINTREE_PATH ?= /usr/src/linux
+export INSTALL_MINTREE_PATH ?= /tmp/mt-test/
+mintree-install: include/config/kernel.release FORCE
+ $(Q)$(MAKE) $(build)=$(package-dir) $@


# Brief documentation of the typical targets used
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 7c434e0..0c5f07d 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -86,6 +86,12 @@ tar%pkg: FORCE
clean-dirs += $(objtree)/tar-install/


+# minimal tree installation target
+# ---------------------------------------------------------------------------
+mintree-install: FORCE
+ $(MAKE) KBUILD_SRC=
+ $(CONFIG_SHELL) $(srctree)/scripts/package/mintree-install
+
# Help text displayed when executing 'make help'
# ---------------------------------------------------------------------------
help: FORCE
@@ -96,4 +102,6 @@ help: FORCE
@echo ' tar-pkg - Build the kernel as an uncompressed tarball'
@echo ' targz-pkg - Build the kernel as a gzip compressed tarball'
@echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
+ @echo ' mintree-install - Build the kernel and install a minimal-build-tree'
+ @echo ' that can be used to build external modules against'

diff --git a/scripts/package/mintree-install b/scripts/package/mintree-install
new file mode 100644
index 0000000..1362cc2
--- /dev/null
+++ b/scripts/package/mintree-install
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+# miniman-tree-install
+#
+# This should install necessary the headers, makefiles and
+# configuration files in a location so that you can use kbuild to
+# build external (out of tree) modules without needing the entire
+# kernel build tree.
+#
+
+# This has been shamelessly taken from a Red Hat's spec file,
+# http://cvs.fedora.redhat.com/viewcvs/devel/kernel/kernel.spec?rev=1.145&view=markup
+
+# FIXME:cw Some parts of this are still icky, it's not clear how best
+# to clean some of this up. Error handling is more or less
+# non-existent. You could argue that this entire process should be
+# done differently (ie. using kbuild knowledge instead of a whole lot
+# of hard-coded magic here).
+
+# FIXME:cw If any of srctree, objtree or INSTALL_MINTREE_PATH have
+# spaces in them some parts of this will fail as-is, it shouldn't be
+# that hard to fix (it's not clear if the rest of t kbuild is clean in
+# that respect though)
+
+# This relies on the following environment variables being sane and
+# passed in from the Makefiles:
+#
+# INSTALL_MINTREE_PATH
+# KERNELVERSION
+
+
+# target directory
+tgtdir="${INSTALL_MINTREE_PATH}"/${KERNELVERSION}/
+
+
+# And save the headers/makefiles etc for building modules against
+#
+# This all looks scary, but the end result is supposed to be:
+# * all arch relevant include/ files
+# * all Makefile/Kconfig files
+# * all script/ files
+
+cd "$srctree" || exit $?
+
+mkdir -p ${tgtdir}
+
+# first copy everything. If objtree differs from srctree (ie. O=<...>
+# is used) then make sure we don't copy the Makefile(s) from inside
+# $objtree
+if [ "$srctree" != "$objtree" ] ; then
+ cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*" -not -ipath "$objtree/*Makefile" ) ${tgtdir}
+else
+ cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*") ${tgtdir}
+fi
+
+cp "${objtree}/Module.symvers" ${tgtdir}
+# then drop all but the needed Makefiles/Kconfig files
+#rm -rf ${tgtdir}/Documentation
+rm -rf "${tgtdir}/scripts"
+rm -rf "${tgtdir}/include"
+cp "${objtree}/.config" ${tgtdir}
+cp -a scripts ${tgtdir}
+if [ -d ${srctree}/arch/${ARCH}/scripts ]; then
+ cp -a ${srctree}/arch/${ARCH}/scripts ${tgtdir}/arch/${ARCH} || :
+fi
+if [ -f ${objtree}/arch/${ARCH}/*lds ]; then
+ cp -a ${objtree}/arch/${ARCH}/*lds ${tgtdir}/arch/${ARCH}/ || :
+fi
+rm -f ${tgtdir}/scripts/*.o
+rm -f ${tgtdir}/scripts/*/*.o
+mkdir -p ${tgtdir}/include
+
+cd include
+cp -a acpi keys linux math-emu media mtd net pcmcia rdma rxrpc scsi sound video asm-generic ${tgtdir}/include
+cp -a ${objtree}/include/config ${objtree}/include/asm ${tgtdir}/include
+cp -a $(readlink ${objtree}/include/asm) ${tgtdir}/include
+if [ "$ARCH" = "x86_64" ]; then
+ cp -a asm-i386 ${tgtdir}/include
+fi
+
+# Make sure the Makefile and version.h have a matching timestamp so
+# that external modules can be built
+touch -r ${tgtdir}/Makefile ${tgtdir}/include/linux/version.h
+touch -r ${tgtdir}/.config ${tgtdir}/include/linux/autoconf.h
+# Copy .config to include/config/auto.conf so "make prepare" is
+# unnecessary.
+cp ${tgtdir}/.config ${tgtdir}/include/config/auto.conf


2007-09-13 18:32:53

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

Hi Chris.

On Wed, Sep 12, 2007 at 04:25:34PM -0700, Chris Wedgwood wrote:
> This is a somewhat rough first-pass at making a 'minimal tree'
> installation target. This installs a partial source-tree which you
> can use to build external modules against. It feels pretty unclean
> but I'm not aware of a much better way to do some of this.
>
> This patch works for me, even when using O=<buildtree>. It probably
> needs further cleanups.
>
> Comments?
A few. Please address them and resubmit with full changelog and
proper attribution (if possible) and a signed-of-by.

Sam

>
> -----
> Add a 'mintree-install' makefile target.
I would strongly prefer the name "build-pkg".
The prefix -pkg is just to use the magic in top-level Makefile to
dicert it to the right Makefile.

> Red Hat and other distributions typically have some logic in their
> kernel package build system to create/install 'minimalist source tree'
> which contains enough state to build external modules against but is
> much smaller than the entire build-tree.
>
> This introduces similar logic, the guts of this was taken from a
> Fedora Core spec file and mutilated to make it work for O=<...>
> builds.

I would like to attribute whoever made this somehow.
Dave - do you know?

> diff --git a/Makefile b/Makefile
> index 3067f6a..1246939 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1085,6 +1085,11 @@ package-dir := $(srctree)/scripts/package
> $(Q)$(MAKE) $(build)=$(package-dir) $@
> rpm: include/config/kernel.release FORCE
> $(Q)$(MAKE) $(build)=$(package-dir) $@
> +# /usr/src/linux to match what most distro's do
> +#export INSTALL_MINTREE_PATH ?= /usr/src/linux
> +export INSTALL_MINTREE_PATH ?= /tmp/mt-test/
> +mintree-install: include/config/kernel.release FORCE
> + $(Q)$(MAKE) $(build)=$(package-dir) $@

This becomes obsolete when target is named -pkg

> +# minimal tree installation target
> +# ---------------------------------------------------------------------------
> +mintree-install: FORCE
> + $(MAKE) KBUILD_SRC=

Here we could do a $(MAKE) KBUILD_SRC= clean
This will leave all files needed for building external modules
but delete the rest (almost).

> + $(CONFIG_SHELL) $(srctree)/scripts/package/mintree-install
> +
> # Help text displayed when executing 'make help'
> # ---------------------------------------------------------------------------
> help: FORCE
> @@ -96,4 +102,6 @@ help: FORCE
> @echo ' tar-pkg - Build the kernel as an uncompressed tarball'
> @echo ' targz-pkg - Build the kernel as a gzip compressed tarball'
> @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
> + @echo ' mintree-install - Build the kernel and install a minimal-build-tree'
> + @echo ' that can be used to build external modules against'

This chunk needs to be updated to the new install target.

>
> diff --git a/scripts/package/mintree-install b/scripts/package/mintree-install
> new file mode 100644
> index 0000000..1362cc2
> --- /dev/null
> +++ b/scripts/package/mintree-install
> @@ -0,0 +1,87 @@
> +#!/bin/bash
> +
> +# miniman-tree-install
> +#
> +# This should install necessary the headers, makefiles and
> +# configuration files in a location so that you can use kbuild to
> +# build external (out of tree) modules without needing the entire
> +# kernel build tree.
> +#
> +
> +# This has been shamelessly taken from a Red Hat's spec file,
> +# http://cvs.fedora.redhat.com/viewcvs/devel/kernel/kernel.spec?rev=1.145&view=markup
> +
> +# FIXME:cw Some parts of this are still icky, it's not clear how best
> +# to clean some of this up. Error handling is more or less
> +# non-existent. You could argue that this entire process should be
> +# done differently (ie. using kbuild knowledge instead of a whole lot
> +# of hard-coded magic here).
set -e to bail out on error could do it for now.

> +
> +# FIXME:cw If any of srctree, objtree or INSTALL_MINTREE_PATH have
> +# spaces in them some parts of this will fail as-is, it shouldn't be
> +# that hard to fix (it's not clear if the rest of t kbuild is clean in
> +# that respect though)
kbuild will not like it either so you can drop this FIXME

> +
> +# This relies on the following environment variables being sane and
> +# passed in from the Makefiles:
> +#
> +# INSTALL_MINTREE_PATH
> +# KERNELVERSION
Could we pass this as parameters. This makes it explicit.
You do not need to check them since this script is not
supposed to be used stand-alone.

> +
> +
> +# target directory
> +tgtdir="${INSTALL_MINTREE_PATH}"/${KERNELVERSION}/
> +
> +
> +# And save the headers/makefiles etc for building modules against
> +#
> +# This all looks scary, but the end result is supposed to be:
> +# * all arch relevant include/ files
> +# * all Makefile/Kconfig files
> +# * all script/ files
> +
> +cd "$srctree" || exit $?
> +
> +mkdir -p ${tgtdir}
> +
> +# first copy everything. If objtree differs from srctree (ie. O=<...>
> +# is used) then make sure we don't copy the Makefile(s) from inside
> +# $objtree
> +if [ "$srctree" != "$objtree" ] ; then
> + cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*" -not -ipath "$objtree/*Makefile" ) ${tgtdir}
^
Why this wildcard??? (objtree/>*<Makefile)
Seems to be a typing error.

> +else
> + cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*") ${tgtdir}
> +fi
> +
> +cp "${objtree}/Module.symvers" ${tgtdir}
> +# then drop all but the needed Makefiles/Kconfig files
> +#rm -rf ${tgtdir}/Documentation
Remove this line since it is commented out

> +rm -rf "${tgtdir}/scripts"
> +rm -rf "${tgtdir}/include"
> +cp "${objtree}/.config" ${tgtdir}
> +cp -a scripts ${tgtdir}
> +if [ -d ${srctree}/arch/${ARCH}/scripts ]; then
> + cp -a ${srctree}/arch/${ARCH}/scripts ${tgtdir}/arch/${ARCH} || :
> +fi
> +if [ -f ${objtree}/arch/${ARCH}/*lds ]; then
> + cp -a ${objtree}/arch/${ARCH}/*lds ${tgtdir}/arch/${ARCH}/ || :
> +fi
> +rm -f ${tgtdir}/scripts/*.o
> +rm -f ${tgtdir}/scripts/*/*.o
If we do the make clean this is not needed.

> +mkdir -p ${tgtdir}/include
> +
> +cd include
> +cp -a acpi keys linux math-emu media mtd net pcmcia rdma rxrpc scsi sound video asm-generic ${tgtdir}/include
Something less hardcoded are preferred. Maybe like:
cp -a `ls | grep -v ^asm` asm-generic $(tgtdir}/include

> +cp -a ${objtree}/include/config ${objtree}/include/asm ${tgtdir}/include
> +cp -a $(readlink ${objtree}/include/asm) ${tgtdir}/include
Here we use readlink but in next line we use $ARCH.
We should be consitent and use ARCH all over.

> +if [ "$ARCH" = "x86_64" ]; then
> + cp -a asm-i386 ${tgtdir}/include
> +fi
Too hardcoded.
Here we could use some sed magic to extract a potential ALTARCH from asm-${ARCH}/Kbuild
My sed skills are too limited to do this in a minute... :-(

> +# Make sure the Makefile and version.h have a matching timestamp so
> +# that external modules can be built
> +touch -r ${tgtdir}/Makefile ${tgtdir}/include/linux/version.h
> +touch -r ${tgtdir}/.config ${tgtdir}/include/linux/autoconf.h
> +# Copy .config to include/config/auto.conf so "make prepare" is
> +# unnecessary.
> +cp ${tgtdir}/.config ${tgtdir}/include/config/auto.conf
This part I did not check up on - I assume it is correct.

Sam

2007-09-13 18:39:30

by Robert P. J. Day

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

On Thu, 13 Sep 2007, Sam Ravnborg wrote:

> Hi Chris.
>
> On Wed, Sep 12, 2007 at 04:25:34PM -0700, Chris Wedgwood wrote:
...
> > -----
> > Add a 'mintree-install' makefile target.

> I would strongly prefer the name "build-pkg".

what about "devel-pkg" instead? that would match fedora's
"kernel-devel" naming convention.

rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

2007-09-13 18:58:07

by Chris Wedgwood

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

On Thu, Sep 13, 2007 at 08:34:00PM +0200, Sam Ravnborg wrote:

> A few. Please address them and resubmit with full changelog and
> proper attribution (if possible) and a signed-of-by.

sure

> I would strongly prefer the name "build-pkg".

right

> The prefix -pkg is just to use the magic in top-level Makefile to
> dicert it to the right Makefile.

yeah, i had something a bit like originally but didn't like the name
so changed it and poked the top-level Makefile

> I would like to attribute whoever made this somehow.

so would i, i assume it was davej + others so i cc'd him on this
hoping for feedback

> This becomes obsolete when target is named -pkg

yes

> Here we could do a $(MAKE) KBUILD_SRC= clean
> This will leave all files needed for building external modules
> but delete the rest (almost).

ok, i'll try that

> set -e to bail out on error could do it for now.

will do

> kbuild will not like it either so you can drop this FIXME

ok


> > +# This relies on the following environment variables being sane and
> > +# passed in from the Makefiles:
> > +#
> > +# INSTALL_MINTREE_PATH
> > +# KERNELVERSION

> Could we pass this as parameters. This makes it explicit.
> You do not need to check them since this script is not
> supposed to be used stand-alone.

can do

> > +if [ "$srctree" != "$objtree" ] ; then
> > + cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*" -not -ipath "$objtree/*Makefile" ) ${tgtdir}
> ^
> Why this wildcard??? (objtree/>*<Makefile)
> Seems to be a typing error.

no, it's so we catch things like

linux/build/Makefile

*and*

linux/build/foo/bar/Makefile

> > +#rm -rf ${tgtdir}/Documentation
> Remove this line since it is commented out

right, actually, it can be uncommented but the 'make help' fails; i'm
not sure if we need make help to work since most of the other targets
won't anyhow

so should i remove it (leaving 'make help' as usable) or remove it?

> > +rm -f ${tgtdir}/scripts/*.o
> > +rm -f ${tgtdir}/scripts/*/*.o
> If we do the make clean this is not needed.

ok

> Something less hardcoded are preferred. Maybe like:
> cp -a `ls | grep -v ^asm` asm-generic $(tgtdir}/include

ok (though i'm not a big fan of ls | grep as a rule, it tends to be
fragile when people do dumb things)

> Here we use readlink but in next line we use $ARCH.
> We should be consitent and use ARCH all over.

i tried to preserve as much logic as possible from the original
script, at least initially

i'll change that

> > +if [ "$ARCH" = "x86_64" ]; then
> > + cp -a asm-i386 ${tgtdir}/include
> > +fi
> Too hardcoded.
> Here we could use some sed magic to extract a potential ALTARCH from asm-${ARCH}/Kbuild
> My sed skills are too limited to do this in a minute... :-(

what about something like?

sed -n "s/^ALTARCH[[:space:]]:=[[:space:]]\(.*$\)\+/\1/p"

(i'm sure there is a better way though)

> This part I did not check up on - I assume it is correct.

it all seems to work

2007-09-13 19:18:23

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

Hi Chris.

Thanks for working on this.

> > > +if [ "$srctree" != "$objtree" ] ; then
> > > + cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*" -not -ipath "$objtree/*Makefile" ) ${tgtdir}
> > ^
> > Why this wildcard??? (objtree/>*<Makefile)
> > Seems to be a typing error.
>
> no, it's so we catch things like
>
> linux/build/Makefile
>
> *and*
>
> linux/build/foo/bar/Makefile
Obviously - I missed the find when I looked.
Thanks for the explanation. And no comments needed in the script -
I should just have read the full command line.

>
> > > +#rm -rf ${tgtdir}/Documentation
> > Remove this line since it is commented out
>
> right, actually, it can be uncommented but the 'make help' fails; i'm
> not sure if we need make help to work since most of the other targets
> won't anyhow
>
> so should i remove it (leaving 'make help' as usable) or remove it?
Un-comment it so we do not break make help.

> > Something less hardcoded are preferred. Maybe like:
> > cp -a `ls | grep -v ^asm` asm-generic $(tgtdir}/include
>
> ok (though i'm not a big fan of ls | grep as a rule, it tends to be
> fragile when people do dumb things)

find . -maxdepth 1 -! -name 'asm*'
seems to do the trick and it is better than ls.

>
> sed -n "s/^ALTARCH[[:space:]]:=[[:space:]]\(.*$\)\+/\1/p"
>
> (i'm sure there is a better way though)

Oleg (added to mail) - you are quite confident in sed et al.
Let us know if there is a simpler way.

(We want to pick i386 from include/asm-x86_64/Kbuild
and similar for the architectures that uses ARCHDEF).

Sam

2007-09-13 19:25:57

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

On Thu, Sep 13, 2007 at 02:37:11PM -0400, Robert P. J. Day wrote:
> On Thu, 13 Sep 2007, Sam Ravnborg wrote:
>
> > Hi Chris.
> >
> > On Wed, Sep 12, 2007 at 04:25:34PM -0700, Chris Wedgwood wrote:
> ...
> > > -----
> > > Add a 'mintree-install' makefile target.
>
> > I would strongly prefer the name "build-pkg".
>
> what about "devel-pkg" instead? that would match fedora's
> "kernel-devel" naming convention.

Does
make devel-pkg
in the kernel make you think:
"This is a minimum package to build an external module".

I guess not.

I suggested "build-pkg" from the rationale that this is a package
used when building something.
Any better suggestions within the context of the kernel are galdly
received.

Sam

2007-09-13 20:02:21

by Oleg Verych

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

Hallo.

On Thu, Sep 13, 2007 at 09:19:38PM +0200, Sam Ravnborg wrote:
[]
> >
> > sed -n "s/^ALTARCH[[:space:]]:=[[:space:]]\(.*$\)\+/\1/p"
> >
> > (i'm sure there is a better way though)
>
> Oleg (added to mail) - you are quite confident in sed et al.
> Let us know if there is a simpler way.
>
> (We want to pick i386 from include/asm-x86_64/Kbuild
> and similar for the architectures that uses ARCHDEF).

That particular one-line `ALTARCH := i386' of course can be matched
simpler, because there's only *one* (as written above) whitespace and no
make's assignment variations, like (?=,=). I wonder, if there can be more
options, than i386 and more occurrences of `ALTARCH' actually :) Also,
make can have lead whitespace on line start, as well as near assignment
sign, if that matters.

So, to match *one* line with *one* `ALTARCH' followed by `i386'

sed -n '/ALTARCH/{/i386/{p ; q}}'

is fine by me. If there are dis-assignments, so to speak, or comments
with i386 this will not work obviously. But it's fast and must work
with variety of make syntax. Check is "for non empty output".

Also, please take a look on man isspace(). It matches much more
characters, than necessary for ordinary syntax whitespace. Using
[:blank:] (i.e. tab and space, with no options) is OK. Last thing: i'm not
sure, what that `+' is. I stick to BRE in sed, as it should be, so just
don't know what it does.

Hope that helps.
____

2007-09-13 20:05:23

by Chris Wedgwood

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

On Thu, Sep 13, 2007 at 10:17:27PM +0200, Oleg Verych wrote:

> That particular one-line `ALTARCH := i386' of course can be matched
> simpler, because there's only *one* (as written above) whitespace and no
> make's assignment variations,

The goal is to extract the RHS from ALTARCH := ...

> Also, please take a look on man isspace(). It matches much more
> characters, than necessary for ordinary syntax whitespace.

Good point.


> Using [:blank:] (i.e. tab and space, with no options) is OK. Last
> thing: i'm not sure, what that `+' is. I stick to BRE in sed, as it
> should be, so just don't know what it does.

The \+ was misplaced :-) I typed that very quickly and didn't think to
hard.

2007-09-13 23:27:52

by Dave Jones

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

On Thu, Sep 13, 2007 at 11:57:53AM -0700, Chris Wedgwood wrote:


> > I would like to attribute whoever made this somehow.
>
> so would i, i assume it was davej + others so i cc'd him on this
> hoping for feedback

90%+ of that part of the fedora specfile was Arjan's doings,
myself, dwmw2 and Jarod Wilson have poked at it since then,
but in mostly minor ways.

FWIW, I'd love to see this become a generic upstream target that
I could just use in the Fedora specfile.
The question I have is whether other distros do anything differently
that might be worth taking into consideration?

Dave

--
http://www.codemonkey.org.uk

2007-09-14 09:49:20

by Oleg Verych

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

On Thu, Sep 13, 2007 at 01:05:06PM -0700, Chris Wedgwood wrote:
> On Thu, Sep 13, 2007 at 10:17:27PM +0200, Oleg Verych wrote:
>
> > That particular one-line `ALTARCH := i386' of course can be matched
> > simpler, because there's only *one* (as written above) whitespace and no
> > make's assignment variations,
>
> The goal is to extract the RHS from ALTARCH := ...

printf "C=i386\n ALTARCH = i386
ALTARCH= i386
ALTARCH :=i386
A=i386
ALTARCH := i386
ALTARCH?=i386
" | sed -n '
/^[[:blank:]]*ALTARCH[^?]*=/{
/[[:blank:]:]*=[[:blank:]]*i386[[:blank:]]*$/{
s_.*_i386_;=;p;
}
}'

Maybe this one then, to much as much valid assigments as possible :)
____

2007-09-14 09:59:51

by Tilman Schmidt

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

Sam Ravnborg schrieb:
> On Thu, Sep 13, 2007 at 02:37:11PM -0400, Robert P. J. Day wrote:
>>
>> what about "devel-pkg" instead? that would match fedora's
>> "kernel-devel" naming convention.
>
> Does
> make devel-pkg
> in the kernel make you think:
> "This is a minimum package to build an external module".
>
> I guess not.

From an rpm-based distribution background, it does, actually.
You typically have to install a "xyzzy-devel" package before
you can compile something related to "xyzzy", so it is quite
natural to look for a "kernel-devel" package providing
whatever is necessary to build kernel modules; and
"cd kernel ; make devel-pkg" reads almost literally like
"make kernel-devel.rpm".

--
Tilman Schmidt E-Mail: [email protected]
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Unge?ffnet mindestens haltbar bis: (siehe R?ckseite)


Attachments:
signature.asc (250.00 B)
OpenPGP digital signature

2007-09-14 16:44:23

by Goswin von Brederlow

[permalink] [raw]
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

Chris Wedgwood <[email protected]> writes:

> This is a somewhat rough first-pass at making a 'minimal tree'
> installation target. This installs a partial source-tree which you
> can use to build external modules against. It feels pretty unclean
> but I'm not aware of a much better way to do some of this.
>
> This patch works for me, even when using O=<buildtree>. It probably
> needs further cleanups.
>
> Comments?

Ever looked at the debian packages and how they do it? They even split
out common files and specific files from the kernel build. Saves some
space if you build multiple flavours of the same kernel version.

MfG
Goswin