From patchwork Sat Jun 24 14:48:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Forsman?= X-Patchwork-Id: 9807791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 158F16038C for ; Sat, 24 Jun 2017 14:48:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F099A28774 for ; Sat, 24 Jun 2017 14:48:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4F382877A; Sat, 24 Jun 2017 14:48:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB5FF28774 for ; Sat, 24 Jun 2017 14:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751338AbdFXOsQ (ORCPT ); Sat, 24 Jun 2017 10:48:16 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34522 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751316AbdFXOsP (ORCPT ); Sat, 24 Jun 2017 10:48:15 -0400 Received: by mail-wr0-f193.google.com with SMTP id k67so19580878wrc.1 for ; Sat, 24 Jun 2017 07:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N/ydWyBQ+CZdJ2WITG19m0tNZIcvIPq6fFWxjfgFjF4=; b=rg19h9qtfUpP3IUjdeXtPrVkpeab+Y5dU6YtvQTxPKRjN3rCXSA8MIPOBewuFtou9f q4GDsM2dalio4j395ynfBF/6xnKanG6i9heOGdjOM6RWSeAxVk8FNtIooUhbyLXQdC64 D9h0EalBo4cpSU62hoIaRny7nXBdVid0k9WfMWuZajY2CTdM9oY/hiH6zBpmkmcy1e32 ueUkLyUFpjnPMaKiut6JmIlbKbpvoN9cUZhI/1oYuhsQkIFtySo0Xe9DI7GhKOzI8YlX v0IjTQA6H7eA98q6bBmbd4G9MJ/2BxkJ/qBt/zi9bhR4bddlEveq5xcPvwvYEtBhQ5wW qh3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N/ydWyBQ+CZdJ2WITG19m0tNZIcvIPq6fFWxjfgFjF4=; b=JlY1lZItz2GvLO5+PFCapF58KOSea8KrT9DWRr76QJKlp9JBUeMRAUawD2wZxYMCm4 7msjE6+n3hP+I4uC0Sfv5i3SOZ41GuV8TOW57ugS5qp5pXGdTtQBsgKmG1M/gWACl7nc AzLgmCXFxOhyFKLDF0REJJnGIboSgdXqnRZBKBDQlx4ICpoGcyyn14NSUwdsbmTEIsJU 1MHsS7ehllc2A9Tlg1HbsRWBC9RXSIqfTetO1kjOuqenYOpcb5SJw+GeQoVw8eXUIwGm 6FOIP8P5lpgLPphTVzZ/I1o93los0k8QigVwQ7sx7PP1SPPDGmCA1/uZJDOPdrFrf0S7 mqsw== X-Gm-Message-State: AKS2vOyPhsRrLU4dababFnpX1NHKNs6zPD21uoAGtvoDFTjb7/h8kAzd 3NpvYaH/2vCM3yOp X-Received: by 10.80.184.129 with SMTP id l1mr9760511ede.88.1498315694094; Sat, 24 Jun 2017 07:48:14 -0700 (PDT) Received: from localhost (cm-84.208.208.100.getinternet.no. [84.208.208.100]) by smtp.gmail.com with ESMTPSA id w26sm2536529edw.24.2017.06.24.07.48.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Jun 2017 07:48:13 -0700 (PDT) From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= To: linux-kbuild@vger.kernel.org Cc: mmarek@suse.com, =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Subject: [PATCH] kbuild: create deterministic initramfs directory listings Date: Sat, 24 Jun 2017 16:48:10 +0200 Message-Id: <20170624144810.7363-1-bjorn.forsman@gmail.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP kbuild runs "find" on each entry in CONFIG_INITRAMFS_SOURCE that is a directory. The order of the file listing output by "find" matter for build reproducability, hence this patch applies "sort" to get deterministic results. Without this patch, two different machines with identical initramfs directory input may produce differing initramfs cpio archives (different hash) due to the different order of the files within the archive. Signed-off-by: Bjørn Forsman --- scripts/gen_initramfs_list.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh index 0055b07b03b6..72f094585cca 100755 --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh @@ -174,7 +174,7 @@ dir_filelist() { ${dep_list}header "$1" srcdir=$(echo "$1" | sed -e 's://*:/:g') - dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n") + dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | sort) # If $dirlist is only one line, then the directory is empty if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then