From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7342481464494129152 X-Forwarded-Encrypted: i=2; AJvYcCW8l7TDys7+qf/skrUEF57v6HED47+S9R20zXhQXYgryq2n1Lbg1vvxVyHmUZosuosLOXScD/BgnNJmCOJwVJorByoSnj/grO9wAmQ= X-Received: by 2002:a2e:b74e:0:b0:2d2:4783:872a with SMTP id k14-20020a2eb74e000000b002d24783872amr419407ljo.29.1709612369793; Mon, 04 Mar 2024 20:19:29 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:651c:22e:b0:2d2:4ff7:7923 with SMTP id z14-20020a05651c022e00b002d24ff77923ls17349ljn.1.-pod-prod-02-eu; Mon, 04 Mar 2024 20:19:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVJoJybR9jEL1HQxeC46Li74kpuM+ZFpLO8EKeO1iN4U7TT3HxYD36TP4n2ISdMFmUcdU0CURamKdJvHX61aw/fQXKp6/r1smha4Yg= X-Google-Smtp-Source: AGHT+IGM2fz2Fc0nuZ40E/kl+AYKrO7R597NUiDANvL/yhLp+1vtjh9xPMEK50UKfMWw3ik6hDlR X-Received: by 2002:a05:6512:68d:b0:511:4253:3a8b with SMTP id t13-20020a056512068d00b0051142533a8bmr494892lfe.42.1709612367025; Mon, 04 Mar 2024 20:19:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709612367; cv=none; d=google.com; s=arc-20160816; b=gvBgfoaTQDmhjcKWvOvMwDrjPhOnsRjIV+3uPqof/4xnCTb4DERscg05Pl7qhwIxhi 9XS5N4tDHNkE0KXNX712FHr51sqmf8sqvvLp+60IymA4uAV1fAkBW8zonESVwwTeRFxb hQbca6wqzmFBw/SCCbgz2KWWKCU9py05D61Z/qBtPGDHnVGvg9C0gHrmvJoboXUdvSI4 pnsw6B1zdgUfuDqkmKYGGfVoMOeDMr1PczFVd499Ra65Ye6p85Pa5y9QjgTBhSUZEDOQ 7JJ/xY4l6e0RcPHRaPIEFsrlI4+5KavWKPTjfVWoObhOcirMLVaDe5iOvaNPN6S1K5hp KpwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id; bh=+SgHddJDfgiVzdgho1yyxPKWzXtVNHVWodwkHMys5So=; fh=e/d5o/z7U5+odM6x+PgeL9fcbEqBYKpoSsnj0jtl7Rs=; b=JiAUvUFNyiMgwBgIyyuTAEGjg19Z88LbWaFVjvvJAKwkOhDyWeRyVi2pj20UhH9FSI X+CEKNYUcUS9Epj8AYoDh4TswXV3og4O/hBa13975tgyf8FBileGkrAkZcdugSKv0fxL u9d0hpDKGmL7sOu4c56I7ihoCmbVfmZWH+n/BV4O4eUZ1Q2Kzo2E441C5LPOxgAQD/rP 2nE/EF27/4nSgmXE7WayxqWfX9h/BRa4ELFDq+Qv+boSedMICTls70iDrKeKOH7bKIdx iKP4p4wNqP7DN/J7C1zAYEjGqZfa4XRMrOv73VwcDQKzgWnItnLRrTnFGyjK6FaO4AZH murQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id bi25-20020a0565120e9900b005132cbccbb3si100208lfb.7.2024.03.04.20.19.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2024 20:19:26 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from [127.0.0.1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 4254JO8P000636 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 5 Mar 2024 05:19:25 +0100 Message-ID: <54315d685adbc3689939b1627a8290fab40d322b.camel@ilbers.de> Subject: Re: [PATCH 2/2] image-account-extension.bbclass: Export SOURCE_DATE_EPOCH variable From: Uladzimir Bely To: Adithya Balakumar , isar-users@googlegroups.com Date: Tue, 05 Mar 2024 07:19:24 +0300 In-Reply-To: <20240304103716.1100116-3-Adithya.Balakumar@toshiba-tsip.com> References: <20240304103716.1100116-1-Adithya.Balakumar@toshiba-tsip.com> <20240304103716.1100116-3-Adithya.Balakumar@toshiba-tsip.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (by Flathub.org) MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: AL+j6e8Lse9Q 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 =20 > > reproducible. > >=20 > > Adding the SOURCE_DATE_EPOCH variable to environment ensures that > > sp_lstchg value is set with respect to the SOURCE_DATE_EPOCH value. > >=20 > > Signed-off-by: Adithya Balakumar <[Adithya.Balakumar@toshiba-tsip.com](mailto:Adithya.Balakumar@toshiba-tsip= .com )> > > --- > > =C2=A0meta/classes/image-account-extension.bbclass | 5 +++++ > > =C2=A01 file changed, 5 insertions(+) > >=20 > > diff --git a/meta/classes/image-account-extension.bbclass =20 > > 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: > > =C2=A0 > > =C2=A0ROOTFS_POSTPROCESS_COMMAND +=3D "image_postprocess_accounts" > > =C2=A0python image_postprocess_accounts() { > > +=C2=A0=C2=A0=C2=A0 import os > > +=C2=A0=C2=A0=C2=A0 if os.getenv("SOURCE_DATE_EPOCH") =3D=3D None: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 source_date_epoch =3D= d.getVar("SOURCE_DATE_EPOCH") > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 os.environ["SOURCE_DA= TE_EPOCH"] =3D 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: Er= ror executing a python function in exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was= : =20 File: 'exec_func_python() autogenerated', lineno: 2, function: = =20 0001: =20 *** 0002:image_postprocess_accounts(d) =20 0003: =20 File: '/workspace/build/isar_ub_devel_fast/552/meta/classes/image-account-e= xtension.bbclass', lineno: 137, function: image_postprocess_accounts =20 0133:python image_postprocess_accounts() { =20 0134: import os =20 0135: if os.getenv("SOURCE_DATE_EPOCH") =3D=3D None: =20 0136: source_date_epoch =3D d.getVar("SOURCE_DATE_EPOCH") =20 *** 0137: os.environ["SOURCE_DATE_EPOCH"] =3D source_date_epoch = =20 0138: =20 0139: image_create_groups(d) =20 0140: image_create_users(d) =20 0141:} =20 File: '', lineno: 684, function: __setitem__ =20 File "", line 684, in __setitem__ File: '', lineno: 758, function: encode =20 File "", line 758, in encode Exception: TypeError: str expected, not NoneType > > =C2=A0=C2=A0=C2=A0=C2=A0 image_create_groups(d) > > =C2=A0=C2=A0=C2=A0=C2=A0 image_create_users(d) > > =C2=A0} > > --=20 > > 2.39.2 > >=20 > >