diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-12-24 09:42:10 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-12-29 07:54:49 -0500 |
commit | cd8d60a20a4516016c117ac0f1ac7b06ff606f7e (patch) | |
tree | b9a898f3044d33b0b70d945970e153e00c80c054 /scripts/package | |
parent | 55f88eccf9c288eed2f93f9ca7d7fe4dd2da762e (diff) |
kbuild: create linux-headers package in deb-pkg
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>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/package')
-rw-r--r-- | scripts/package/builddeb | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index ffe24194b763..5fc1e6f71838 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
@@ -76,15 +76,17 @@ else | |||
76 | fi | 76 | fi |
77 | tmpdir="$objtree/debian/tmp" | 77 | tmpdir="$objtree/debian/tmp" |
78 | fwdir="$objtree/debian/fwtmp" | 78 | fwdir="$objtree/debian/fwtmp" |
79 | hdrdir="$objtree/debian/hdrtmp" | ||
79 | packagename=linux-image-$version | 80 | packagename=linux-image-$version |
80 | fwpackagename=linux-firmware-image | 81 | fwpackagename=linux-firmware-image |
82 | hdrpackagename=linux-headers-$version | ||
81 | 83 | ||
82 | if [ "$ARCH" = "um" ] ; then | 84 | if [ "$ARCH" = "um" ] ; then |
83 | packagename=user-mode-linux-$version | 85 | packagename=user-mode-linux-$version |
84 | fi | 86 | fi |
85 | 87 | ||
86 | # Setup the directory structure | 88 | # Setup the directory structure |
87 | rm -rf "$tmpdir" "$fwdir" | 89 | rm -rf "$tmpdir" "$fwdir" "$hdrdir" |
88 | mkdir -m 755 -p "$tmpdir/DEBIAN" | 90 | mkdir -m 755 -p "$tmpdir/DEBIAN" |
89 | mkdir -p "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename" | 91 | mkdir -p "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename" |
90 | mkdir -m 755 -p "$fwdir/DEBIAN" | 92 | mkdir -m 755 -p "$fwdir/DEBIAN" |
@@ -226,6 +228,30 @@ EOF | |||
226 | 228 | ||
227 | fi | 229 | fi |
228 | 230 | ||
231 | # Build header package | ||
232 | find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$ | ||
233 | find arch/x86/include include scripts -type f >> /tmp/files$$ | ||
234 | (cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$) | ||
235 | destdir=$hdrdir/usr/src/linux-headers-$version | ||
236 | mkdir -p "$destdir" "$hdrdir/DEBIAN" "$hdrdir/usr/share/doc/$hdrpackagename" | ||
237 | tar -c -f - -T /tmp/files$$ | (cd $destdir; tar -xf -) | ||
238 | (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -) | ||
239 | rm -f /tmp/files$$ /tmp/objfiles$$ | ||
240 | arch=$(dpkg --print-architecture) | ||
241 | |||
242 | cat <<EOF >> debian/control | ||
243 | |||
244 | Package: $hdrpackagename | ||
245 | Provides: linux-headers, linux-headers-2.6 | ||
246 | Architecture: $arch | ||
247 | Description: Linux kernel headers for $KERNELRELEASE on $arch | ||
248 | This package provides kernel header files for $KERNELRELEASE on $arch | ||
249 | . | ||
250 | This is useful for people who need to build external modules | ||
251 | EOF | ||
252 | |||
253 | create_package "$hdrpackagename" "$hdrdir" | ||
254 | |||
229 | # Do we have firmware? Move it out of the way and build it into a package. | 255 | # Do we have firmware? Move it out of the way and build it into a package. |
230 | if [ -e "$tmpdir/lib/firmware" ]; then | 256 | if [ -e "$tmpdir/lib/firmware" ]; then |
231 | mv "$tmpdir/lib/firmware" "$fwdir/lib/" | 257 | mv "$tmpdir/lib/firmware" "$fwdir/lib/" |