Skip to contentSkip to conversation

Revert "rootfs: Make BUILDNAME a weak default in reproducible_build_simple"

PATCH In review Peter Kjellerstedt 2 participants 2 messages Feb 9, 2020 – Feb 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "rootfs: Make BUILDNAME a weak default in reproducible_build_simple"

This reverts commit 8380df6566db49ef184b837432558750f77f592f.

Giving BUILDNAME a static default in reproducible_build_simple.bbclass to have /etc/version be generated with that name lead to other users of BUILDNAME no longer working as expected. E.g., buildstats.bcclass would now write its information in a single directory, overwriting the statistics for each build.

---
 meta/classes/reproducible_build_simple.bbclass | 1 -
 meta/classes/rootfs-postcommands.bbclass       | 5 +++++
 2 files changed, 5 insertions(+), 1 deletion(-)
meta/classes/reproducible_build_simple.bbclass +0 -1
index 3e5fd82432..393372993d 100644
@@ -7,4 +7,3 @@ export PERL_HASH_SEED = "0"
 export SOURCE_DATE_EPOCH ??= "1520598896"
 
 REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
-BUILDNAME ??= "${REPRODUCIBLE_TIMESTAMP_ROOTFS}"
meta/classes/rootfs-postcommands.bbclass +5 -0
index e40097444d..2f171836fa 100644
@@ -356,6 +356,11 @@ python rootfs_log_check_recommends() {
 # Perform any additional adjustments needed to make rootf binary reproducible
 rootfs_reproducible () {
 	if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
+		# Convert UTC into %4Y%2m%2d%2H%2M%2S
+		sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
+		echo $sformatted > ${IMAGE_ROOTFS}/etc/version
+		bbnote "rootfs_reproducible: set /etc/version to $sformatted"
+
 		if [ -d ${IMAGE_ROOTFS}${sysconfdir}/gconf ]; then
 			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'
Signature · 1 line
2.21.1
#1 lore raw

*ping*

//Peter

Quoted 62 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 9 februari 2020 07:07
To: [email protected]
Subject: [OE-core] [PATCH] Revert "rootfs: Make BUILDNAME a weak default in reproducible_build_simple"

This reverts commit 8380df6566db49ef184b837432558750f77f592f.

Giving BUILDNAME a static default in reproducible_build_simple.bbclass to have /etc/version be generated with that name lead to other users of BUILDNAME no longer working as expected. E.g., buildstats.bcclass would now write its information in a single directory, overwriting the statistics for each build.

---
 meta/classes/reproducible_build_simple.bbclass | 1 -
 meta/classes/rootfs-postcommands.bbclass       | 5 +++++
 2 files changed, 5 insertions(+), 1 deletion(-)
meta/classes/reproducible_build_simple.bbclass +0 -1
index 3e5fd82432..393372993d 100644
@@ -7,4 +7,3 @@ export PERL_HASH_SEED = "0"
 export SOURCE_DATE_EPOCH ??= "1520598896"
 
 REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
-BUILDNAME ??= "${REPRODUCIBLE_TIMESTAMP_ROOTFS}"
meta/classes/rootfs-postcommands.bbclass +0 -0
index e40097444d..2f171836fa 100644
@@ -356,6 +356,11 @@ python rootfs_log_check_recommends() {
 # Perform any additional adjustments needed to make rootf binary

reproducible
rootfs_reproducible () {

meta/classes/rootfs-postcommands.bbclass +2 -0
 	if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
+		# Convert UTC into %4Y%2m%2d%2H%2M%2S
+		sformatted=`date -u -d

@${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`

meta/classes/rootfs-postcommands.bbclass +2 -0
+		echo $sformatted > ${IMAGE_ROOTFS}/etc/version
+		bbnote "rootfs_reproducible: set /etc/version to

$sformatted"

meta/classes/rootfs-postcommands.bbclass +1 -0
+
 		if [ -d ${IMAGE_ROOTFS}${sysconfdir}/gconf ]; then
 			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' --
2.21.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core