aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /scripts/package
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'scripts/package')
-rw-r--r--scripts/package/Makefile9
-rw-r--r--scripts/package/builddeb97
-rw-r--r--scripts/package/buildtar6
-rwxr-xr-xscripts/package/mkspec21
4 files changed, 122 insertions, 11 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index d0b931b994fc..006960ebbce9 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -26,9 +26,9 @@ RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
26 else echo rpm; fi) 26 else echo rpm; fi)
27 27
28# Remove hyphens since they have special meaning in RPM filenames 28# Remove hyphens since they have special meaning in RPM filenames
29KERNELPATH := kernel-$(subst -,,$(KERNELRELEASE)) 29KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
30MKSPEC := $(srctree)/scripts/package/mkspec 30MKSPEC := $(srctree)/scripts/package/mkspec
31PREV := set -e; cd ..; 31PREV := set -e; cd -P ..;
32 32
33# rpm-pkg 33# rpm-pkg
34# --------------------------------------------------------------------------- 34# ---------------------------------------------------------------------------
@@ -127,7 +127,8 @@ rm -r $(perf-tar); \
127$(if $(findstring tar-src,$@),, \ 127$(if $(findstring tar-src,$@),, \
128$(if $(findstring bz2,$@),bzip2, \ 128$(if $(findstring bz2,$@),bzip2, \
129$(if $(findstring gz,$@),gzip, \ 129$(if $(findstring gz,$@),gzip, \
130$(error unknown target $@))) \ 130$(if $(findstring xz,$@),xz, \
131$(error unknown target $@)))) \
131 -f -9 $(perf-tar).tar) 132 -f -9 $(perf-tar).tar)
132 133
133perf-%pkg: FORCE 134perf-%pkg: FORCE
@@ -142,7 +143,9 @@ help: FORCE
142 @echo ' tar-pkg - Build the kernel as an uncompressed tarball' 143 @echo ' tar-pkg - Build the kernel as an uncompressed tarball'
143 @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' 144 @echo ' targz-pkg - Build the kernel as a gzip compressed tarball'
144 @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' 145 @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
146 @echo ' tarxz-pkg - Build the kernel as a xz compressed tarball'
145 @echo ' perf-tar-src-pkg - Build $(perf-tar).tar source tarball' 147 @echo ' perf-tar-src-pkg - Build $(perf-tar).tar source tarball'
146 @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball' 148 @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball'
147 @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball' 149 @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball'
150 @echo ' perf-tarxz-src-pkg - Build $(perf-tar).tar.xz source tarball'
148 151
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 5f1e2fc7f171..f6cbc3ddb68b 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -25,8 +25,44 @@ create_package() {
25 chown -R root:root "$pdir" 25 chown -R root:root "$pdir"
26 chmod -R go-w "$pdir" 26 chmod -R go-w "$pdir"
27 27
28 # Attempt to find the correct Debian architecture
29 local forcearch="" debarch=""
30 case "$UTS_MACHINE" in
31 i386|ia64|alpha)
32 debarch="$UTS_MACHINE" ;;
33 x86_64)
34 debarch=amd64 ;;
35 sparc*)
36 debarch=sparc ;;
37 s390*)
38 debarch=s390 ;;
39 ppc*)
40 debarch=powerpc ;;
41 parisc*)
42 debarch=hppa ;;
43 mips*)
44 debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;;
45 arm*)
46 debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;;
47 *)
48 echo "" >&2
49 echo "** ** ** WARNING ** ** **" >&2
50 echo "" >&2
51 echo "Your architecture doesn't have it's equivalent" >&2
52 echo "Debian userspace architecture defined!" >&2
53 echo "Falling back to using your current userspace instead!" >&2
54 echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
55 echo "" >&2
56 esac
57 if [ -n "$KBUILD_DEBARCH" ] ; then
58 debarch="$KBUILD_DEBARCH"
59 fi
60 if [ -n "$debarch" ] ; then
61 forcearch="-DArchitecture=$debarch"
62 fi
63
28 # Create the package 64 # Create the package
29 dpkg-gencontrol -isp -p$pname -P"$pdir" 65 dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir"
30 dpkg --build "$pdir" .. 66 dpkg --build "$pdir" ..
31} 67}
32 68
@@ -40,17 +76,27 @@ else
40fi 76fi
41tmpdir="$objtree/debian/tmp" 77tmpdir="$objtree/debian/tmp"
42fwdir="$objtree/debian/fwtmp" 78fwdir="$objtree/debian/fwtmp"
79kernel_headers_dir="$objtree/debian/hdrtmp"
80libc_headers_dir="$objtree/debian/headertmp"
43packagename=linux-image-$version 81packagename=linux-image-$version
44fwpackagename=linux-firmware-image 82fwpackagename=linux-firmware-image
83kernel_headers_packagename=linux-headers-$version
84libc_headers_packagename=linux-libc-dev
45 85
46if [ "$ARCH" = "um" ] ; then 86if [ "$ARCH" = "um" ] ; then
47 packagename=user-mode-linux-$version 87 packagename=user-mode-linux-$version
48fi 88fi
49 89
50# Setup the directory structure 90# Setup the directory structure
51rm -rf "$tmpdir" "$fwdir" 91rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir"
52mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename" 92mkdir -m 755 -p "$tmpdir/DEBIAN"
53mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" "$fwdir/usr/share/doc/$fwpackagename" 93mkdir -p "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename"
94mkdir -m 755 -p "$fwdir/DEBIAN"
95mkdir -p "$fwdir/lib" "$fwdir/usr/share/doc/$fwpackagename"
96mkdir -m 755 -p "$libc_headers_dir/DEBIAN"
97mkdir -p "$libc_headers_dir/usr/share/doc/$libc_headers_packagename"
98mkdir -m 755 -p "$kernel_headers_dir/DEBIAN"
99mkdir -p "$kernel_headers_dir/usr/share/doc/$kernel_headers_packagename"
54if [ "$ARCH" = "um" ] ; then 100if [ "$ARCH" = "um" ] ; then
55 mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" 101 mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin"
56fi 102fi
@@ -66,7 +112,9 @@ else
66 cp System.map "$tmpdir/boot/System.map-$version" 112 cp System.map "$tmpdir/boot/System.map-$version"
67 cp .config "$tmpdir/boot/config-$version" 113 cp .config "$tmpdir/boot/config-$version"
68 # Not all arches include the boot path in KBUILD_IMAGE 114 # Not all arches include the boot path in KBUILD_IMAGE
69 if ! cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"; then 115 if [ -e $KBUILD_IMAGE ]; then
116 cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
117 else
70 cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" 118 cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
71 fi 119 fi
72fi 120fi
@@ -79,6 +127,9 @@ if grep -q '^CONFIG_MODULES=y' .config ; then
79 fi 127 fi
80fi 128fi
81 129
130make headers_check
131make headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr"
132
82# Install the maintainer scripts 133# Install the maintainer scripts
83# Note: hook scripts under /etc/kernel are also executed by official Debian 134# Note: hook scripts under /etc/kernel are also executed by official Debian
84# kernel packages, as well as kernel packages built using make-kpkg 135# kernel packages, as well as kernel packages built using make-kpkg
@@ -186,6 +237,30 @@ EOF
186 237
187fi 238fi
188 239
240# Build header package
241(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$)
242(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> /tmp/files$$)
243(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)
244destdir=$kernel_headers_dir/usr/src/linux-headers-$version
245mkdir -p "$destdir"
246(cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
247(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
248rm -f /tmp/files$$ /tmp/objfiles$$
249arch=$(dpkg --print-architecture)
250
251cat <<EOF >> debian/control
252
253Package: $kernel_headers_packagename
254Provides: linux-headers, linux-headers-2.6
255Architecture: $arch
256Description: Linux kernel headers for $KERNELRELEASE on $arch
257 This package provides kernel header files for $KERNELRELEASE on $arch
258 .
259 This is useful for people who need to build external modules
260EOF
261
262create_package "$kernel_headers_packagename" "$kernel_headers_dir"
263
189# Do we have firmware? Move it out of the way and build it into a package. 264# Do we have firmware? Move it out of the way and build it into a package.
190if [ -e "$tmpdir/lib/firmware" ]; then 265if [ -e "$tmpdir/lib/firmware" ]; then
191 mv "$tmpdir/lib/firmware" "$fwdir/lib/" 266 mv "$tmpdir/lib/firmware" "$fwdir/lib/"
@@ -201,6 +276,18 @@ EOF
201 create_package "$fwpackagename" "$fwdir" 276 create_package "$fwpackagename" "$fwdir"
202fi 277fi
203 278
279cat <<EOF >> debian/control
280
281Package: $libc_headers_packagename
282Section: devel
283Provides: linux-kernel-headers
284Architecture: any
285Description: Linux support headers for userspace development
286 This package provides userspaces headers from the Linux kernel. These headers
287 are used by the installed headers for GNU glibc and other system libraries.
288EOF
289
290create_package "$libc_headers_packagename" "$libc_headers_dir"
204create_package "$packagename" "$tmpdir" 291create_package "$packagename" "$tmpdir"
205 292
206exit 0 293exit 0
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index 51b2aa0acb82..8a7b15598ea9 100644
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -35,6 +35,10 @@ case "${1}" in
35 compress="bzip2 -c9" 35 compress="bzip2 -c9"
36 file_ext=".bz2" 36 file_ext=".bz2"
37 ;; 37 ;;
38 tarxz-pkg)
39 compress="xz -c9"
40 file_ext=".xz"
41 ;;
38 *) 42 *)
39 echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&2 43 echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&2
40 exit 1 44 exit 1
@@ -88,7 +92,7 @@ case "${ARCH}" in
88 echo "" >&2 92 echo "" >&2
89 echo '** ** ** WARNING ** ** **' >&2 93 echo '** ** ** WARNING ** ** **' >&2
90 echo "" >&2 94 echo "" >&2
91 echo "Your architecture did not define any architecture-dependant files" >&2 95 echo "Your architecture did not define any architecture-dependent files" >&2
92 echo "to be placed into the tarball. Please add those to ${0} ..." >&2 96 echo "to be placed into the tarball. Please add those to ${0} ..." >&2
93 echo "" >&2 97 echo "" >&2
94 sleep 5 98 sleep 5
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 15440f55aef6..4bf17ddf7c7f 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -22,7 +22,7 @@ if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then
22fi 22fi
23 23
24PROVIDES="$PROVIDES kernel-$KERNELRELEASE" 24PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
25__KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-//g"` 25__KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-/_/g"`
26 26
27echo "Name: kernel" 27echo "Name: kernel"
28echo "Summary: The Linux Kernel" 28echo "Summary: The Linux Kernel"
@@ -47,6 +47,18 @@ echo ""
47echo "%description" 47echo "%description"
48echo "The Linux Kernel, the operating system core itself" 48echo "The Linux Kernel, the operating system core itself"
49echo "" 49echo ""
50echo "%package headers"
51echo "Summary: Header files for the Linux kernel for use by glibc"
52echo "Group: Development/System"
53echo "Obsoletes: kernel-headers"
54echo "Provides: kernel-headers = %{version}"
55echo "%description headers"
56echo "Kernel-headers includes the C header files that specify the interface"
57echo "between the Linux kernel and userspace libraries and programs. The"
58echo "header files define structures and constants that are needed for"
59echo "building most standard programs and are also needed for rebuilding the"
60echo "glibc package."
61echo ""
50 62
51if ! $PREBUILT; then 63if ! $PREBUILT; then
52echo "%prep" 64echo "%prep"
@@ -70,7 +82,7 @@ echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules'
70echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' 82echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'
71echo "%endif" 83echo "%endif"
72 84
73echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} KBUILD_SRC= modules_install' 85echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{?_smp_mflags} KBUILD_SRC= modules_install'
74echo "%ifarch ia64" 86echo "%ifarch ia64"
75echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz-$KERNELRELEASE" 87echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz-$KERNELRELEASE"
76echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/" 88echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/"
@@ -83,6 +95,7 @@ echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
83echo "%endif" 95echo "%endif"
84echo "%endif" 96echo "%endif"
85 97
98echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install'
86echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE" 99echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
87 100
88echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE" 101echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
@@ -105,3 +118,7 @@ echo "/lib/modules/$KERNELRELEASE"
105echo "/lib/firmware" 118echo "/lib/firmware"
106echo "/boot/*" 119echo "/boot/*"
107echo "" 120echo ""
121echo "%files headers"
122echo '%defattr (-, root, root)'
123echo "/usr/include"
124echo ""