aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/package')
-rw-r--r--scripts/package/Makefile24
-rw-r--r--scripts/package/builddeb56
-rw-r--r--scripts/package/buildtar111
-rwxr-xr-xscripts/package/mkspec9
4 files changed, 189 insertions, 11 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 3b1f2eff2584..f3e7e8e4a500 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -59,7 +59,7 @@ $(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile
59 $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@ 59 $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@
60 60
61binrpm-pkg: $(objtree)/binkernel.spec 61binrpm-pkg: $(objtree)/binkernel.spec
62 $(MAKE) 62 $(MAKE) KBUILD_SRC=
63 set -e; \ 63 set -e; \
64 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version 64 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
65 set -e; \ 65 set -e; \
@@ -74,16 +74,30 @@ clean-files += $(objtree)/binkernel.spec
74# 74#
75.PHONY: deb-pkg 75.PHONY: deb-pkg
76deb-pkg: 76deb-pkg:
77 $(MAKE) 77 $(MAKE) KBUILD_SRC=
78 $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb 78 $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
79 79
80clean-dirs += $(objtree)/debian/ 80clean-dirs += $(objtree)/debian/
81 81
82 82
83# tarball targets
84# ---------------------------------------------------------------------------
85.PHONY: tar%pkg
86tar%pkg:
87 $(MAKE)
88 $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
89
90clean-dirs += $(objtree)/tar-install/
91
92
83# Help text displayed when executing 'make help' 93# Help text displayed when executing 'make help'
84# --------------------------------------------------------------------------- 94# ---------------------------------------------------------------------------
85help: 95help:
86 @echo ' rpm-pkg - Build the kernel as an RPM package' 96 @echo ' rpm-pkg - Build the kernel as an RPM package'
87 @echo ' binrpm-pkg - Build an rpm package containing the compiled kernel & modules' 97 @echo ' binrpm-pkg - Build an rpm package containing the compiled kernel'
88 @echo ' deb-pkg - Build the kernel as an deb package' 98 @echo ' and modules'
99 @echo ' deb-pkg - Build the kernel as an deb package'
100 @echo ' tar-pkg - Build the kernel as an uncompressed tarball'
101 @echo ' targz-pkg - Build the kernel as a gzip compressed tarball'
102 @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
89 103
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index c279b6310f02..6edb29f2b4a6 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -14,18 +14,38 @@ set -e
14# Some variables and settings used throughout the script 14# Some variables and settings used throughout the script
15version=$KERNELRELEASE 15version=$KERNELRELEASE
16tmpdir="$objtree/debian/tmp" 16tmpdir="$objtree/debian/tmp"
17packagename=linux-$version
18
19if [ "$ARCH" == "um" ] ; then
20 packagename=user-mode-linux-$version
21fi
17 22
18# Setup the directory structure 23# Setup the directory structure
19rm -rf "$tmpdir" 24rm -rf "$tmpdir"
20mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" 25mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot"
26if [ "$ARCH" == "um" ] ; then
27 mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin"
28fi
21 29
22# Build and install the kernel 30# Build and install the kernel
23cp System.map "$tmpdir/boot/System.map-$version" 31if [ "$ARCH" == "um" ] ; then
24cp .config "$tmpdir/boot/config-$version" 32 $MAKE linux
25cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" 33 cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
34 cp .config "$tmpdir/usr/share/doc/$packagename/config"
35 gzip "$tmpdir/usr/share/doc/$packagename/config"
36 cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version"
37else
38 cp System.map "$tmpdir/boot/System.map-$version"
39 cp .config "$tmpdir/boot/config-$version"
40 cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
41fi
26 42
27if grep -q '^CONFIG_MODULES=y' .config ; then 43if grep -q '^CONFIG_MODULES=y' .config ; then
28 INSTALL_MOD_PATH="$tmpdir" make modules_install 44 INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install
45 if [ "$ARCH" == "um" ] ; then
46 mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"
47 rmdir "$tmpdir/lib/modules/$version"
48 fi
29fi 49fi
30 50
31# Install the maintainer scripts 51# Install the maintainer scripts
@@ -53,6 +73,8 @@ linux ($version) unstable; urgency=low
53EOF 73EOF
54 74
55# Generate a control file 75# Generate a control file
76if [ "$ARCH" == "um" ]; then
77
56cat <<EOF > debian/control 78cat <<EOF > debian/control
57Source: linux 79Source: linux
58Section: base 80Section: base
@@ -60,12 +82,34 @@ Priority: optional
60Maintainer: $name 82Maintainer: $name
61Standards-Version: 3.6.1 83Standards-Version: 3.6.1
62 84
63Package: linux-$version 85Package: $packagename
86Architecture: any
87Description: User Mode Linux kernel, version $version
88 User-mode Linux is a port of the Linux kernel to its own system call
89 interface. It provides a kind of virtual machine, which runs Linux
90 as a user process under another Linux kernel. This is useful for
91 kernel development, sandboxes, jails, experimentation, and
92 many other things.
93 .
94 This package contains the Linux kernel, modules and corresponding other
95 files version $version
96EOF
97
98else
99cat <<EOF > debian/control
100Source: linux
101Section: base
102Priority: optional
103Maintainer: $name
104Standards-Version: 3.6.1
105
106Package: $packagename
64Architecture: any 107Architecture: any
65Description: Linux kernel, version $version 108Description: Linux kernel, version $version
66 This package contains the Linux kernel, modules and corresponding other 109 This package contains the Linux kernel, modules and corresponding other
67 files version $version. 110 files version $version
68EOF 111EOF
112fi
69 113
70# Fix some ownership and permissions 114# Fix some ownership and permissions
71chown -R root:root "$tmpdir" 115chown -R root:root "$tmpdir"
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
new file mode 100644
index 000000000000..d8fffe6f8906
--- /dev/null
+++ b/scripts/package/buildtar
@@ -0,0 +1,111 @@
1#!/bin/sh
2
3#
4# buildtar 0.0.3
5#
6# (C) 2004-2005 by Jan-Benedict Glaw <jbglaw@lug-owl.de>
7#
8# This script is used to compile a tarball from the currently
9# prepared kernel. Based upon the builddeb script from
10# Wichert Akkerman <wichert@wiggy.net>.
11#
12
13set -e
14
15#
16# Some variables and settings used throughout the script
17#
18version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}${EXTRANAME}"
19tmpdir="${objtree}/tar-install"
20tarball="${objtree}/linux-${version}.tar"
21
22
23#
24# Figure out how to compress, if requested at all
25#
26case "${1}" in
27 tar-pkg)
28 compress="cat"
29 file_ext=""
30 ;;
31 targz-pkg)
32 compress="gzip -c9"
33 file_ext=".gz"
34 ;;
35 tarbz2-pkg)
36 compress="bzip2 -c9"
37 file_ext=".bz2"
38 ;;
39 *)
40 echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&2
41 exit 1
42 ;;
43esac
44
45
46#
47# Clean-up and re-create the temporary directory
48#
49rm -rf -- "${tmpdir}"
50mkdir -p -- "${tmpdir}/boot"
51
52
53#
54# Try to install modules
55#
56if ! make INSTALL_MOD_PATH="${tmpdir}" modules_install; then
57 echo "" >&2
58 echo "Ignoring error at module_install time, since that could be" >&2
59 echo "a result of missing local modutils/module-init-tools," >&2
60 echo "or you just didn't compile in module support at all..." >&2
61 echo "" >&2
62fi
63
64
65#
66# Install basic kernel files
67#
68cp -v -- System.map "${tmpdir}/boot/System.map-${version}"
69cp -v -- .config "${tmpdir}/boot/config-${version}"
70cp -v -- vmlinux "${tmpdir}/boot/vmlinux-${version}"
71
72
73#
74# Install arch-specific kernel image(s)
75#
76case "${ARCH}" in
77 i386)
78 [ -f arch/i386/boot/bzImage ] && cp -v -- arch/i386/boot/bzImage "${tmpdir}/boot/vmlinuz-${version}"
79 ;;
80 alpha)
81 [ -f arch/alpha/boot/vmlinux.gz ] && cp -v -- arch/alpha/boot/vmlinux.gz "${tmpdir}/boot/vmlinuz-${version}"
82 ;;
83 vax)
84 [ -f vmlinux.SYS ] && cp -v -- vmlinux.SYS "${tmpdir}/boot/vmlinux-${version}.SYS"
85 [ -f vmlinux.dsk ] && cp -v -- vmlinux.dsk "${tmpdir}/boot/vmlinux-${version}.dsk"
86 ;;
87 *)
88 [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${version}"
89 echo "" >&2
90 echo '** ** ** WARNING ** ** **' >&2
91 echo "" >&2
92 echo "Your architecture did not define any architecture-dependant files" >&2
93 echo "to be placed into the tarball. Please add those to ${0} ..." >&2
94 echo "" >&2
95 sleep 5
96 ;;
97esac
98
99
100#
101# Create the tarball
102#
103(
104 cd "${tmpdir}"
105 tar cf - . | ${compress} > "${tarball}${file_ext}"
106)
107
108echo "Tarball successfully created in ${tarball}${file_ext}"
109
110exit 0
111
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 6e7a58f145ad..0b1038737548 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -62,10 +62,19 @@ echo ""
62fi 62fi
63 63
64echo "%install" 64echo "%install"
65echo "%ifarch ia64"
66echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
67echo "%else"
65echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules' 68echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
69echo "%endif"
66 70
67echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' 71echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install'
72echo "%ifarch ia64"
73echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz-$KERNELRELEASE"
74echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/"
75echo "%else"
68echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE" 76echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
77echo "%endif"
69 78
70echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE" 79echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
71 80