public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
To: isar-users@googlegroups.com, amikan@ilbers.de
Cc: kazuhiro3.hayashi@toshiba.co.jp, dinesh.kumar@toshiba-tsip.com,
	shivanand.kunijadar@toshiba-tsip.com,
	sai.sathujoda@toshiba-tsip.com,
	adithya.balakumar@toshiba-tsip.com
Subject: [PATCH v2 2/2] image-account-extension.bbclass: Export SOURCE_DATE_EPOCH variable
Date: Wed,  6 Mar 2024 11:44:23 +0530	[thread overview]
Message-ID: <20240306061423.1088541-3-Adithya.Balakumar@toshiba-tsip.com> (raw)
In-Reply-To: <20240306061423.1088541-1-Adithya.Balakumar@toshiba-tsip.com>

When a user account is created / updated, the third field (sp_lstchg)
in the /etc/shadow file could be modified. The third field contains
the date of the last password change expressed as the number of days
since Jan 1,1970. When the images are built on different days, the
value of sp_lstchg will be different making the image not reproducible.

Adding the SOURCE_DATE_EPOCH variable to environment ensures that
sp_lstchg value is set with respect to the SOURCE_DATE_EPOCH value.

Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
---
 meta/classes/image-account-extension.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass
index 9e67cb91..3d4e1d1d 100644
--- a/meta/classes/image-account-extension.bbclass
+++ b/meta/classes/image-account-extension.bbclass
@@ -131,6 +131,10 @@ def image_create_users(d: "DataSmart") -> None:
 
 ROOTFS_POSTPROCESS_COMMAND += "image_postprocess_accounts"
 python image_postprocess_accounts() {
+    import os
+    if d.getVar("SOURCE_DATE_EPOCH") != None:
+        os.environ["SOURCE_DATE_EPOCH"] = d.getVar("SOURCE_DATE_EPOCH")
+ 
     image_create_groups(d)
     image_create_users(d)
 }
-- 
2.39.2



  parent reply	other threads:[~2024-03-06  6:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  6:14 [PATCH v2 0/2] Fix reproducibility of /etc/shadow file when image built on different days Adithya Balakumar
2024-03-06  6:14 ` [PATCH v2 1/2] isar-bootstrap.inc: Export SOURCE_DATE_EPOCH variable Adithya Balakumar
2024-03-06  6:14 ` Adithya Balakumar [this message]
2024-03-11 12:09 ` [PATCH v2 0/2] Fix reproducibility of /etc/shadow file when image built on different days Uladzimir Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240306061423.1088541-3-Adithya.Balakumar@toshiba-tsip.com \
    --to=adithya.balakumar@toshiba-tsip.com \
    --cc=amikan@ilbers.de \
    --cc=dinesh.kumar@toshiba-tsip.com \
    --cc=isar-users@googlegroups.com \
    --cc=kazuhiro3.hayashi@toshiba.co.jp \
    --cc=sai.sathujoda@toshiba-tsip.com \
    --cc=shivanand.kunijadar@toshiba-tsip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox