Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp949483ybp; Wed, 9 Oct 2019 06:45:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqy03cWOppi5ECAzT+V4pDgqlszttUZUJv5TH+idCEUok0EBwWiYuUQyvLcNsXJzyRYzOZpv X-Received: by 2002:a17:906:7091:: with SMTP id b17mr2836203ejk.82.1570628716758; Wed, 09 Oct 2019 06:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570628716; cv=none; d=google.com; s=arc-20160816; b=oHhpKRObj1tT/aUbpH1kk6GAuFYKE0q3lpdfmIe2GPq7Xg9AvHa5tJ6A/KPFhPwUA9 tUwyPYwWsPf9QvUcew+Bn6egAmOcp5mgF98b64adITBGftYOtxCl2Cytzn5KD6fFZVcY oyogbGyyw51XcYEySEI1F6esvNTj/Bydl5ZDv4jSHam2Up7iS6sU9x862Q4jwoBpXmy/ OGA676arGTI7j0WOq9FO7PcxAWAuMb/yrw3mQMIDbM4DKjI2rPXjoD8+crPMjc6Lc67c 57ynOq5jwOjjWJLN+Ziz9JSG7mztefQxTTPPhpU/Pn2epMG/4u7PjgZQAwF+Fh+F1OVG 7qgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :feedback-id:message-id:subject:reply-to:cc:from:to:dkim-signature :date; bh=Fw03kMjLPd8j1SiB/+D4/nukD3ATLXHGq8C5r35qhIE=; b=HFsn9SKari2yGq2JyNNoW/OG+X9pLDqpciGBsYy1wAQTxKjINotucJ7gdsOcrZO0dD C2Miq7aeYnZtJYV5oPv+AYKxKgqCdfsWXvhfngjZ3mwQ6bWluJLyBzBa4whc8pgcr5p1 Kb7obl7ytkmKdu55L0yyERyNWI2XkmhdCq/JwuUA3ZHUIjfOpqq6og1gT/TnQvjjQ6Gf 1UZociD/wsCCceAJpLFpHnU78kqw/Ey9efZZZeVIpvQDWPSHJLqD6D7RXprhJcH5hYWo bCaMGxhFq3HIkz6gGwgPfzO7vAAOZ9X/zbZ31gj9ksiBF1hBkHbMTR1WtwIu0js+u0Yv Z01Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.ch header.s=default header.b=R1YnAMsv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.ch Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ga6si1166259ejb.309.2019.10.09.06.44.52; Wed, 09 Oct 2019 06:45:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.ch header.s=default header.b=R1YnAMsv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731243AbfJINmX (ORCPT + 99 others); Wed, 9 Oct 2019 09:42:23 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:25697 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731152AbfJINmW (ORCPT ); Wed, 9 Oct 2019 09:42:22 -0400 Date: Wed, 09 Oct 2019 13:42:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.ch; s=default; t=1570628540; bh=Fw03kMjLPd8j1SiB/+D4/nukD3ATLXHGq8C5r35qhIE=; h=Date:To:From:Cc:Reply-To:Subject:Feedback-ID:From; b=R1YnAMsv+wO6CGcZ5yPC/pyShuPV3BTSKnYPI4KQhvWzKN0r5wyAj8K6taD/OHdPL FWhGxoFfR0j04vVUuq+5j8wmzSuStb7vSuODP0A+Qgl0HyetXqD84aCtkFvwn4c5Ds u/HVVJOrKqVxk5IEQFarDIIkdydIyWeAORm3ijVA= To: Masahiro Yamada From: Dmitry Goldin Cc: Andreas Schwab , Greg KH , "linux-kernel\\\\\\\\@vger.kernel.org" , "joel\\\\\\\\@joelfernandes.org" , Ben Hutchings Reply-To: Dmitry Goldin Subject: [PATCH] kheaders: substituting --sort in archive creation Message-ID: Feedback-ID: Z14zYPZ70AFJyYagXjx-jk2Vw9RTvF5p9C9xp4Pq6DJAMFg9PDsfB7GoMmtR_dfa0BaFgToZb9Q4V0UiY2YiMQ==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Goldin The option --sort=3DORDER was only introduced in tar 1.28 (2014), which is rather new and might not be available in some setups. This patch tries to replicate the previous behaviour as closely as possible to fix the kheaders build for older environments. It does not produce ident= ical archives compared to the previous version due to minor sorting differences but produces reproducible results itself in my tests. Signed-off-by: Dmitry Goldin --- kernel/gen_kheaders.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index aff79e461fc9..5a0fc0b0403a 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -71,10 +71,13 @@ done | cpio --quiet -pd $cpio_dir >/dev/null 2>&1 find $cpio_dir -type f -print0 | =09xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\= ///smg;' -# Create archive and try to normalize metadata for reproducibility -tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=3D$KBUILD_BUILD_TIMESTAMP}" \ - --owner=3D0 --group=3D0 --sort=3Dname --numeric-owner \ - -Jcf $tarfile -C $cpio_dir/ . > /dev/null +# Create archive and try to normalize metadata for reproducibility. +# 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}" \ + --owner=3D0 --group=3D0 --numeric-owner --no-recursion \ + -Jcf $tarfile -C $cpio_dir/ -T - > /dev/null echo "$src_files_md5" > kernel/kheaders.md5 echo "$obj_files_md5" >> kernel/kheaders.md5 -- 2.23.0