From nobody Wed Feb 11 21:33:50 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23502C77B6E for ; Wed, 12 Apr 2023 08:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbjDLI14 (ORCPT ); Wed, 12 Apr 2023 04:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjDLI1y (ORCPT ); Wed, 12 Apr 2023 04:27:54 -0400 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B7185FD5 for ; Wed, 12 Apr 2023 01:27:53 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: Dmitry Goldin Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= , Sam James , Masahiro Yamada Subject: [PATCH v2] kheaders: make it possible to override TAR Date: Wed, 12 Apr 2023 10:27:43 +0200 Message-Id: <20230412082743.350699-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 86cdd2fdc4e39c388d39c7ba2396d1a9dfd66226 ("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=3Dgtar Link: https://bugs.gentoo.org/884061 Reported-by: Sam James Tested-by: Sam James Co-developed-by: Masahiro Yamada Signed-off-by: Micha=C5=82 G=C3=B3rny --- Makefile | 3 ++- kernel/gen_kheaders.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5aeea3d98..50045059c 100644 --- a/Makefile +++ b/Makefile @@ -520,6 +520,7 @@ LZMA =3D lzma LZ4 =3D lz4c XZ =3D xz ZSTD =3D zstd +TAR =3D tar =20 PAHOLE_FLAGS =3D $(shell PAHOLE=3D$(PAHOLE) $(srctree)/scripts/pahole-flag= s.sh) =20 @@ -599,7 +600,7 @@ export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUST= C_OR_CLIPPY BINDGEN CARGO export HOSTRUSTC KBUILD_HOSTRUSTFLAGS export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX Y= ACC AWK INSTALLKERNEL 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 LDFLAGS_MO= DULE export KBUILD_USERCFLAGS KBUILD_USERLDFLAGS =20 diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index 1ef9a8751..82d539648 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -86,7 +86,7 @@ find $cpio_dir -type f -print0 | # For compatibility with older versions of tar, files are fed to tar # pre-sorted, as --sort=3Dname might not be available. find $cpio_dir -printf "./%P\n" | LC_ALL=3DC sort | \ - tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=3D$KBUILD_BUILD_TIMESTAMP}" \ + ${TAR:-tar} "${KBUILD_BUILD_TIMESTAMP:+--mtime=3D$KBUILD_BUILD_TIMESTA= MP}" \ --owner=3D0 --group=3D0 --numeric-owner --no-recursion \ -I $XZ -cf $tarfile -C $cpio_dir/ -T - > /dev/null =20 --=20 2.40.0