diff options
Diffstat (limited to 'scripts/package')
-rw-r--r-- | scripts/package/Makefile | 19 | ||||
-rw-r--r-- | scripts/package/buildtar | 111 |
2 files changed, 127 insertions, 3 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 3b1f2eff2584..fbb8cf5d4e19 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -80,10 +80,23 @@ deb-pkg: | |||
80 | clean-dirs += $(objtree)/debian/ | 80 | clean-dirs += $(objtree)/debian/ |
81 | 81 | ||
82 | 82 | ||
83 | # tarball targets | ||
84 | # --------------------------------------------------------------------------- | ||
85 | .PHONY: tar%pkg | ||
86 | tar%pkg: | ||
87 | $(MAKE) | ||
88 | $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ | ||
89 | |||
90 | clean-dirs += $(objtree)/tar-install/ | ||
91 | |||
92 | |||
83 | # Help text displayed when executing 'make help' | 93 | # Help text displayed when executing 'make help' |
84 | # --------------------------------------------------------------------------- | 94 | # --------------------------------------------------------------------------- |
85 | help: | 95 | help: |
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 & modules' |
88 | @echo ' deb-pkg - Build the kernel as an deb package' | 98 | @echo ' deb-pkg - Build the kernel as an deb package' |
99 | @echo ' tar-pkg - Build the kernel as an uncompressed tarball' | ||
100 | @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' | ||
101 | @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' | ||
89 | 102 | ||
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 | |||
13 | set -e | ||
14 | |||
15 | # | ||
16 | # Some variables and settings used throughout the script | ||
17 | # | ||
18 | version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}${EXTRANAME}" | ||
19 | tmpdir="${objtree}/tar-install" | ||
20 | tarball="${objtree}/linux-${version}.tar" | ||
21 | |||
22 | |||
23 | # | ||
24 | # Figure out how to compress, if requested at all | ||
25 | # | ||
26 | case "${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 | ;; | ||
43 | esac | ||
44 | |||
45 | |||
46 | # | ||
47 | # Clean-up and re-create the temporary directory | ||
48 | # | ||
49 | rm -rf -- "${tmpdir}" | ||
50 | mkdir -p -- "${tmpdir}/boot" | ||
51 | |||
52 | |||
53 | # | ||
54 | # Try to install modules | ||
55 | # | ||
56 | if ! 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 | ||
62 | fi | ||
63 | |||
64 | |||
65 | # | ||
66 | # Install basic kernel files | ||
67 | # | ||
68 | cp -v -- System.map "${tmpdir}/boot/System.map-${version}" | ||
69 | cp -v -- .config "${tmpdir}/boot/config-${version}" | ||
70 | cp -v -- vmlinux "${tmpdir}/boot/vmlinux-${version}" | ||
71 | |||
72 | |||
73 | # | ||
74 | # Install arch-specific kernel image(s) | ||
75 | # | ||
76 | case "${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 | ;; | ||
97 | esac | ||
98 | |||
99 | |||
100 | # | ||
101 | # Create the tarball | ||
102 | # | ||
103 | ( | ||
104 | cd "${tmpdir}" | ||
105 | tar cf - . | ${compress} > "${tarball}${file_ext}" | ||
106 | ) | ||
107 | |||
108 | echo "Tarball successfully created in ${tarball}${file_ext}" | ||
109 | |||
110 | exit 0 | ||
111 | |||