public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: <Adithya.Balakumar@toshiba-tsip.com>
To: <ubely@ilbers.de>, <isar-users@googlegroups.com>
Subject: RE: [PATCH 2/2] image-account-extension.bbclass: Export SOURCE_DATE_EPOCH variable
Date: Tue, 5 Mar 2024 04:38:20 +0000	[thread overview]
Message-ID: <TYCPR01MB966971BD99B54AF368DE5ADDC4222@TYCPR01MB9669.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <54315d685adbc3689939b1627a8290fab40d322b.camel@ilbers.de>

I Apologize. Will fix this is in v2.

Thanks and Regards,
Adithya Balakumar

-----Original Message-----
From: Uladzimir Bely <ubely@ilbers.de> 
Sent: Tuesday, March 5, 2024 9:49 AM
To: balakumar adithya(TSIP TEUR) <Adithya.Balakumar@toshiba-tsip.com>; isar-users@googlegroups.com
Subject: Re: [PATCH 2/2] image-account-extension.bbclass: Export SOURCE_DATE_EPOCH variable

On Mon, 2024-03-04 at 16:07 +0530, Adithya Balakumar wrote:

> > 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](mailto:Adithya.Balakumar@toshiba-tsip.com
)>
> > ---
> >  meta/classes/image-account-extension.bbclass | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/meta/classes/image-account-extension.bbclass
> > b/meta/classes/image-account-extension.bbclass
> > index 9e67cb91..5fe67106 100644
> > --- a/meta/classes/image-account-extension.bbclass
> > +++ b/meta/classes/image-account-extension.bbclass
> > @@ -131,6 +131,11 @@ def image_create_users(d: "DataSmart") ->
None:
> >  
> >  ROOTFS_POSTPROCESS_COMMAND += "image_postprocess_accounts"
> >  python image_postprocess_accounts() {
> > +    import os
> > +    if os.getenv("SOURCE_DATE_EPOCH") == None:
> > +         source_date_epoch = d.getVar("SOURCE_DATE_EPOCH")
> > +         os.environ["SOURCE_DATE_EPOCH"] = source_date_epoch
> > +


If bitbake var is empty, this fails the following way:

ERROR: mc:qemuamd64-bullseye:isar-image-ci-1.0-r0 do_rootfs_postprocess: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:  
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
0001:  
*** 0002:image_postprocess_accounts(d)
0003:  
File: '/workspace/build/isar_ub_devel_fast/552/meta/classes/image-account-extension.bbclass', lineno: 137, function: image_postprocess_accounts 0133:python image_postprocess_accounts() {  
0134:    import os  
0135:    if os.getenv("SOURCE_DATE_EPOCH") == None:  
0136:         source_date_epoch = d.getVar("SOURCE_DATE_EPOCH")  
*** 0137:         os.environ["SOURCE_DATE_EPOCH"] = source_date_epoch  
0138:  
0139:    image_create_groups(d)  
0140:    image_create_users(d)  
0141:}
File: '<frozen os>', lineno: 684, function: __setitem__ File "<frozen os>", line 684, in __setitem__

File: '<frozen os>', lineno: 758, function: encode File "<frozen os>", line 758, in encode

Exception: TypeError: str expected, not NoneType


> >      image_create_groups(d)
> >      image_create_users(d)
> >  }
> > --
> > 2.39.2
> > 
> >




  reply	other threads:[~2024-03-05  4:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 10:37 [PATCH 0/2] Fix reproducibility of /etc/shadow file when image built on different days Adithya Balakumar
2024-03-04 10:37 ` [PATCH 1/2] isar-bootstrap.inc: Export SOURCE_DATE_EPOCH variable Adithya Balakumar
2024-03-04 16:06   ` Gylstorff Quirin
2024-03-05  4:33     ` Adithya.Balakumar
2024-03-04 10:37 ` [PATCH 2/2] image-account-extension.bbclass: " Adithya Balakumar
2024-03-05  4:19   ` Uladzimir Bely
2024-03-05  4:38     ` Adithya.Balakumar [this message]
2024-03-04 14:30 ` [PATCH 0/2] Fix reproducibility of /etc/shadow file when image built on different days Jan Kiszka
2024-03-04 14:34 ` MOESSBAUER, Felix

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=TYCPR01MB966971BD99B54AF368DE5ADDC4222@TYCPR01MB9669.jpnprd01.prod.outlook.com \
    --to=adithya.balakumar@toshiba-tsip.com \
    --cc=isar-users@googlegroups.com \
    --cc=ubely@ilbers.de \
    /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