summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2024-12-06 20:42:05 +0100
committerSteve Sakoman <steve@sakoman.com>2024-12-16 05:58:03 -0800
commitda007b8f01bb8bf1e2661a7060ec45af83ab70b4 (patch)
tree82ab4aff198bd052d99c447bdc66e16b50c6c678 /meta
parente402b2417a0546548772eb5e2ae69fc1f254f69c (diff)
downloadpoky-da007b8f01bb8bf1e2661a7060ec45af83ab70b4.tar.gz
rootfs-postcommands.bbclass: make opkg status reproducible
opkg stores the current time as Installed-Time in its status file when installing packages to the rootfs. Make this reproducible by replacing Installed-Time with ${REPRODUCIBLE_TIMESTAMP_ROOTFS}, which then also matches the files' datestamps. Based on OpenWrt's approach for the issue [1]. [1] https://github.com/openwrt/openwrt/blob/main/include/rootfs.mk#L103 (From OE-Core rev: 61a9b1b1cb618ce90ba7886036f41263075c07df) (From OE-Core rev: bfa9c2f15ac275fceccf22084bed9a064304eb6e) Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/rootfs-postcommands.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index f7517c66dc..83bf265a68 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -377,6 +377,10 @@ rootfs_reproducible () {
377 find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \ 377 find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \
378 sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g' 378 sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'
379 fi 379 fi
380
381 if [ -f ${IMAGE_ROOTFS}${localstatedir}/lib/opkg/status ]; then
382 sed -i 's/^Installed-Time: .*/Installed-Time: ${REPRODUCIBLE_TIMESTAMP_ROOTFS}/' ${IMAGE_ROOTFS}${localstatedir}/lib/opkg/status
383 fi
380 fi 384 fi
381} 385}
382 386