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 <[email protected]>
---
 meta/classes-recipe/rootfs-postcommands.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass 
b/meta/classes-recipe/rootfs-postcommands.bbclass
index 920da94ba2c8..5f4d67f93ca8 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
 }
 
-- 
2.46.0


-- 
BISDN GmbH
Körnerstraße 7-10
10785 Berlin
Germany


Phone: 
+49-30-6108-1-6100


Managing Directors: 
Dr.-Ing. Hagen Woesner, Andreas 
Köpsel


Commercial register: 
Amtsgericht Berlin-Charlottenburg HRB 141569 
B
VAT ID No: DE283257294

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204992): 
https://lists.openembedded.org/g/openembedded-core/message/204992
Mute This Topic: https://lists.openembedded.org/mt/108669987/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to