kbuild: tar-pkg: use tar rules in scripts/Makefile.package

Use %.tar, %.tar.gz, %.tar.bz2, %.tar.xz, %.tar.zst rules in
scripts/Makefile.package.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
Masahiro Yamada
2023-02-15 10:20:31 +09:00
parent e0ca16749a
commit 1fc9095846
2 changed files with 24 additions and 57 deletions
+1 -51
View File
@@ -16,39 +16,7 @@ set -e
#
# Some variables and settings used throughout the script
#
tmpdir="${objtree}/tar-install"
tarball="${objtree}/linux-${KERNELRELEASE}-${ARCH}.tar"
#
# Figure out how to compress, if requested at all
#
case "${1}" in
dir-pkg|tar-pkg)
opts=
;;
targz-pkg)
opts="-I ${KGZIP}"
tarball=${tarball}.gz
;;
tarbz2-pkg)
opts="-I ${KBZIP2}"
tarball=${tarball}.bz2
;;
tarxz-pkg)
opts="-I ${XZ}"
tarball=${tarball}.xz
;;
tarzst-pkg)
opts="-I ${ZSTD}"
tarball=${tarball}.zst
;;
*)
echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&2
exit 1
;;
esac
tmpdir=$1
#
# Clean-up and re-create the temporary directory
@@ -148,21 +116,3 @@ case "${ARCH}" in
sleep 5
;;
esac
if [ "${1}" = dir-pkg ]; then
echo "Kernel tree successfully created in $tmpdir"
exit 0
fi
#
# Create the tarball
#
if tar --owner=root --group=root --help >/dev/null 2>&1; then
opts="$opts --owner=root --group=root"
fi
tar cf $tarball -C $tmpdir $opts $dirs
echo "Tarball successfully created in $tarball"
exit 0