summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@bisdn.de>2024-09-26 17:41:35 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-09-30 17:07:18 +0100
commit93bb2dd78e81895fedfc02be8700aafd26137fb3 (patch)
tree0f0e70ecd8bdb57bc6ec2977906b122bb8758088 /meta/classes-recipe
parent586df77d262c7b9df0dc8da469eaa36932c78bae (diff)
downloadpoky-93bb2dd78e81895fedfc02be8700aafd26137fb3.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) Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/rootfs-postcommands.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass
index 920da94ba2..5f4d67f93c 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -487,6 +487,10 @@ rootfs_reproducible () {
487 find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \ 487 find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \
488 sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g' 488 sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'
489 fi 489 fi
490
491 if [ -f ${IMAGE_ROOTFS}${localstatedir}/lib/opkg/status ]; then
492 sed -i 's/^Installed-Time: .*/Installed-Time: ${REPRODUCIBLE_TIMESTAMP_ROOTFS}/' ${IMAGE_ROOTFS}${localstatedir}/lib/opkg/status
493 fi
490 fi 494 fi
491} 495}
492 496