summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@theqtcompany.com>2016-03-14 15:28:03 +0100
committerGatis Paeglis <gatis.paeglis@theqtcompany.com>2016-03-16 13:05:33 +0000
commit69074fbee24ecfcaf304cfcb07cadf78b3ec2cda (patch)
treea582713ce3696ac7ff3d891ade9d78c22f857bb7 /classes
parent482d631b27aae54477c80d44660ddd23769cacf5 (diff)
downloadmeta-boot2qt-69074fbee24ecfcaf304cfcb07cadf78b3ec2cda.tar.gz
Use consistent mtime timestamps
This patch adds consistent_timestamps.bbclass which is a hackish way of resembling reproducible build - byte-for-byte identical binary packages from a given source. Naturally this is not a complete solution, but it fixes the issue described below. Real solution for this should be done by the Yocto project itself. In OSTree each new update is checked out with all files and directories having mtime=0, this breaks fontconfig cache validity check (mtime embedded in the cache should match the containing directories mtime). Yocto generates this cache file in poky/meta/lib/oe/rootfs.py::create by calling self._run_intercepts() after all packages have been installed. These timestamps are nondeterministic as they depend on current system time. By using ROOTFS_POSTINSTALL_COMMAND hook we can ensure that these embedded time stamps have a known time, which is a basic property of reproducible build system. Change-Id: Ib2f130248f2e65db391d2b2f19ab5dac30a2cfb0 Task-number: QTEE-1081 Reviewed-by: Samuli Piippo <samuli.piippo@theqtcompany.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/consistent_timestamps.bbclass27
1 files changed, 27 insertions, 0 deletions
diff --git a/classes/consistent_timestamps.bbclass b/classes/consistent_timestamps.bbclass
new file mode 100644
index 0000000..e82f77c
--- /dev/null
+++ b/classes/consistent_timestamps.bbclass
@@ -0,0 +1,27 @@
1##############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: http://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:COMM$
9##
10## Commercial License Usage
11## Licensees holding valid commercial Qt licenses may use this file in
12## accordance with the commercial license agreement provided with the
13## Software or, alternatively, in accordance with the terms contained in
14## a written agreement between you and The Qt Company. For licensing terms
15## and conditions see http://www.qt.io/terms-conditions. For further
16## information use the contact form at http://www.qt.io/contact-us.
17##
18## $QT_END_LICENSE$
19##
20##############################################################################
21
22update_file_timestaps() {
23 # Update file timestamp to 0 seconds since Epoch time.
24 TZ=UTC find ${IMAGE_ROOTFS} -exec touch -h -m -t '197001010000' {} \;
25}
26
27ROOTFS_POSTINSTALL_COMMAND += "update_file_timestaps; "