From patchwork Mon Jan 2 14:58:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: venkata.pyla@toshiba-tsip.com X-Patchwork-Id: 2394 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Mon, 02 Jan 2023 15:58:43 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-oa1-f63.google.com (mail-oa1-f63.google.com [209.85.160.63]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 302EwfSN025930 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 2 Jan 2023 15:58:42 +0100 Received: by mail-oa1-f63.google.com with SMTP id 586e51a60fabf-14c6a6ff8d8sf12429142fac.1; Mon, 02 Jan 2023 06:58:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672671516; cv=pass; d=google.com; s=arc-20160816; b=S/3KBOF1KpHey4zukRz8gt78QqhZ04vna+8sRdurQ8yleaG2ODKgO401PtMfrEXdCm vZuCJwRt1wuZOXUF3G8gZdIBak9Vl1Ab9FJIqxGfq2wfYNjiGsXIkFsTpKY1kIji0PWC +WZlZdUvvsrevwYmJo2TjneVeuFiC+RVk8ZeA2MbIiS44R9/Db9Ifgd0cIqOHXlljEQ2 I9gX+1vS8j/TH+s3r/C0d3NtQMbkLFJAaRGrFSKqXNBQHQ/12hnJ6Cimb89haz3KkBj8 g8wkF+DnM5cnCjR7zG2TXFiBGae0G+nbNQ/BThedSWQ9H24iaz3KNQAWxNEc1kTkgfNk pq6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=AcvO6NlmINWg9lZAFPz1lQ2Hc40Vcn1hGiRbhht4e/o=; b=Y7d+AW5GBD6IG8pYju41lEgPfa4NdODK3eX1R9JH6moYX3saz3MWryzJw2VOg14QQ2 OsKt3nnsOppsa7lbawVI4zVLbigvPdvojTDKI/nDTp0XlVWQ9URlRHwyLmQlNARgy2rK Oxn9HFGLSnmsQaTwdGESz01UalQD/YDdeP8JL4zeohaWim+hnp36VjrN9z9GQB4RrClz prLJ0Rtsd7RP/+CLJA1yo+PzbA9d7roSjjkVEHVKm/6q7DoUiJaR1GpdRwBTxX139reC df/dBhDpzMyUeBJ2K2d1RqXuUGJZhvEaD49tqHSyjW60uvlqBL/XhvdPuJhRGRBQ2cJ1 8okA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.157 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=AcvO6NlmINWg9lZAFPz1lQ2Hc40Vcn1hGiRbhht4e/o=; b=EJx+ThtuF0YY1cwB3gRv1mDTkpI27Lkml9R+EjwILsYlHxQU5FguzgJlnTCYmRGfy3 RWE1pV/w3A+plsqMlmMONPyo2LXkCF33gDQgddzTLENfIkuxfgajKhHnqJM9nkN3GHRi HXwhGEwvCTBq2DEpXLOYZ8RudNGchyam9T+MlbQEXMtBkWVzPlpb6V1tYgPBkDJEXwDH CkX+UZrHUnYr2dm3zyHhAjr2EiV9i+6OfzkbZPo79RTo31nUcamMPuj3BnpD569S4zeN sqjmaVl8uAGacatApOqXSvRrIBEvzA2cvc7HJ5vIebmzXHqQmHEOwVvqxyIlwWF19WkN EvAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=AcvO6NlmINWg9lZAFPz1lQ2Hc40Vcn1hGiRbhht4e/o=; b=zXuNlo7DLW0e73kXEK+InpGWxgg6icqG/5T7VtCZGmfFyLTlrzdQzpBYre+0uDu9vJ EK2ibF6oGnJuoVp1gZYuwD6+9W+fR417wROynHOHlTHAEogosm8k8Q1m8zx0hq3Por30 uSRM/9Oue7qzxFVMW4lH2lsJ1Oo6OZIqcYqIr2RkvhcBXVHrNe3p7fW8TjcxDIXdrow1 AGc+2pJztJqO+/yI0NZ9eIJJgOmjEvGEiPsF3Q78+GAiQ24OnDpvXC5V8fROJif8x6Av 3TRdM76pL7bmL3VHI7npJj/oeHs2PWoiX/AJwMna9rfM0ayp53OMysixmLNrkREz7MUY zrvg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AFqh2krj3WNFWueTMQGoyoZi5DZ1bJQMqVgpuSw3CQbpvXTeQkmnbgcC kajHAXW1nDqxtIx+NkyRhGk= X-Google-Smtp-Source: AMrXdXulksdXFLwcDUfIoQg+vfi3PGocqqpDg7nNfunK9KGdOruFj+mHHhH1MrZTTXjn62SClHyXFw== X-Received: by 2002:a05:6870:8a25:b0:144:a46f:e355 with SMTP id p37-20020a0568708a2500b00144a46fe355mr2468594oaq.95.1672671515957; Mon, 02 Jan 2023 06:58:35 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6870:c80b:b0:14d:3678:867f with SMTP id ee11-20020a056870c80b00b0014d3678867fls8575644oab.10.-pod-prod-gmail; Mon, 02 Jan 2023 06:58:35 -0800 (PST) X-Received: by 2002:a05:6870:3c0c:b0:144:d3f9:ff11 with SMTP id gk12-20020a0568703c0c00b00144d3f9ff11mr19138237oab.28.1672671515550; Mon, 02 Jan 2023 06:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672671515; cv=none; d=google.com; s=arc-20160816; b=OOgxMVSRtvuaWoTvEE73ME9/nMZBHGTiJ35riN4Y9jqkD3rS4srYQlDdXbvK77Wct2 pnP5s1MS04i9JJVxUCIIkClSxW8o4RFgp9CoAUeyorpz5i1eZthQUZl0IAasZYrKLCVD nfEb0Mattg5NlOAVYZ8ei038RlZMCInw4Vi2GMvo1HKrPb3loGLfXXFPyxtldvOFtg5s 27v06Xwv8eIytCTho/ZfNmUkiOYNuoR25yZ34svY0VwikGsJGro7Ifj78+8zuxw8iuux et8S6hNPhfuuYYxF1E6Peug2n4RKCyQfJ6GZY+AO4UESVlqaaxIFGEUef8Gnv7YrEtfJ yCug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=1i8IP1npvB+jek0gV2vHKdoxMC/Y1vKtNFhSYDVClis=; b=rLv641QtFJWSmH1SqPo8bbyJzg4kBisvD3mBq454W8dxGuYal8VJouqNJW8IbQ+VFm 0mJky5jlFAPnc6YkxoPDe34XjHHboGGe+IlDavRGhc/Wc68c0fUavICGr6SleTT02hok GJJWyU0EvmwH3O4J3WcLRb8g6HBVynwllbRTC22i7tbOJeaeYih7y5ZE1xZLBuWYO5Xa vIXybn+PkRozR8AHQZuKl7d6tP8jgfu3sk+CDvKm6kDiHg49G+4nzhRB8AzQIZn1Ts6y 7xPZmGrVjSjyiuGL/X8ghDjitiYi0E9uy3x+otXuCx80FxWDTTlWRr9+TJH2VN5OP3bR 7UvA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.157 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com Received: from mo-csw.securemx.jp (mo-csw1115.securemx.jp. [210.130.202.157]) by gmr-mx.google.com with ESMTPS id a19-20020a056870b15300b00144a469b41dsi2589950oal.4.2023.01.02.06.58.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2023 06:58:35 -0800 (PST) Received-SPF: pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.157 as permitted sender) client-ip=210.130.202.157; Received: by mo-csw.securemx.jp (mx-mo-csw1115) id 302EwW4L029394; Mon, 2 Jan 2023 23:58:32 +0900 X-Iguazu-Qid: 2wGqnqi0HfirK7rrAu X-Iguazu-QSIG: v=2; s=0; t=1672671512; q=2wGqnqi0HfirK7rrAu; m=JrXL1WwW1n61Dcyt2flk5y1oTOHZdPvW/wTx5bFXYyw= Received: from imx2-a.toshiba.co.jp (imx2-a.toshiba.co.jp [106.186.93.35]) by relay.securemx.jp (mx-mr1111) id 302EwVFx019252 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 2 Jan 2023 23:58:31 +0900 From: venkata.pyla@toshiba-tsip.com To: isar-users@googlegroups.com Cc: venkata pyla , amikan@ilbers.de, jan.kiszka@siemens.com, henning.schild@siemens.com, kazuhiro3.hayashi@toshiba.co.jp, dinesh.kumar@toshiba-tsip.com Subject: [PATCH] image.bbclass: fix non-reproducible file time-stamps inside rootfs image Date: Mon, 2 Jan 2023 20:28:28 +0530 X-TSB-HOP2: ON Message-Id: <20230102145828.32763-1-venkata.pyla@toshiba-tsip.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-OriginalArrivalTime: 02 Jan 2023 14:58:30.0181 (UTC) FILETIME=[AD258D50:01D91EBA] X-Original-Sender: venkata.pyla@toshiba-tsip.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.157 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: venkata pyla As part of reproducible-build work, the rootfs images generated on same source should be identical between two builds. In this commit it tries to solve one of the non-reproducible problem i.e. the rootfs file time-stamps generated during build time are not reproducible, it uses one of the solution provided in the debian live-build image project (refer [1]), it fixes by finding all the files/folders that are gernerated newly and set the time-stamp provided by `SOURCE_DATE_EPOCH` environment variable. [1] https://salsa.debian.org/live-team/live-build/-/merge_requests/218 Signed-off-by: venkata pyla --- meta/classes/image.bbclass | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 813e1f3..f592a12 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -430,6 +430,15 @@ do_rootfs_finalize() { "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" rm -f "${ROOTFSDIR}/etc/apt/sources-list" + + # Set same time-stamps to the newly generated file/folders in the + # rootfs image for the purpose of reproducible builds. + test ! -z "${SOURCE_DATE_EPOCH}" && \ + find ${ROOTFSDIR} -newermt \ + "$(date -d@${SOURCE_DATE_EPOCH} '+%Y-%m-%d %H:%M:%S')" \ + -printf "%y %p\n" \ + -exec touch '{}' -h -d@${SOURCE_DATE_EPOCH} ';' + EOSUDO } addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess