From patchwork Tue Sep 17 09:18:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 173885 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp872041ill; Tue, 17 Sep 2019 02:18:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwO/6feVwZHEQvvGkpP0P0wxq9pGUjz3mHcP4ZIGlbw/mDAx0RECR5vBO3cj1015PknATc2 X-Received: by 2002:a17:902:7c13:: with SMTP id x19mr2679486pll.322.1568711929193; Tue, 17 Sep 2019 02:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568711929; cv=none; d=google.com; s=arc-20160816; b=XvgRrqR0qEBXoTU3NgR5rGLLNe24TF9IQadgwyz9FNs66c8fDlFlK/rbdoLL0cqLv0 ojFb7gApCALMFmnq6atz7e0/n13tR1EJ0CsFT3/u5qWaYs0+dJOV/pXtSIk3oSzVBhxV iLMBfzqg2iet6tp291LToCa3sgPkQ3nsXeqyVhp1u4mKEjEgL1X8ss7qlj0oGGRmRrFJ 6+rBq3ncLvegw9CNgVYb6nr6Qr5WAzzNa2E0sStIBOCbzJYeoiz+njO2AFaYvMZmiBMD o6KnbVRRqQYOTxtps7vXyp2WTP9V57lnyTdq9EGL3BvA4mbt7gHWytGgN7l+4EeVNgnS sqFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=IqyGVCA6t5UC8BrGOq3U4QNM38230r9ILf5yZBv/C1Q=; b=PKixMn4znsPjquKPGaaacMbJe+kGo0EyfGMh2vkBirkChwExnHsFQa1RCtP5eZdJ/J MonELl+Wmj3MCtcJtH/3TgkUPbU0AmVdWLejn0GIN+leXSRCOG2HJ86HzQvWWGsm8aCc M1Aiqb6ARiBjktv/mBEpAOIZD2PQP/PTLVmj4a0ZLgVUhgRIGg/vf9Gsx9hL7EA8tcD7 SVSsk4MWJpMbsKoK/tiq+QR0mK6WT5XZCkOj005f0uArGoRE4NtGw0AMZyak1UaRSBLS v+cS4ZlLniExR1aQtPMRgggKhFnGnznZFrfbKG0JxQTe8AS8/1px5SzDk66nMjAu797U ZhrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=cbv90CIJ; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id l15si1313168pja.88.2019.09.17.02.18.48; Tue, 17 Sep 2019 02:18:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=cbv90CIJ; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 9A8A57F081; Tue, 17 Sep 2019 09:18:45 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mail.openembedded.org (Postfix) with ESMTP id 102927F770 for ; Tue, 17 Sep 2019 09:18:43 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id i18so2250494wru.11 for ; Tue, 17 Sep 2019 02:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7Yr3Y5R+zIShNMRtDw5pSS5a9ShULsUGcoIfd1xAzk8=; b=cbv90CIJq6gL+xYbeYRrkFcTwTHt84eKxYEbwkHU0f1AlbKdo3irk/PnD2vWvOHcCN 4YqZNjOCIImnPmfj5CtSnjCMM3b6yJKU0Tl1D6ISO51MKYpoUB4eNwOV28htsOqu22h8 AmqD96EgVQNZIi3Mi9gXZ0uJy/EyZWsMkeU6sHzZl6TOcG0rDzS5KrS94SBWX0i5jNk3 2h2gcY30DC8/H50AsJp9V65LvVWws2Kz64h7BtIMCVY8aBV7ZHd499JfaDzESpmdT1dK UmVv8LAHge4nVgNm+Aytrn1IBprpEzLYyM5Zxf1g4AhSWFYKeK7HOmtHhgfVZn4Xg5rJ RpWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7Yr3Y5R+zIShNMRtDw5pSS5a9ShULsUGcoIfd1xAzk8=; b=lXygcRPMq6nZpFOMPDxfnEhSHrL4czm7DMvUMuemTY5NdbDqCaqQF6uTkFBKslALwV ZwfVkAcwyiuyzV+zrVuc1p19kl3iQj4zB5HTu365qGHykW+1kbVCpnWWTSeAptOqVQeV 1HYceNquPRUPLwjwN1LpS0VHxEbZsfph+IR7iH+np+3jaWoK1h6CuxRyjzjUk3z3yMEf 3Qu6C66XtmjVZ2fvVqLjG3H+3y+r/wUpj8IzFILUeUluNfcxHV4osefvRI7GoFgQqljs htb/Wlwk6VElYd+XS7x8YszPXvv8ykjn/0jG0Qq1uotfoLgEr1coVBX3jSdA8yP+fZh4 QRLg== X-Gm-Message-State: APjAAAWBhuwvQzKwIyz6B39MmKb2wyq51Z7/+xVP2qVkks+zHHPL+tVT L5ILchm8ovSZfEY36nVAiQakwLfELzA= X-Received: by 2002:adf:ef44:: with SMTP id c4mr2239208wrp.216.1568711924192; Tue, 17 Sep 2019 02:18:44 -0700 (PDT) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id f83sm1668782wmf.43.2019.09.17.02.18.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 02:18:42 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 17 Sep 2019 10:18:39 +0100 Message-Id: <20190917091839.3280-1-ross.burton@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [OE-core] [PATCH] opkg-utils: respect SOURCE_DATE_EPOCH when building ipkgs X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Backport a patch from upstream to respect SOURCE_DATE_EPOCH when building ipkgs, to ensure reproducible archives. Signed-off-by: Ross Burton --- ...ld-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch | 44 +++++++++++++++++++ .../opkg-utils/opkg-utils_0.4.1.bb | 1 + 2 files changed, 45 insertions(+) create mode 100644 meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch -- 2.20.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch new file mode 100644 index 00000000000..a181169d476 --- /dev/null +++ b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch @@ -0,0 +1,44 @@ +Upstream-Status: Backport +Signed-off-by: Ross Burton + +From 59da5577bf8df441c6ca958e50fcb83228702764 Mon Sep 17 00:00:00 2001 +From: Alejandro del Castillo +Date: Thu, 12 Sep 2019 10:24:58 -0500 +Subject: [PATCH] opkg-build: clamp mtimes to SOURCE_DATE_EPOCH + +For reproducible builds, clamp mtimes bigger than SOURCE_DATE_EPOCH to +SOURCE_DATE_EPOCH (build generated files, usually). + +Fixes bugzilla 13450 + +Signed-off-by: Alejandro del Castillo +Signed-off-by: Ross Burton +--- + opkg-build | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/opkg-build b/opkg-build +index dcd2d68..2517a2b 100755 +--- a/opkg-build ++++ b/opkg-build +@@ -297,9 +297,16 @@ mkdir $tmp_dir + + build_date="${SOURCE_DATE_EPOCH:-$(date +%s)}" + ++mtime_args="" ++# --clamp-mtime requires tar > 1.28. Only use it if SOURCE_DATE_EPOCH is set, to avoid having a generic case dependency on tar > 1.28. ++# this setting will make sure files generated at build time have consistent mtimes, for reproducible builds. ++if [ ! -z "$SOURCE_DATE_EPOCH" ]; then ++ mtime_args="--mtime=@$build_date --clamp-mtime" ++fi ++ + ( cd $pkg_dir/$CONTROL && find . -type f > $tmp_dir/control_list ) + ( cd $pkg_dir && find . -path ./$CONTROL -prune -o -print > $tmp_dir/file_list ) +-( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext ) ++( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion $mtime_args -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext ) + ( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --no-recursion --mtime=@$build_date -c $tarformat -T $tmp_dir/control_list | gzip $zipargs > $tmp_dir/control.tar.gz ) + rm $tmp_dir/file_list + rm $tmp_dir/control_list +-- +2.20.1 + diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb index 4be7b16d8a2..cf1e4670c65 100644 --- a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb @@ -9,6 +9,7 @@ PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtu SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ file://0001-Switch-all-scripts-to-use-Python-3.x.patch \ + file://0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch \ " UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"