diff options
author | Jan-Benedict Glaw <jbglaw@lug-owl.de> | 2006-01-01 08:23:47 -0500 |
---|---|---|
committer | <sam@mars.ravnborg.org> | 2006-01-01 13:31:30 -0500 |
commit | 6073aa643f52fd12b02f0532dc96287f4c3293b5 (patch) | |
tree | 272fc07333289b0a788996dcd2034b80d1693178 /scripts | |
parent | 752625cff3eba81cbc886988d5b420064c033948 (diff) |
kbuild: tar-pkg with out-out-tree building
Fix out-of-tree builds for the tar-pkg targets
When I wrote the buildtar script, I didn't even think about
out-of-tree builds because I didn't use these back then. This patch
throughoutly uses ${objtree} instead of `pwd`.
Also, the kernel version is no longer manually built. Instead, it will
properly use $KERNELRELEASE . Installing modules is only done if
CONFIG_MODULES is set.
Signed-off-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/package/Makefile | 2 | ||||
-rw-r--r-- | scripts/package/buildtar | 31 |
2 files changed, 14 insertions, 19 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index f3e7e8e4a500..c201ef001f09 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -84,7 +84,7 @@ clean-dirs += $(objtree)/debian/ | |||
84 | # --------------------------------------------------------------------------- | 84 | # --------------------------------------------------------------------------- |
85 | .PHONY: tar%pkg | 85 | .PHONY: tar%pkg |
86 | tar%pkg: | 86 | tar%pkg: |
87 | $(MAKE) | 87 | $(MAKE) KBUILD_SRC= |
88 | $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ | 88 | $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ |
89 | 89 | ||
90 | clean-dirs += $(objtree)/tar-install/ | 90 | clean-dirs += $(objtree)/tar-install/ |
diff --git a/scripts/package/buildtar b/scripts/package/buildtar index d8fffe6f8906..88b5281ac41e 100644 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar | |||
@@ -1,9 +1,9 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # | 3 | # |
4 | # buildtar 0.0.3 | 4 | # buildtar 0.0.4 |
5 | # | 5 | # |
6 | # (C) 2004-2005 by Jan-Benedict Glaw <jbglaw@lug-owl.de> | 6 | # (C) 2004-2006 by Jan-Benedict Glaw <jbglaw@lug-owl.de> |
7 | # | 7 | # |
8 | # This script is used to compile a tarball from the currently | 8 | # This script is used to compile a tarball from the currently |
9 | # prepared kernel. Based upon the builddeb script from | 9 | # prepared kernel. Based upon the builddeb script from |
@@ -15,9 +15,8 @@ set -e | |||
15 | # | 15 | # |
16 | # Some variables and settings used throughout the script | 16 | # Some variables and settings used throughout the script |
17 | # | 17 | # |
18 | version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}${EXTRANAME}" | ||
19 | tmpdir="${objtree}/tar-install" | 18 | tmpdir="${objtree}/tar-install" |
20 | tarball="${objtree}/linux-${version}.tar" | 19 | tarball="${objtree}/linux-${KERNELRELEASE}.tar" |
21 | 20 | ||
22 | 21 | ||
23 | # | 22 | # |
@@ -53,21 +52,17 @@ mkdir -p -- "${tmpdir}/boot" | |||
53 | # | 52 | # |
54 | # Try to install modules | 53 | # Try to install modules |
55 | # | 54 | # |
56 | if ! make INSTALL_MOD_PATH="${tmpdir}" modules_install; then | 55 | if grep -q '^CONFIG_MODULES=y' "${objtree}/.config"; then |
57 | echo "" >&2 | 56 | make ARCH="${ARCH}" O="${objtree}" KBUILD_SRC= INSTALL_MOD_PATH="${tmpdir}" modules_install |
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 | 57 | fi |
63 | 58 | ||
64 | 59 | ||
65 | # | 60 | # |
66 | # Install basic kernel files | 61 | # Install basic kernel files |
67 | # | 62 | # |
68 | cp -v -- System.map "${tmpdir}/boot/System.map-${version}" | 63 | cp -v -- "${objtree}/System.map" "${tmpdir}/boot/System.map-${KERNELRELEASE}" |
69 | cp -v -- .config "${tmpdir}/boot/config-${version}" | 64 | cp -v -- "${objtree}/.config" "${tmpdir}/boot/config-${KERNELRELEASE}" |
70 | cp -v -- vmlinux "${tmpdir}/boot/vmlinux-${version}" | 65 | cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
71 | 66 | ||
72 | 67 | ||
73 | # | 68 | # |
@@ -75,17 +70,17 @@ cp -v -- vmlinux "${tmpdir}/boot/vmlinux-${version}" | |||
75 | # | 70 | # |
76 | case "${ARCH}" in | 71 | case "${ARCH}" in |
77 | i386) | 72 | i386) |
78 | [ -f arch/i386/boot/bzImage ] && cp -v -- arch/i386/boot/bzImage "${tmpdir}/boot/vmlinuz-${version}" | 73 | [ -f "${objtree}/arch/i386/boot/bzImage" ] && cp -v -- "${objtree}/arch/i386/boot/bzImage" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
79 | ;; | 74 | ;; |
80 | alpha) | 75 | alpha) |
81 | [ -f arch/alpha/boot/vmlinux.gz ] && cp -v -- arch/alpha/boot/vmlinux.gz "${tmpdir}/boot/vmlinuz-${version}" | 76 | [ -f "${objtree}/arch/alpha/boot/vmlinux.gz" ] && cp -v -- "${objtree}/arch/alpha/boot/vmlinux.gz" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
82 | ;; | 77 | ;; |
83 | vax) | 78 | vax) |
84 | [ -f vmlinux.SYS ] && cp -v -- vmlinux.SYS "${tmpdir}/boot/vmlinux-${version}.SYS" | 79 | [ -f "${objtree}/vmlinux.SYS" ] && cp -v -- "${objtree}/vmlinux.SYS" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.SYS" |
85 | [ -f vmlinux.dsk ] && cp -v -- vmlinux.dsk "${tmpdir}/boot/vmlinux-${version}.dsk" | 80 | [ -f "${objtree}/vmlinux.dsk" ] && cp -v -- "${objtree}/vmlinux.dsk" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.dsk" |
86 | ;; | 81 | ;; |
87 | *) | 82 | *) |
88 | [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${version}" | 83 | [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${KERNELRELEASE}" |
89 | echo "" >&2 | 84 | echo "" >&2 |
90 | echo '** ** ** WARNING ** ** **' >&2 | 85 | echo '** ** ** WARNING ** ** **' >&2 |
91 | echo "" >&2 | 86 | echo "" >&2 |