From: Jonas Gorski Date: Thu, 26 Sep 2024 15:41:35 +0000 (+0200) Subject: rootfs-postcommands.bbclass: make opkg status reproducible X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80b279f18230208c6cc258ddf6a6e6dd3f8c9d79;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 Signed-off-by: Jonas Gorski Signed-off-by: Richard Purdie (cherry picked from commit 61a9b1b1cb618ce90ba7886036f41263075c07df) Signed-off-by: Steve Sakoman --- diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass index 920da94ba2c..5f4d67f93ca 100644 --- a/meta/classes-recipe/rootfs-postcommands.bbclass +++ b/meta/classes-recipe/rootfs-postcommands.bbclass @@ -487,6 +487,10 @@ rootfs_reproducible () { find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \ sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g' fi + + if [ -f ${IMAGE_ROOTFS}${localstatedir}/lib/opkg/status ]; then + sed -i 's/^Installed-Time: .*/Installed-Time: ${REPRODUCIBLE_TIMESTAMP_ROOTFS}/' ${IMAGE_ROOTFS}${localstatedir}/lib/opkg/status + fi fi }