DATETIME is being used in BUILD_ID and some other places to mark the
build time, let's use it as system timestamp, to have a consistent
system-wide timestamp.

Signed-off-by: Ming Liu <[email protected]>
---
 meta/classes-recipe/rootfs-postcommands.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass 
b/meta/classes-recipe/rootfs-postcommands.bbclass
index f0c7ee658d..43001e09b5 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -424,11 +424,12 @@ rootfs_update_timestamp () {
                # Convert UTC into %4Y%2m%2d%2H%2M%2S
                sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} 
+%4Y%2m%2d%2H%2M%2S`
        else
-               sformatted=`date -u +%4Y%2m%2d%2H%2M%2S`
+               sformatted=${DATETIME}
        fi
        echo $sformatted > ${IMAGE_ROOTFS}/etc/timestamp
        bbnote "rootfs_update_timestamp: set /etc/timestamp to $sformatted"
 }
+rootfs_update_timestamp[vardepsexclude] = "DATETIME"
 
 # Prevent X from being started
 rootfs_no_x_startup () {
-- 
2.43.0

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

Reply via email to