mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
kheaders: make it possible to override TAR
Commit 86cdd2fdc4
("kheaders: make headers archive reproducible")
introduced a number of options specific to GNU tar to the `tar`
invocation in `gen_kheaders.sh` script. This causes the script to fail
to work on systems where `tar` is not GNU tar. This can occur e.g.
on recent Gentoo Linux installations that support using bsdtar from
libarchive instead.
Add a `TAR` make variable to make it possible to override the tar
executable used, e.g. by specifying:
make TAR=gtar
Link: https://bugs.gentoo.org/884061
Reported-by: Sam James <sam@gentoo.org>
Tested-by: Sam James <sam@gentoo.org>
Co-developed-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
936599ca51
commit
73d210e9fa
3
Makefile
3
Makefile
@ -543,6 +543,7 @@ LZMA = lzma
|
|||||||
LZ4 = lz4
|
LZ4 = lz4
|
||||||
XZ = xz
|
XZ = xz
|
||||||
ZSTD = zstd
|
ZSTD = zstd
|
||||||
|
TAR = tar
|
||||||
|
|
||||||
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
||||||
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
|
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
|
||||||
@ -622,7 +623,7 @@ export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN
|
|||||||
export HOSTRUSTC KBUILD_HOSTRUSTFLAGS
|
export HOSTRUSTC KBUILD_HOSTRUSTFLAGS
|
||||||
export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
|
export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
|
||||||
export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
||||||
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
|
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD TAR
|
||||||
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS KBUILD_PROCMACROLDFLAGS LDFLAGS_MODULE
|
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS KBUILD_PROCMACROLDFLAGS LDFLAGS_MODULE
|
||||||
export KBUILD_USERCFLAGS KBUILD_USERLDFLAGS
|
export KBUILD_USERCFLAGS KBUILD_USERLDFLAGS
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ rm -rf "${tmpdir}"
|
|||||||
mkdir "${tmpdir}"
|
mkdir "${tmpdir}"
|
||||||
|
|
||||||
# shellcheck disable=SC2154 # srctree is passed as an env variable
|
# shellcheck disable=SC2154 # srctree is passed as an env variable
|
||||||
sed "s:^${srctree}/::" "${srclist}" | tar -c -f - -C "${srctree}" -T - | tar -xf - -C "${tmpdir}"
|
sed "s:^${srctree}/::" "${srclist}" | ${TAR} -c -f - -C "${srctree}" -T - | ${TAR} -xf - -C "${tmpdir}"
|
||||||
tar -c -f - -T "${objlist}" | tar -xf - -C "${tmpdir}"
|
${TAR} -c -f - -T "${objlist}" | ${TAR} -xf - -C "${tmpdir}"
|
||||||
|
|
||||||
# Remove comments except SDPX lines
|
# Remove comments except SDPX lines
|
||||||
# Use a temporary file to store directory contents to prevent find/xargs from
|
# Use a temporary file to store directory contents to prevent find/xargs from
|
||||||
@ -43,7 +43,7 @@ xargs -0 -P8 -n1 \
|
|||||||
rm -f "${tmpdir}.contents.txt"
|
rm -f "${tmpdir}.contents.txt"
|
||||||
|
|
||||||
# Create archive and try to normalize metadata for reproducibility.
|
# Create archive and try to normalize metadata for reproducibility.
|
||||||
tar "${timestamp:+--mtime=$timestamp}" \
|
${TAR} "${timestamp:+--mtime=$timestamp}" \
|
||||||
--owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \
|
--owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \
|
||||||
-I "${XZ}" -cf "${tarfile}" -C "${tmpdir}/" . > /dev/null
|
-I "${XZ}" -cf "${tarfile}" -C "${tmpdir}/" . > /dev/null
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user