From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7187242631035879424 X-Received: by 2002:a81:6006:0:b0:4d1:959d:fa49 with SMTP id u6-20020a816006000000b004d1959dfa49mr2714269ywb.33.1673728018585; Sat, 14 Jan 2023 12:26:58 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a25:aa82:0:b0:7d2:cf5:2b54 with SMTP id t2-20020a25aa82000000b007d20cf52b54ls1966139ybi.5.-pod-prod-gmail; Sat, 14 Jan 2023 12:26:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXvkuNDMtUbkW7yVWEKUaKlrj8yLTba95rj77xmjtCOLWXpNXkMWGlAq8ChIQGceUpeH6wQh X-Received: by 2002:a25:4f82:0:b0:7ca:35a:7786 with SMTP id d124-20020a254f82000000b007ca035a7786mr6518409ybb.44.1673728017775; Sat, 14 Jan 2023 12:26:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673728017; cv=none; d=google.com; s=arc-20160816; b=q75v+T2fL9jvflAIcs/oeVnjsaH03aoB5o5AY5qI0aLr+aHLBRah5BletWUjteTN9M jcrKvCXrhJdYlic9tKxQiNsSr/ZeBp/SSI+nPkwpgGHzIQRbftofOUyHxqkJumCJJqCa l2K25H8lXjL/ulnSdjjbs3kefYQ/CdwmrhhMlKwqTzIivCyZWjuRNLs4yF0iTUXuuVHq 0QVdGLdPx8/fW6HeLB92PHRVn5HqPz7yxObgZA5Km6AJzrHwlyDMNw0Ca6cQRyUHfDAr S3lRGtEAkQyzJ2Lt+axK5bKdq+UfTQBL3DjaTH8JBZOdpjb+OWxHEzCRvgr8O9w0gyu5 ct0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=1tAVWWjrdKbB0cnek8TMmvDnPoZcDQvPW6a1OZ0tho0=; b=Y0MrKRk8T0+yuAW6kFHOkoxYtxSt80XQgeD/jlyxJnQm7w2/wUZSHj1/sS7yHI24yC K+WU6cZH7paMKbaSzPl3CSMksXExf1sQFfx+AyX5mfWtB4Ubss+72nhr6uWsadERKQeM F7jZrc9Oomn9BvzHzLKWJe39TEtLspHIBXNL22+GtbmXVNv2Fl5AY+T3nZjd9r3axBFU 71YbK/0+B8InW8y0TYDuwGKiChBIx1TA6R4PHu7OBrwAzyRW44HxPRZsxcSkkz5M3w2f O6ZPfrEDcXfIYZnZAhYDRsy4BEPF+DgfLOa0G26PNMaWWHdGltYqTxmj6cJnmhGZgcez PjyQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id x78-20020a25e051000000b007bf23130ad3si1737942ybg.3.2023.01.14.12.26.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Jan 2023 12:26:57 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from home.localnet (44-208-124-178-static.mgts.by [178.124.208.44] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 30EKQspn003158 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 14 Jan 2023 21:26:55 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Cc: venkata.pyla@toshiba-tsip.com, Felix Moessbauer Subject: Re: [PATCH v2 02/10] image.bbclass: fix non-reproducible file time-stamps inside rootfs Date: Sat, 14 Jan 2023 23:26:50 +0300 Message-ID: <8381527.EBGB3zze1k@home> In-Reply-To: <20230112055619.843445-3-felix.moessbauer@siemens.com> References: <20230112055619.843445-1-felix.moessbauer@siemens.com> <20230112055619.843445-3-felix.moessbauer@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED 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-TUID: gMgBI+v21Lfy In the email from Thursday, 12 January 2023 08:56:11 +03 user Felix Moessbauer wrote: > 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 > > Acked-by: Felix Moessbauer > Signed-off-by: venkata pyla > --- > meta-isar/conf/local.conf.sample | 10 ++++++++++ > meta/classes/image.bbclass | 10 ++++++++++ > 2 files changed, 20 insertions(+) > > diff --git a/meta-isar/conf/local.conf.sample > b/meta-isar/conf/local.conf.sample index e1cd66e..6208623 100644 > --- a/meta-isar/conf/local.conf.sample > +++ b/meta-isar/conf/local.conf.sample > @@ -248,3 +248,13 @@ USER_isar[flags] += "clear-text-password" > #CCACHE_TOP_DIR ?= "${TMPDIR}/ccache" > # Enable ccache debug mode > #CCACHE_DEBUG = "1" > + > +# Uncommnet and add value to it to build images reproducibly > +# > +# The value for `SOURCE_DATE_EPOCH` should be latest source change time in > +# seconds since the Epoch. > +# Git repository users can use value from 'git log -1 --pretty=%ct' > +# Non git repository users can use value from 'stat -c%Y ChangeLog' > +# To know more details about this variable and how to set the value refer > below +# https://reproducible-builds.org/docs/source-date-epoch/ > +#SOURCE_DATE_EPOCH = > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index 6f0607e..519a2e5 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -429,6 +429,16 @@ do_rootfs_finalize() { > > rm -f "${ROOTFSDIR}/etc/apt/sources-list" > EOSUDO > + > + # 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}" && \ This failed in CI with empty variable with the following log: DEBUG: Executing shell function do_rootfs_finalize + do_rootfs_finalize + sudo -s + test ! -z + bb_sh_exit_handler + ret=1 + [ 1 != 0 ] + echo WARNING: exit code 1 from a shell command. + exit 1 WARNING: exit code 1 from a shell command. ERROR: ExecutionError('/workspace/build/isar_ub_devel_fast/318/build/tmp/work/ debian-buster-armhf/isar-image-base-stm32mp15x/1.0-r0/temp/ run.do_rootfs_finalize.2265252', 1, None, None) > + sudo 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} ';' > > ${DEPLOY_DIR_IMAGE}/files.modified_timestamps && \ + bbwarn > "$(grep ^f ${DEPLOY_DIR_IMAGE}/files.modified_timestamps) \nModified above > file timestamps to build image reproducibly" + > } > addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess