LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] kbuild: create linux-headers package in deb-pkg
@ 2010-12-24 14:42 Theodore Ts'o
2010-12-25 11:20 ` maximilian attems
0 siblings, 1 reply; 7+ messages in thread
From: Theodore Ts'o @ 2010-12-24 14:42 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-kbuild, linux-kernel, Theodore Ts'o
Create a linux-headers-$KVER.deb package which can be used to build
external modules without having the source tree around.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
scripts/package/builddeb | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 49b74e1..cb5b29d 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -40,15 +40,17 @@ else
fi
tmpdir="$objtree/debian/tmp"
fwdir="$objtree/debian/fwtmp"
+hdrdir="$objtree/debian/hdrtmp"
packagename=linux-image-$version
fwpackagename=linux-firmware-image
+hdrpackagename=linux-headers-$version
if [ "$ARCH" = "um" ] ; then
packagename=user-mode-linux-$version
fi
# Setup the directory structure
-rm -rf "$tmpdir" "$fwdir"
+rm -rf "$tmpdir" "$fwdir" "$hdrdir"
mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename"
mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" "$fwdir/usr/share/doc/$fwpackagename"
if [ "$ARCH" = "um" ] ; then
@@ -188,6 +190,30 @@ EOF
fi
+# Build header package
+find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$
+find arch/x86/include include scripts -type f >> /tmp/files$$
+(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)
+destdir=$hdrdir/usr/src/linux-headers-$version
+mkdir -p "$destdir" "$hdrdir/DEBIAN" "$hdrdir/usr/share/doc/$hdrpackagename"
+tar -c -f - -T /tmp/files$$ | (cd $destdir; tar -xf -)
+(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
+rm -f /tmp/files$$ /tmp/objfiles$$
+arch=$(dpkg --print-architecture)
+
+cat <<EOF >> debian/control
+
+Package: $hdrpackagename
+Provides: linux-headers, linux-headers-2.6
+Architecture: $arch
+Description: Linux kernel headers for $KERNELRELEASE on $arch
+ This package provides kernel header files for $KERNELRELEASE on $arch
+ .
+ This is useful for people who need to build external modules
+EOF
+
+create_package "$hdrpackagename" "$hdrdir"
+
# Do we have firmware? Move it out of the way and build it into a package.
if [ -e "$tmpdir/lib/firmware" ]; then
mv "$tmpdir/lib/firmware" "$fwdir/lib/"
--
1.7.3.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kbuild: create linux-headers package in deb-pkg
2010-12-24 14:42 [PATCH] kbuild: create linux-headers package in deb-pkg Theodore Ts'o
@ 2010-12-25 11:20 ` maximilian attems
2010-12-29 13:07 ` Michal Marek
2011-01-10 17:46 ` maximilian attems
0 siblings, 2 replies; 7+ messages in thread
From: maximilian attems @ 2010-12-25 11:20 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Michal Marek, linux-kbuild, linux-kernel
On Fri, Dec 24, 2010 at 09:42:10AM -0500, Theodore Ts'o wrote:
> Create a linux-headers-$KVER.deb package which can be used to build
> external modules without having the source tree around.
thanks that's great.
fjp had back a year ago asked for a bindeb-pkg once we add more things
to deb-pkg. I had submitted linux-libc-dev built out of deb-pkg
http://marc.info/?l=linux-kbuild&m=125737390700914&w=2
It's an orthogonal issue, but just to clear it up.
--
maks
>
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> ---
> scripts/package/builddeb | 28 +++++++++++++++++++++++++++-
> 1 files changed, 27 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 49b74e1..cb5b29d 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -40,15 +40,17 @@ else
> fi
> tmpdir="$objtree/debian/tmp"
> fwdir="$objtree/debian/fwtmp"
> +hdrdir="$objtree/debian/hdrtmp"
> packagename=linux-image-$version
> fwpackagename=linux-firmware-image
> +hdrpackagename=linux-headers-$version
>
> if [ "$ARCH" = "um" ] ; then
> packagename=user-mode-linux-$version
> fi
>
> # Setup the directory structure
> -rm -rf "$tmpdir" "$fwdir"
> +rm -rf "$tmpdir" "$fwdir" "$hdrdir"
> mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename"
> mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" "$fwdir/usr/share/doc/$fwpackagename"
> if [ "$ARCH" = "um" ] ; then
> @@ -188,6 +190,30 @@ EOF
>
> fi
>
> +# Build header package
> +find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$
> +find arch/x86/include include scripts -type f >> /tmp/files$$
x86 centric?
> +(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)
> +destdir=$hdrdir/usr/src/linux-headers-$version
> +mkdir -p "$destdir" "$hdrdir/DEBIAN" "$hdrdir/usr/share/doc/$hdrpackagename"
could move up to the other mkdir calls.
> +tar -c -f - -T /tmp/files$$ | (cd $destdir; tar -xf -)
> +(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
> +rm -f /tmp/files$$ /tmp/objfiles$$
> +arch=$(dpkg --print-architecture)
> +
> +cat <<EOF >> debian/control
> +
> +Package: $hdrpackagename
> +Provides: linux-headers, linux-headers-2.6
> +Architecture: $arch
not sure if that will interfere with the new crosscompile feature
of deb-pkg in linux-next.
> +Description: Linux kernel headers for $KERNELRELEASE on $arch
> + This package provides kernel header files for $KERNELRELEASE on $arch
> + .
> + This is useful for people who need to build external modules
> +EOF
> +
> +create_package "$hdrpackagename" "$hdrdir"
> +
> # Do we have firmware? Move it out of the way and build it into a package.
> if [ -e "$tmpdir/lib/firmware" ]; then
> mv "$tmpdir/lib/firmware" "$fwdir/lib/"
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kbuild: create linux-headers package in deb-pkg
2010-12-25 11:20 ` maximilian attems
@ 2010-12-29 13:07 ` Michal Marek
2011-01-10 17:46 ` maximilian attems
1 sibling, 0 replies; 7+ messages in thread
From: Michal Marek @ 2010-12-29 13:07 UTC (permalink / raw)
To: maximilian attems; +Cc: Theodore Ts'o, linux-kbuild, linux-kernel
On Sat, Dec 25, 2010 at 11:20:26AM +0000, maximilian attems wrote:
> On Fri, Dec 24, 2010 at 09:42:10AM -0500, Theodore Ts'o wrote:
> > Create a linux-headers-$KVER.deb package which can be used to build
> > external modules without having the source tree around.
Thanks, applied to kbuild-2.6.git#packaging.
> fjp had back a year ago asked for a bindeb-pkg once we add more things
> to deb-pkg. I had submitted linux-libc-dev built out of deb-pkg
> http://marc.info/?l=linux-kbuild&m=125737390700914&w=2
>
> It's an orthogonal issue, but just to clear it up.
Can you repost it? It seems I missed it when I was taking over kbuild
from Sam last year.
Michal
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kbuild: create linux-headers package in deb-pkg
2010-12-25 11:20 ` maximilian attems
2010-12-29 13:07 ` Michal Marek
@ 2011-01-10 17:46 ` maximilian attems
2011-01-13 13:55 ` Michal Marek
1 sibling, 1 reply; 7+ messages in thread
From: maximilian attems @ 2011-01-10 17:46 UTC (permalink / raw)
To: linux-kbuild; +Cc: Michal Marek, Theodore Ts'o, linux-kernel
Seems review went unnoticed, due to using signature.
On Sat, 25 Dec 2010, maximilian attems wrote:
> > +# Build header package
> > +find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$
> > +find arch/x86/include include scripts -type f >> /tmp/files$$
> x86 centric?
this will break on any non x86 arch, what is the correct variable
for $ARCH?
> > +(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)
> > +destdir=$hdrdir/usr/src/linux-headers-$version
> > +mkdir -p "$destdir" "$hdrdir/DEBIAN" "$hdrdir/usr/share/doc/$hdrpackagename"
> could move up to the other mkdir calls.
we did that already.
> > +tar -c -f - -T /tmp/files$$ | (cd $destdir; tar -xf -)
> > +(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
> > +rm -f /tmp/files$$ /tmp/objfiles$$
> > +arch=$(dpkg --print-architecture)
> > +
> > +cat <<EOF >> debian/control
> > +
> > +Package: $hdrpackagename
> > +Provides: linux-headers, linux-headers-2.6
> > +Architecture: $arch
> not sure if that will interfere with the new crosscompile feature
> of deb-pkg in linux-next.
aboves arch call seems redundant with what we already have.
> > +Description: Linux kernel headers for $KERNELRELEASE on $arch
> > + This package provides kernel header files for $KERNELRELEASE on $arch
> > + .
> > + This is useful for people who need to build external modules
> > +EOF
> > +
> > +create_package "$hdrpackagename" "$hdrdir"
> > +
> > # Do we have firmware? Move it out of the way and build it into a package.
> > if [ -e "$tmpdir/lib/firmware" ]; then
> > mv "$tmpdir/lib/firmware" "$fwdir/lib/"
--
maks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kbuild: create linux-headers package in deb-pkg
2011-01-10 17:46 ` maximilian attems
@ 2011-01-13 13:55 ` Michal Marek
2011-01-13 14:38 ` maximilian attems
0 siblings, 1 reply; 7+ messages in thread
From: Michal Marek @ 2011-01-13 13:55 UTC (permalink / raw)
To: maximilian attems
Cc: linux-kbuild, Theodore Ts'o, linux-kernel, Ralf Rösch
On 10.1.2011 18:46, maximilian attems wrote:
> Seems review went unnoticed, due to using signature.
Oh, indeed, I thought that was just full-quote in your email, sorry.
> On Sat, 25 Dec 2010, maximilian attems wrote:
>>> +# Build header package
>>> +find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$
>>> +find arch/x86/include include scripts -type f >> /tmp/files$$
>> x86 centric?
>
> this will break on any non x86 arch, what is the correct variable
> for $ARCH?
This should be changed to arch/$SRCARCH/include.
>>> +(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)
>>> +destdir=$hdrdir/usr/src/linux-headers-$version
>>> +mkdir -p "$destdir" "$hdrdir/DEBIAN" "$hdrdir/usr/share/doc/$hdrpackagename"
>> could move up to the other mkdir calls.
>
> we did that already.
>
>>> +tar -c -f - -T /tmp/files$$ | (cd $destdir; tar -xf -)
>>> +(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
>>> +rm -f /tmp/files$$ /tmp/objfiles$$
>>> +arch=$(dpkg --print-architecture)
>>> +
>>> +cat <<EOF >> debian/control
>>> +
>>> +Package: $hdrpackagename
>>> +Provides: linux-headers, linux-headers-2.6
>>> +Architecture: $arch
>> not sure if that will interfere with the new crosscompile feature
>> of deb-pkg in linux-next.
>
> aboves arch call seems redundant with what we already have.
Yes, please remove it. BTW, here is a bugreport I got privately about
the very same issue:
On 12.1.2011 10:02, Ralf Rösch wrote:
| [...]
| Attached you will find a patch to complete the build successfully for my
| mipsel target.
| The dpkg --print-architecture shows i386 which results in error:
| dpkg-gencontrol: Fehler: aktuelle Host-Architektur »mipsel« erscheint
| nicht in der Architekturliste (i386) des Pakets
| (current host architecture 'mipsel' does not appear in package's list
i386)
| so I changed "arch" temporary to "any".
|
| It would be nice if it would be possible to make the kernel-headers
| installable on any host.
| They are needed very frequently for cross-compiling. (I already possible
| with dpkg force).
Michal
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kbuild: create linux-headers package in deb-pkg
2011-01-13 13:55 ` Michal Marek
@ 2011-01-13 14:38 ` maximilian attems
2011-01-18 19:52 ` Ben Hutchings
0 siblings, 1 reply; 7+ messages in thread
From: maximilian attems @ 2011-01-13 14:38 UTC (permalink / raw)
To: Michal Marek
Cc: linux-kbuild, Theodore Ts'o, linux-kernel, Ralf Rösch,
debian-kernel, Ben Hutchings
On Thu, Jan 13, 2011 at 02:55:26PM +0100, Michal Marek wrote:
> On 10.1.2011 18:46, maximilian attems wrote:
> >>> +find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$
> >>> +find arch/x86/include include scripts -type f >> /tmp/files$$
> >> x86 centric?
> >
> > this will break on any non x86 arch, what is the correct variable
> > for $ARCH?
>
> This should be changed to arch/$SRCARCH/include.
thanks for the pointer, sent patch, that was the easy part.
> >>> +tar -c -f - -T /tmp/files$$ | (cd $destdir; tar -xf -)
> >>> +(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
> >>> +rm -f /tmp/files$$ /tmp/objfiles$$
> >>> +arch=$(dpkg --print-architecture)
> >>> +
> >>> +cat <<EOF >> debian/control
> >>> +
> >>> +Package: $hdrpackagename
> >>> +Provides: linux-headers, linux-headers-2.6
> >>> +Architecture: $arch
> >> not sure if that will interfere with the new crosscompile feature
> >> of deb-pkg in linux-next.
> >
> > aboves arch call seems redundant with what we already have.
>
> Yes, please remove it.
will look at it again in a calmer moment.
> BTW, here is a bugreport I got privately about
> the very same issue:
> On 12.1.2011 10:02, Ralf Rösch wrote:
> | [...]
> | Attached you will find a patch to complete the build successfully for my
> | mipsel target.
> | The dpkg --print-architecture shows i386 which results in error:
> | dpkg-gencontrol: Fehler: aktuelle Host-Architektur »mipsel« erscheint
> | nicht in der Architekturliste (i386) des Pakets
> | (current host architecture 'mipsel' does not appear in package's list
> i386)
> | so I changed "arch" temporary to "any".
> |
> | It would be nice if it would be possible to make the kernel-headers
> | installable on any host.
> | They are needed very frequently for cross-compiling. (I already possible
> | with dpkg force).
Added Ben Hutchings and d-kernel on Cc. I do not use OOT modules, so
I don't have a strong word on that, but from what I see in Debian
they are arch specific.
--
maks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] kbuild: create linux-headers package in deb-pkg
2011-01-13 14:38 ` maximilian attems
@ 2011-01-18 19:52 ` Ben Hutchings
0 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2011-01-18 19:52 UTC (permalink / raw)
To: maximilian attems
Cc: Michal Marek, linux-kbuild, Theodore Ts'o, linux-kernel,
Ralf Rösch, debian-kernel
On Thu, Jan 13, 2011 at 02:38:41PM +0000, maximilian attems wrote:
> On Thu, Jan 13, 2011 at 02:55:26PM +0100, Michal Marek wrote:
[...]
> > BTW, here is a bugreport I got privately about
> > the very same issue:
> > On 12.1.2011 10:02, Ralf Rösch wrote:
> > | [...]
> > | Attached you will find a patch to complete the build successfully for my
> > | mipsel target.
> > | The dpkg --print-architecture shows i386 which results in error:
> > | dpkg-gencontrol: Fehler: aktuelle Host-Architektur »mipsel« erscheint
> > | nicht in der Architekturliste (i386) des Pakets
> > | (current host architecture 'mipsel' does not appear in package's list
> > i386)
> > | so I changed "arch" temporary to "any".
> > |
> > | It would be nice if it would be possible to make the kernel-headers
> > | installable on any host.
> > | They are needed very frequently for cross-compiling. (I already possible
> > | with dpkg force).
>
> Added Ben Hutchings and d-kernel on Cc. I do not use OOT modules, so
> I don't have a strong word on that, but from what I see in Debian
> they are arch specific.
Kernel header packages should be labelled with the target architecture.
This is because the headers include some generated files that are both
architecture- and configuration-specific.
Any package of libraries or headers for some architecture is in theory
useful for cross-development on any other architecture, yet we do not
label them as architecture: all. If we did that, we would then have to
use a different name and installation path for each target so that they
are co-installable; this would also bloat the package list files. You
should normally be able to convert a package for use in cross-
development using dpkg-cross, which changes its name and paths
accordingly. However I don't know how well this will work for kernel
headers.
Ben.
--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-01-18 19:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-24 14:42 [PATCH] kbuild: create linux-headers package in deb-pkg Theodore Ts'o
2010-12-25 11:20 ` maximilian attems
2010-12-29 13:07 ` Michal Marek
2011-01-10 17:46 ` maximilian attems
2011-01-13 13:55 ` Michal Marek
2011-01-13 14:38 ` maximilian attems
2011-01-18 19:52 ` Ben Hutchings
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).