All of lore.kernel.org
 help / color / mirror / Atom feed
* [isar-cip-core] dosfstools: Add recipe to build it locally
@ 2023-09-22 10:12 venkata.pyla
  2023-09-22 14:26 ` Jan Kiszka
  0 siblings, 1 reply; 20+ messages in thread
From: venkata.pyla @ 2023-09-22 10:12 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: venkata pyla, dinesh.kumar, kazuhiro3.hayashi

From: venkata pyla <venkata.pyla@toshiba-tsip.com>

mkdosfs doesn't generate fat file-systems reproducibly, due to the
reason that the utility mkfs.fat is not honoring the variable
SOURCE_DATE_EPOCH and including build time stamps in the file system
headers, this issue has been fixed in upstream master branch but not
release yet, so building it locally with the patch.

This local build can be dropped when this patch[1] is available in
Debian releases, this ticket [2] monitors for creating release with
this patch.

[1] https://github.com/dosfstools/dosfstools/commit/8da7bc93315cb0c32ad868f17808468b81fa76ec
[2] https://github.com/dosfstools/dosfstools/issues/179

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
 kas/opt/reproducible.yml                      |   1 +
 .../dosfstools/dosfstools_4.2-1.bb            |  17 ++
 ...ream-fix-for-honoring-SOURCE_DATE_EP.patch | 189 ++++++++++++++++++
 3 files changed, 207 insertions(+)
 create mode 100644 recipes-devtools/dosfstools/dosfstools_4.2-1.bb
 create mode 100644 recipes-devtools/dosfstools/files/0001-patches-Add-upstream-fix-for-honoring-SOURCE_DATE_EP.patch

diff --git a/kas/opt/reproducible.yml b/kas/opt/reproducible.yml
index 9b56b28..fada232 100644
--- a/kas/opt/reproducible.yml
+++ b/kas/opt/reproducible.yml
@@ -15,3 +15,4 @@ local_conf_header:
   reproducible-builds: |
     SOURCE_DATE_EPOCH := "${@bb.process.run("git -C ${LAYERDIR_cip-core} log -1 --pretty=%ct | tr -d '\n'")[0]}"
     WIC_DEPLOY_PARTITIONS = "1"
+    IMAGER_BUILD_DEPS += "dosfstools"
diff --git a/recipes-devtools/dosfstools/dosfstools_4.2-1.bb b/recipes-devtools/dosfstools/dosfstools_4.2-1.bb
new file mode 100644
index 0000000..009d99d
--- /dev/null
+++ b/recipes-devtools/dosfstools/dosfstools_4.2-1.bb
@@ -0,0 +1,17 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation 2023
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg-gbp
+
+SRC_URI = "git://salsa.debian.org/debian/dosfstools.git;protocol=https;branch=master"
+SRC_URI += "file://0001-patches-Add-upstream-fix-for-honoring-SOURCE_DATE_EP.patch"
+SRCREV = "f59f4850586e88c945a922f5f9cc48b5da6c54fa"
+
+# this is a host tool
+PACKAGE_ARCH = "${HOST_ARCH}"
+
diff --git a/recipes-devtools/dosfstools/files/0001-patches-Add-upstream-fix-for-honoring-SOURCE_DATE_EP.patch b/recipes-devtools/dosfstools/files/0001-patches-Add-upstream-fix-for-honoring-SOURCE_DATE_EP.patch
new file mode 100644
index 0000000..30d6e2a
--- /dev/null
+++ b/recipes-devtools/dosfstools/files/0001-patches-Add-upstream-fix-for-honoring-SOURCE_DATE_EP.patch
@@ -0,0 +1,189 @@
+From dec30e5750511558f6c6b5134b51a67162174c05 Mon Sep 17 00:00:00 2001
+From: venkata pyla <venkata.pyla@toshiba-tsip.com>
+Date: Fri, 22 Sep 2023 14:11:47 +0530
+Subject: [PATCH] patches: Add upstream fix for honoring SOURCE_DATE_EPOCH
+
+Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
+---
+ ...Honor-the-SOURCE_DATE_EPOCH-variable.patch | 160 ++++++++++++++++++
+ debian/patches/series                         |   1 +
+ 2 files changed, 161 insertions(+)
+ create mode 100644 debian/patches/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
+ create mode 100644 debian/patches/series
+
+diff --git a/debian/patches/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch b/debian/patches/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
+new file mode 100644
+index 0000000..30c2132
+--- /dev/null
++++ b/debian/patches/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
+@@ -0,0 +1,160 @@
++From 8da7bc93315cb0c32ad868f17808468b81fa76ec Mon Sep 17 00:00:00 2001
++From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
++Date: Wed, 5 Dec 2018 19:52:51 +0100
++Subject: [PATCH] Honor the SOURCE_DATE_EPOCH variable
++MIME-Version: 1.0
++Content-Type: text/plain; charset=UTF-8
++Content-Transfer-Encoding: 8bit
++
++Implement the SOURCE_DATE_EPOCH specification[1] for reproducible
++builds. If SOURCE_DATE_EPOCH is set, use it as timestamp instead of the
++current time.
++
++[1] https://reproducible-builds.org/specs/source-date-epoch/
++
++Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
++---
++ src/boot.c     | 23 +++++++++++++++++++++--
++ src/common.c   | 18 ++++++++++++++++--
++ src/mkfs.fat.c | 19 ++++++++++++++++---
++ 3 files changed, 53 insertions(+), 7 deletions(-)
++
++diff --git a/src/boot.c b/src/boot.c
++index 4de450d..8f78e1c 100644
++--- a/src/boot.c
+++++ b/src/boot.c
++@@ -33,6 +33,8 @@
++ #include <stdlib.h>
++ #include <sys/types.h>
++ #include <time.h>
+++#include <errno.h>
+++#include <ctype.h>
++ 
++ #include "common.h"
++ #include "fsck.fat.h"
++@@ -672,6 +674,7 @@ void write_volume_label(DOS_FS * fs, char *label)
++ {
++     time_t now;
++     struct tm *mtime;
+++    char *source_date_epoch = NULL;
++     off_t offset;
++     int created;
++     DIR_ENT de;
++@@ -687,8 +690,24 @@ void write_volume_label(DOS_FS * fs, char *label)
++     if (de.name[0] == 0xe5)
++ 	de.name[0] = 0x05;
++ 
++-    now = time(NULL);
++-    mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
+++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+++    if (source_date_epoch) {
+++        char *tmp = NULL;
+++        long long conversion = 0;
+++        errno = 0;
+++        conversion = strtoll(source_date_epoch, &tmp, 10);
+++        now = conversion;
+++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
+++                || errno != 0 || (long long)now != conversion) {
+++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
+++                source_date_epoch);
+++        }
+++        mtime = gmtime(&now);
+++    } else {
+++        now = time(NULL);
+++        mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
+++    }
+++
++     if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) {
++ 	de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
++ 					   (mtime->tm_min << 5) +
++diff --git a/src/common.c b/src/common.c
++index 6a2e396..4f1afcb 100644
++--- a/src/common.c
+++++ b/src/common.c
++@@ -30,6 +30,7 @@
++ #include <string.h>
++ #include <stdarg.h>
++ #include <errno.h>
+++#include <ctype.h>
++ #include <wctype.h>
++ #include <termios.h>
++ #include <sys/time.h>
++@@ -298,8 +299,21 @@ void check_atari(void)
++ uint32_t generate_volume_id(void)
++ {
++     struct timeval now;
++-
++-    if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
+++    char *source_date_epoch = NULL;
+++
+++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+++    if (source_date_epoch) {
+++        char *tmp = NULL;
+++        long long conversion = 0;
+++        errno = 0;
+++        conversion = strtoll(source_date_epoch, &tmp, 10);
+++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
+++                || errno != 0) {
+++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
+++                source_date_epoch);
+++        }
+++        return (uint32_t)conversion;
+++    } else if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
++         srand(getpid());
++         /* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
++         return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
++diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
++index 37fc8ff..1948635 100644
++--- a/src/mkfs.fat.c
+++++ b/src/mkfs.fat.c
++@@ -1074,7 +1074,7 @@ static void setup_tables(void)
++         }
++ 
++         /* If is not available then generate random 32 bit disk signature */
++-        if (invariant)
+++        if (invariant || getenv("SOURCE_DATE_EPOCH"))
++             disk_sig = volume_id;
++         else if (!disk_sig)
++             disk_sig = generate_volume_id();
++@@ -1287,7 +1287,7 @@ static void setup_tables(void)
++ 	    de->name[0] = 0x05;
++ 	de->attr = ATTR_VOLUME;
++ 	if (create_time != (time_t)-1) {
++-	    if (!invariant)
+++	    if (!invariant && !getenv("SOURCE_DATE_EPOCH"))
++ 		ctime = localtime(&create_time);
++ 	    else
++ 		ctime = gmtime(&create_time);
++@@ -1477,6 +1477,7 @@ int main(int argc, char **argv)
++     int blocks_specified = 0;
++     struct timeval create_timeval;
++     long long conversion;
+++    char *source_date_epoch = NULL;
++ 
++     enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET};
++     const struct option long_options[] = {
++@@ -1497,8 +1498,20 @@ int main(int argc, char **argv)
++ 	    program_name = p + 1;
++     }
++ 
++-    if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1)
+++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+++    if (source_date_epoch) {
+++        errno = 0;
+++        conversion = strtoll(source_date_epoch, &tmp, 10);
+++        create_time = conversion;
+++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
+++                || errno != 0 || (long long)create_time != conversion) {
+++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
+++                source_date_epoch);
+++        }
+++    } else if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1) {
++         create_time = create_timeval.tv_sec;
+++    }
+++
++     volume_id = generate_volume_id();
++     check_atari();
++ 
++-- 
++2.39.2
++
+diff --git a/debian/patches/series b/debian/patches/series
+new file mode 100644
+index 0000000..f52817f
+--- /dev/null
++++ b/debian/patches/series
+@@ -0,0 +1 @@
++0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
+-- 
+2.39.2
+
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [isar-cip-core] dosfstools: Add recipe to build it locally
  2023-09-22 10:12 [isar-cip-core] dosfstools: Add recipe to build it locally venkata.pyla
@ 2023-09-22 14:26 ` Jan Kiszka
  2023-09-24 15:28   ` Venkata.Pyla
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Kiszka @ 2023-09-22 14:26 UTC (permalink / raw)
  To: venkata.pyla, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 22.09.23 12:12, venkata.pyla@toshiba-tsip.com wrote:
> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> 
> mkdosfs doesn't generate fat file-systems reproducibly, due to the
> reason that the utility mkfs.fat is not honoring the variable
> SOURCE_DATE_EPOCH and including build time stamps in the file system
> headers, this issue has been fixed in upstream master branch but not
> release yet, so building it locally with the patch.
> 
> This local build can be dropped when this patch[1] is available in
> Debian releases, this ticket [2] monitors for creating release with
> this patch.
> 
> [1] https://github.com/dosfstools/dosfstools/commit/8da7bc93315cb0c32ad868f17808468b81fa76ec
> [2] https://github.com/dosfstools/dosfstools/issues/179
> 
> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> ---
>  kas/opt/reproducible.yml                      |   1 +
>  .../dosfstools/dosfstools_4.2-1.bb            |  17 ++
>  ...ream-fix-for-honoring-SOURCE_DATE_EP.patch | 189 ++++++++++++++++++
>  3 files changed, 207 insertions(+)
>  create mode 100644 recipes-devtools/dosfstools/dosfstools_4.2-1.bb
>  create mode 100644 recipes-devtools/dosfstools/files/0001-patches-Add-upstream-fix-for-honoring-SOURCE_DATE_EP.patch
> 
> diff --git a/kas/opt/reproducible.yml b/kas/opt/reproducible.yml
> index 9b56b28..fada232 100644
> --- a/kas/opt/reproducible.yml
> +++ b/kas/opt/reproducible.yml
> @@ -15,3 +15,4 @@ local_conf_header:
>    reproducible-builds: |
>      SOURCE_DATE_EPOCH := "${@bb.process.run("git -C ${LAYERDIR_cip-core} log -1 --pretty=%ct | tr -d '\n'")[0]}"
>      WIC_DEPLOY_PARTITIONS = "1"
> +    IMAGER_BUILD_DEPS += "dosfstools"

This will lead to funny effects when also the image requests dosfstools
and HOST_ARCH, thus PACKAGE_ARCH == DISTRO_ARCH: If the package is built
early enough, the target image will get our custom version. If it is
built "too late", the distro version is used. All that would be
non-reproducible.

I would recommend to declare dosfstools also as dependency of our images 
(DEPENDS, not IMAGE_INSTALL).

> diff --git a/recipes-devtools/dosfstools/dosfstools_4.2-1.bb b/recipes-devtools/dosfstools/dosfstools_4.2-1.bb
> new file mode 100644
> index 0000000..009d99d
> --- /dev/null
> +++ b/recipes-devtools/dosfstools/dosfstools_4.2-1.bb
> @@ -0,0 +1,17 @@
> +#
> +# CIP Core, generic profile
> +#
> +# Copyright (c) Toshiba Corporation 2023
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +inherit dpkg-gbp
> +
> +SRC_URI = "git://salsa.debian.org/debian/dosfstools.git;protocol=https;branch=master"
> +SRC_URI += "file://0001-patches-Add-upstream-fix-for-honoring-SOURCE_DATE_EP.patch"
> +SRCREV = "f59f4850586e88c945a922f5f9cc48b5da6c54fa"
> +
> +# this is a host tool
> +PACKAGE_ARCH = "${HOST_ARCH}"
> +

Let's try to ride Debian updates:

[recipes-devtools/dosfstools/dosfstools_latest.bb]
...

inherit dpkg

CHANGELOG_V="<orig-version>+siemens"

SRC_URI = "apt://${PN}"
SRC_URI += "file://0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch;apply=no"

# this is a host tool
PACKAGE_ARCH = "${HOST_ARCH}"

do_prepare_build() {
	deb_add_changelog

	cd ${S}
	quilt import ${WORKDIR}/*.patch
	quilt push -a
}


That patch file is now the upstream patch, not the patch-adding patch.

Jan

-- 
Siemens AG, Technology
Linux Expert Center



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [isar-cip-core] dosfstools: Add recipe to build it locally
  2023-09-22 14:26 ` Jan Kiszka
@ 2023-09-24 15:28   ` Venkata.Pyla
  2023-09-25  5:35     ` Jan Kiszka
  0 siblings, 1 reply; 20+ messages in thread
From: Venkata.Pyla @ 2023-09-24 15:28 UTC (permalink / raw)
  To: jan.kiszka, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi



> -----Original Message-----
> From: Jan Kiszka <jan.kiszka@siemens.com>
> Sent: Friday, September 22, 2023 7:56 PM
> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
> tsip.com>; cip-dev@lists.cip-project.org
> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
> <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [isar-cip-core] dosfstools: Add recipe to build it locally
> 
> On 22.09.23 12:12, venkata.pyla@toshiba-tsip.com wrote:
> > From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> >
> > mkdosfs doesn't generate fat file-systems reproducibly, due to the
> > reason that the utility mkfs.fat is not honoring the variable
> > SOURCE_DATE_EPOCH and including build time stamps in the file system
> > headers, this issue has been fixed in upstream master branch but not
> > release yet, so building it locally with the patch.
> >
> > This local build can be dropped when this patch[1] is available in
> > Debian releases, this ticket [2] monitors for creating release with
> > this patch.
> >
> > [1]
> >
> https://github.com/dosfstools/dosfstools/commit/8da7bc93315cb0c32ad868
> > f17808468b81fa76ec [2]
> > https://github.com/dosfstools/dosfstools/issues/179
> >
> > Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> > ---
> >  kas/opt/reproducible.yml                      |   1 +
> >  .../dosfstools/dosfstools_4.2-1.bb            |  17 ++
> >  ...ream-fix-for-honoring-SOURCE_DATE_EP.patch | 189
> > ++++++++++++++++++
> >  3 files changed, 207 insertions(+)
> >  create mode 100644 recipes-devtools/dosfstools/dosfstools_4.2-1.bb
> >  create mode 100644
> > recipes-devtools/dosfstools/files/0001-patches-Add-upstream-fix-for-ho
> > noring-SOURCE_DATE_EP.patch
> >
> > diff --git a/kas/opt/reproducible.yml b/kas/opt/reproducible.yml index
> > 9b56b28..fada232 100644
> > --- a/kas/opt/reproducible.yml
> > +++ b/kas/opt/reproducible.yml
> > @@ -15,3 +15,4 @@ local_conf_header:
> >    reproducible-builds: |
> >      SOURCE_DATE_EPOCH := "${@bb.process.run("git -C ${LAYERDIR_cip-
> core} log -1 --pretty=%ct | tr -d '\n'")[0]}"
> >      WIC_DEPLOY_PARTITIONS = "1"
> > +    IMAGER_BUILD_DEPS += "dosfstools"
> 
> This will lead to funny effects when also the image requests dosfstools and
> HOST_ARCH, thus PACKAGE_ARCH == DISTRO_ARCH: If the package is built
> early enough, the target image will get our custom version. If it is built "too
> late", the distro version is used. All that would be non-reproducible.
> 
> I would recommend to declare dosfstools also as dependency of our images
> (DEPENDS, not IMAGE_INSTALL).
Does it not same, adding it to IMAGER_BUILD_DEPS += "dosfstools" which will eventually add it to the DEPENDS += "${IMAGER_BUILD_DEPS}" in image.bbclass thus the package dosfstools will build prior to the installing it to the imag?

Correct me if I am wrong.

[1] https://github.com/ilbers/isar/blob/05710647db6227be04bd6db95fa4e4000b508412/meta/classes/image-tools-extension.bbclass#L12

> 
> > diff --git a/recipes-devtools/dosfstools/dosfstools_4.2-1.bb
> > b/recipes-devtools/dosfstools/dosfstools_4.2-1.bb
> > new file mode 100644
> > index 0000000..009d99d
> > --- /dev/null
> > +++ b/recipes-devtools/dosfstools/dosfstools_4.2-1.bb
> > @@ -0,0 +1,17 @@
> > +#
> > +# CIP Core, generic profile
> > +#
> > +# Copyright (c) Toshiba Corporation 2023 # # SPDX-License-Identifier:
> > +MIT #
> > +
> > +inherit dpkg-gbp
> > +
> > +SRC_URI =
> "git://salsa.debian.org/debian/dosfstools.git;protocol=https;branch=master"
> > +SRC_URI += "file://0001-patches-Add-upstream-fix-for-honoring-
> SOURCE_DATE_EP.patch"
> > +SRCREV = "f59f4850586e88c945a922f5f9cc48b5da6c54fa"
> > +
> > +# this is a host tool
> > +PACKAGE_ARCH = "${HOST_ARCH}"
> > +
> 
> Let's try to ride Debian updates:
> 
> [recipes-devtools/dosfstools/dosfstools_latest.bb]
> ...
> 
> inherit dpkg
> 
> CHANGELOG_V="<orig-version>+siemens"
> 
> SRC_URI = "apt://${PN}"
> SRC_URI += "file://0001-Honor-the-SOURCE_DATE_EPOCH-
> variable.patch;apply=no"
> 
> # this is a host tool
> PACKAGE_ARCH = "${HOST_ARCH}"
> 
> do_prepare_build() {
> 	deb_add_changelog
> 
> 	cd ${S}
> 	quilt import ${WORKDIR}/*.patch
> 	quilt push -a
> }
> 
> 
> That patch file is now the upstream patch, not the patch-adding patch.
> 
> Jan
> 
> --
> Siemens AG, Technology
> Linux Expert Center

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [isar-cip-core] dosfstools: Add recipe to build it locally
  2023-09-24 15:28   ` Venkata.Pyla
@ 2023-09-25  5:35     ` Jan Kiszka
  2023-09-25 16:58       ` [isar-cip-core v2 0/2] Add dosfstools recipe venkata.pyla
                         ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Jan Kiszka @ 2023-09-25  5:35 UTC (permalink / raw)
  To: Venkata.Pyla, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 24.09.23 17:28, Venkata.Pyla@toshiba-tsip.com wrote:
> 
> 
>> -----Original Message-----
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>> Sent: Friday, September 22, 2023 7:56 PM
>> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
>> tsip.com>; cip-dev@lists.cip-project.org
>> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
>> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
>> <kazuhiro3.hayashi@toshiba.co.jp>
>> Subject: Re: [isar-cip-core] dosfstools: Add recipe to build it locally
>>
>> On 22.09.23 12:12, venkata.pyla@toshiba-tsip.com wrote:
>>> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>>
>>> mkdosfs doesn't generate fat file-systems reproducibly, due to the
>>> reason that the utility mkfs.fat is not honoring the variable
>>> SOURCE_DATE_EPOCH and including build time stamps in the file system
>>> headers, this issue has been fixed in upstream master branch but not
>>> release yet, so building it locally with the patch.
>>>
>>> This local build can be dropped when this patch[1] is available in
>>> Debian releases, this ticket [2] monitors for creating release with
>>> this patch.
>>>
>>> [1]
>>>
>> https://github.com/dosfstools/dosfstools/commit/8da7bc93315cb0c32ad868
>>> f17808468b81fa76ec [2]
>>> https://github.com/dosfstools/dosfstools/issues/179
>>>
>>> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>> ---
>>>  kas/opt/reproducible.yml                      |   1 +
>>>  .../dosfstools/dosfstools_4.2-1.bb            |  17 ++
>>>  ...ream-fix-for-honoring-SOURCE_DATE_EP.patch | 189
>>> ++++++++++++++++++
>>>  3 files changed, 207 insertions(+)
>>>  create mode 100644 recipes-devtools/dosfstools/dosfstools_4.2-1.bb
>>>  create mode 100644
>>> recipes-devtools/dosfstools/files/0001-patches-Add-upstream-fix-for-ho
>>> noring-SOURCE_DATE_EP.patch
>>>
>>> diff --git a/kas/opt/reproducible.yml b/kas/opt/reproducible.yml index
>>> 9b56b28..fada232 100644
>>> --- a/kas/opt/reproducible.yml
>>> +++ b/kas/opt/reproducible.yml
>>> @@ -15,3 +15,4 @@ local_conf_header:
>>>    reproducible-builds: |
>>>      SOURCE_DATE_EPOCH := "${@bb.process.run("git -C ${LAYERDIR_cip-
>> core} log -1 --pretty=%ct | tr -d '\n'")[0]}"
>>>      WIC_DEPLOY_PARTITIONS = "1"
>>> +    IMAGER_BUILD_DEPS += "dosfstools"
>>
>> This will lead to funny effects when also the image requests dosfstools and
>> HOST_ARCH, thus PACKAGE_ARCH == DISTRO_ARCH: If the package is built
>> early enough, the target image will get our custom version. If it is built "too
>> late", the distro version is used. All that would be non-reproducible.
>>
>> I would recommend to declare dosfstools also as dependency of our images
>> (DEPENDS, not IMAGE_INSTALL).
> Does it not same, adding it to IMAGER_BUILD_DEPS += "dosfstools" which will eventually add it to the DEPENDS += "${IMAGER_BUILD_DEPS}" in image.bbclass thus the package dosfstools will build prior to the installing it to the imag?
> 
> Correct me if I am wrong.
> 
> [1] https://github.com/ilbers/isar/blob/05710647db6227be04bd6db95fa4e4000b508412/meta/classes/image-tools-extension.bbclass#L12

Indeed - not intuitive, but it happens to work like this already.

Jan

-- 
Siemens AG, Technology
Linux Expert Center



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [isar-cip-core v2 0/2] Add dosfstools recipe
  2023-09-25  5:35     ` Jan Kiszka
@ 2023-09-25 16:58       ` venkata.pyla
  2023-09-25 16:58       ` [isar-cip-core v2 1/2] dosfstools: Add recipe to build it locally venkata.pyla
  2023-09-25 16:58       ` [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images venkata.pyla
  2 siblings, 0 replies; 20+ messages in thread
From: venkata.pyla @ 2023-09-25 16:58 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: venkata pyla, dinesh.kumar, kazuhiro3.hayashi

From: venkata pyla <venkata.pyla@toshiba-tsip.com>

Hi Jan,

I modified the commits as per your feedback comments in v1, also added
new commit to add `dosfstools` as a dependency to all images, is that
what expecting?

v2:
  dosfstools: Add recipe to build it locally
     (modified from `dpkg-gbp` to `apt://`)
  images: Add dosfstools as DEPENDENCY to all images
     (new commit)

Kindly provide your feedback.

 kas/opt/reproducible.yml                      |   1 +
 .../images/cip-core-image-kernelci.bb         |   1 +
 .../images/cip-core-image-security.bb         |   1 +
 recipes-core/images/cip-core-image.bb         |   1 +
 recipes-core/images/common-image.inc          |  13 ++
 .../dosfstools/dosfstools_latest.bb           |  28 +++
 ...Honor-the-SOURCE_DATE_EPOCH-variable.patch | 160 ++++++++++++++++++
 7 files changed, 205 insertions(+)
 create mode 100644 recipes-core/images/common-image.inc
 create mode 100644 recipes-devtools/dosfstools/dosfstools_latest.bb
 create mode 100644 recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch

-- 
2.20.1




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [isar-cip-core v2 1/2] dosfstools: Add recipe to build it locally
  2023-09-25  5:35     ` Jan Kiszka
  2023-09-25 16:58       ` [isar-cip-core v2 0/2] Add dosfstools recipe venkata.pyla
@ 2023-09-25 16:58       ` venkata.pyla
  2023-09-25 16:58       ` [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images venkata.pyla
  2 siblings, 0 replies; 20+ messages in thread
From: venkata.pyla @ 2023-09-25 16:58 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: venkata pyla, dinesh.kumar, kazuhiro3.hayashi

From: venkata pyla <venkata.pyla@toshiba-tsip.com>

mkdosfs doesn't generate fat file-systems reproducibly, due to the
reason that the utility mkfs.fat is not honoring the variable
SOURCE_DATE_EPOCH and including build time stamps in the file system
headers, this issue has been fixed in upstream master branch but not
release yet, so building it locally with the patch.

This local build can be dropped when this patch[1] is available in
Debian releases, issue[2] is already available to make release with
this patch.

[1] https://github.com/dosfstools/dosfstools/commit/8da7bc93315cb0c32ad868f17808468b81fa76ec
[2] https://github.com/dosfstools/dosfstools/issues/179

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
 kas/opt/reproducible.yml                      |   1 +
 .../dosfstools/dosfstools_latest.bb           |  28 +++
 ...Honor-the-SOURCE_DATE_EPOCH-variable.patch | 160 ++++++++++++++++++
 3 files changed, 189 insertions(+)
 create mode 100644 recipes-devtools/dosfstools/dosfstools_latest.bb
 create mode 100644 recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch

diff --git a/kas/opt/reproducible.yml b/kas/opt/reproducible.yml
index 9b56b28..fada232 100644
--- a/kas/opt/reproducible.yml
+++ b/kas/opt/reproducible.yml
@@ -15,3 +15,4 @@ local_conf_header:
   reproducible-builds: |
     SOURCE_DATE_EPOCH := "${@bb.process.run("git -C ${LAYERDIR_cip-core} log -1 --pretty=%ct | tr -d '\n'")[0]}"
     WIC_DEPLOY_PARTITIONS = "1"
+    IMAGER_BUILD_DEPS += "dosfstools"
diff --git a/recipes-devtools/dosfstools/dosfstools_latest.bb b/recipes-devtools/dosfstools/dosfstools_latest.bb
new file mode 100644
index 0000000..ebdf983
--- /dev/null
+++ b/recipes-devtools/dosfstools/dosfstools_latest.bb
@@ -0,0 +1,28 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation 2023
+#
+# Authors:
+#  Venkata Pyla <venkata.pyla@toshiba-tsip.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg
+
+CHANGELOG_V="<orig-version>+cip"
+
+SRC_URI = "apt://${PN}"
+SRC_URI += "file://0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch;apply=no"
+
+# this is a host tool
+PACKAGE_ARCH = "${HOST_ARCH}"
+
+do_prepare_build() {
+	deb_add_changelog
+
+	cd ${S}
+	quilt import ${WORKDIR}/*.patch
+	quilt push -a
+}
diff --git a/recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch b/recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
new file mode 100644
index 0000000..30c2132
--- /dev/null
+++ b/recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
@@ -0,0 +1,160 @@
+From 8da7bc93315cb0c32ad868f17808468b81fa76ec Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
+Date: Wed, 5 Dec 2018 19:52:51 +0100
+Subject: [PATCH] Honor the SOURCE_DATE_EPOCH variable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Implement the SOURCE_DATE_EPOCH specification[1] for reproducible
+builds. If SOURCE_DATE_EPOCH is set, use it as timestamp instead of the
+current time.
+
+[1] https://reproducible-builds.org/specs/source-date-epoch/
+
+Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
+---
+ src/boot.c     | 23 +++++++++++++++++++++--
+ src/common.c   | 18 ++++++++++++++++--
+ src/mkfs.fat.c | 19 ++++++++++++++++---
+ 3 files changed, 53 insertions(+), 7 deletions(-)
+
+diff --git a/src/boot.c b/src/boot.c
+index 4de450d..8f78e1c 100644
+--- a/src/boot.c
++++ b/src/boot.c
+@@ -33,6 +33,8 @@
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <time.h>
++#include <errno.h>
++#include <ctype.h>
+ 
+ #include "common.h"
+ #include "fsck.fat.h"
+@@ -672,6 +674,7 @@ void write_volume_label(DOS_FS * fs, char *label)
+ {
+     time_t now;
+     struct tm *mtime;
++    char *source_date_epoch = NULL;
+     off_t offset;
+     int created;
+     DIR_ENT de;
+@@ -687,8 +690,24 @@ void write_volume_label(DOS_FS * fs, char *label)
+     if (de.name[0] == 0xe5)
+ 	de.name[0] = 0x05;
+ 
+-    now = time(NULL);
+-    mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++        char *tmp = NULL;
++        long long conversion = 0;
++        errno = 0;
++        conversion = strtoll(source_date_epoch, &tmp, 10);
++        now = conversion;
++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
++                || errno != 0 || (long long)now != conversion) {
++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
++                source_date_epoch);
++        }
++        mtime = gmtime(&now);
++    } else {
++        now = time(NULL);
++        mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
++    }
++
+     if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) {
+ 	de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
+ 					   (mtime->tm_min << 5) +
+diff --git a/src/common.c b/src/common.c
+index 6a2e396..4f1afcb 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <stdarg.h>
+ #include <errno.h>
++#include <ctype.h>
+ #include <wctype.h>
+ #include <termios.h>
+ #include <sys/time.h>
+@@ -298,8 +299,21 @@ void check_atari(void)
+ uint32_t generate_volume_id(void)
+ {
+     struct timeval now;
+-
+-    if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
++    char *source_date_epoch = NULL;
++
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++        char *tmp = NULL;
++        long long conversion = 0;
++        errno = 0;
++        conversion = strtoll(source_date_epoch, &tmp, 10);
++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
++                || errno != 0) {
++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
++                source_date_epoch);
++        }
++        return (uint32_t)conversion;
++    } else if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
+         srand(getpid());
+         /* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
+         return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
+diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
+index 37fc8ff..1948635 100644
+--- a/src/mkfs.fat.c
++++ b/src/mkfs.fat.c
+@@ -1074,7 +1074,7 @@ static void setup_tables(void)
+         }
+ 
+         /* If is not available then generate random 32 bit disk signature */
+-        if (invariant)
++        if (invariant || getenv("SOURCE_DATE_EPOCH"))
+             disk_sig = volume_id;
+         else if (!disk_sig)
+             disk_sig = generate_volume_id();
+@@ -1287,7 +1287,7 @@ static void setup_tables(void)
+ 	    de->name[0] = 0x05;
+ 	de->attr = ATTR_VOLUME;
+ 	if (create_time != (time_t)-1) {
+-	    if (!invariant)
++	    if (!invariant && !getenv("SOURCE_DATE_EPOCH"))
+ 		ctime = localtime(&create_time);
+ 	    else
+ 		ctime = gmtime(&create_time);
+@@ -1477,6 +1477,7 @@ int main(int argc, char **argv)
+     int blocks_specified = 0;
+     struct timeval create_timeval;
+     long long conversion;
++    char *source_date_epoch = NULL;
+ 
+     enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET};
+     const struct option long_options[] = {
+@@ -1497,8 +1498,20 @@ int main(int argc, char **argv)
+ 	    program_name = p + 1;
+     }
+ 
+-    if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1)
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++        errno = 0;
++        conversion = strtoll(source_date_epoch, &tmp, 10);
++        create_time = conversion;
++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
++                || errno != 0 || (long long)create_time != conversion) {
++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
++                source_date_epoch);
++        }
++    } else if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1) {
+         create_time = create_timeval.tv_sec;
++    }
++
+     volume_id = generate_volume_id();
+     check_atari();
+ 
+-- 
+2.39.2
+
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images
  2023-09-25  5:35     ` Jan Kiszka
  2023-09-25 16:58       ` [isar-cip-core v2 0/2] Add dosfstools recipe venkata.pyla
  2023-09-25 16:58       ` [isar-cip-core v2 1/2] dosfstools: Add recipe to build it locally venkata.pyla
@ 2023-09-25 16:58       ` venkata.pyla
  2023-09-25 17:13         ` Jan Kiszka
  2 siblings, 1 reply; 20+ messages in thread
From: venkata.pyla @ 2023-09-25 16:58 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: venkata pyla, dinesh.kumar, kazuhiro3.hayashi

From: venkata pyla <venkata.pyla@toshiba-tsip.com>

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
 recipes-core/images/cip-core-image-kernelci.bb |  1 +
 recipes-core/images/cip-core-image-security.bb |  1 +
 recipes-core/images/cip-core-image.bb          |  1 +
 recipes-core/images/common-image.inc           | 13 +++++++++++++
 4 files changed, 16 insertions(+)
 create mode 100644 recipes-core/images/common-image.inc

diff --git a/recipes-core/images/cip-core-image-kernelci.bb b/recipes-core/images/cip-core-image-kernelci.bb
index 479c14c..8a58e7b 100644
--- a/recipes-core/images/cip-core-image-kernelci.bb
+++ b/recipes-core/images/cip-core-image-kernelci.bb
@@ -10,6 +10,7 @@
 #
 
 inherit image
+require common-image.inc
 
 DESCRIPTION = "CIP Core image for KernelCI"
 
diff --git a/recipes-core/images/cip-core-image-security.bb b/recipes-core/images/cip-core-image-security.bb
index 3421ce5..f114974 100644
--- a/recipes-core/images/cip-core-image-security.bb
+++ b/recipes-core/images/cip-core-image-security.bb
@@ -10,6 +10,7 @@
 #
 
 inherit image
+require common-image.inc
 
 DESCRIPTION = "CIP Core image including security packages"
 
diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb
index 0ec7220..711d3d3 100644
--- a/recipes-core/images/cip-core-image.bb
+++ b/recipes-core/images/cip-core-image.bb
@@ -10,6 +10,7 @@
 #
 
 inherit image
+require common-image.inc
 
 ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --always --match 'v[0-9].[0-9]*'"
 DESCRIPTION = "CIP Core image"
diff --git a/recipes-core/images/common-image.inc b/recipes-core/images/common-image.inc
new file mode 100644
index 0000000..863f817
--- /dev/null
+++ b/recipes-core/images/common-image.inc
@@ -0,0 +1,13 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation 2023
+#
+# Authors:
+#  Venkata Pyla <venkata.pyla@toshiba-tsip.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+# Install in build system for creating reproducible DOS filesystems
+DEPENDS += "dosfstools"
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images
  2023-09-25 16:58       ` [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images venkata.pyla
@ 2023-09-25 17:13         ` Jan Kiszka
  2023-09-26  1:39           ` [cip-dev] " Venkata.Pyla
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Kiszka @ 2023-09-25 17:13 UTC (permalink / raw)
  To: venkata.pyla, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 25.09.23 18:58, venkata.pyla@toshiba-tsip.com wrote:
> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> 
> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> ---
>  recipes-core/images/cip-core-image-kernelci.bb |  1 +
>  recipes-core/images/cip-core-image-security.bb |  1 +
>  recipes-core/images/cip-core-image.bb          |  1 +
>  recipes-core/images/common-image.inc           | 13 +++++++++++++
>  4 files changed, 16 insertions(+)
>  create mode 100644 recipes-core/images/common-image.inc
> 
> diff --git a/recipes-core/images/cip-core-image-kernelci.bb b/recipes-core/images/cip-core-image-kernelci.bb
> index 479c14c..8a58e7b 100644
> --- a/recipes-core/images/cip-core-image-kernelci.bb
> +++ b/recipes-core/images/cip-core-image-kernelci.bb
> @@ -10,6 +10,7 @@
>  #
>  
>  inherit image
> +require common-image.inc
>  
>  DESCRIPTION = "CIP Core image for KernelCI"
>  
> diff --git a/recipes-core/images/cip-core-image-security.bb b/recipes-core/images/cip-core-image-security.bb
> index 3421ce5..f114974 100644
> --- a/recipes-core/images/cip-core-image-security.bb
> +++ b/recipes-core/images/cip-core-image-security.bb
> @@ -10,6 +10,7 @@
>  #
>  
>  inherit image
> +require common-image.inc
>  
>  DESCRIPTION = "CIP Core image including security packages"
>  
> diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb
> index 0ec7220..711d3d3 100644
> --- a/recipes-core/images/cip-core-image.bb
> +++ b/recipes-core/images/cip-core-image.bb
> @@ -10,6 +10,7 @@
>  #
>  
>  inherit image
> +require common-image.inc
>  
>  ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --always --match 'v[0-9].[0-9]*'"
>  DESCRIPTION = "CIP Core image"
> diff --git a/recipes-core/images/common-image.inc b/recipes-core/images/common-image.inc
> new file mode 100644
> index 0000000..863f817
> --- /dev/null
> +++ b/recipes-core/images/common-image.inc
> @@ -0,0 +1,13 @@
> +#
> +# CIP Core, generic profile
> +#
> +# Copyright (c) Toshiba Corporation 2023
> +#
> +# Authors:
> +#  Venkata Pyla <venkata.pyla@toshiba-tsip.com>
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +# Install in build system for creating reproducible DOS filesystems
> +DEPENDS += "dosfstools"

Why this now? Patch 1 is adding it as IMAGES_BUILD_DEPS, and that should
be enough as you correctly analyzed. Do we want that change rather in
conf/distro/cip-core-common.inc?

Jan

-- 
Siemens AG, Technology
Linux Expert Center



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images
  2023-09-25 17:13         ` Jan Kiszka
@ 2023-09-26  1:39           ` Venkata.Pyla
  2023-09-26  7:10             ` Jan Kiszka
  0 siblings, 1 reply; 20+ messages in thread
From: Venkata.Pyla @ 2023-09-26  1:39 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: dinesh.kumar, kazuhiro3.hayashi



> -----Original Message-----
> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On Behalf
> Of Jan Kiszka via lists.cip-project.org
> Sent: Monday, September 25, 2023 10:43 PM
> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
> tsip.com>; cip-dev@lists.cip-project.org
> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
> <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as
> DEPENDENCY to all images
> 
> On 25.09.23 18:58, venkata.pyla@toshiba-tsip.com wrote:
> > From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> >
> > Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> > ---
> >  recipes-core/images/cip-core-image-kernelci.bb |  1 +
> > recipes-core/images/cip-core-image-security.bb |  1 +
> >  recipes-core/images/cip-core-image.bb          |  1 +
> >  recipes-core/images/common-image.inc           | 13 +++++++++++++
> >  4 files changed, 16 insertions(+)
> >  create mode 100644 recipes-core/images/common-image.inc
> >
> > diff --git a/recipes-core/images/cip-core-image-kernelci.bb
> > b/recipes-core/images/cip-core-image-kernelci.bb
> > index 479c14c..8a58e7b 100644
> > --- a/recipes-core/images/cip-core-image-kernelci.bb
> > +++ b/recipes-core/images/cip-core-image-kernelci.bb
> > @@ -10,6 +10,7 @@
> >  #
> >
> >  inherit image
> > +require common-image.inc
> >
> >  DESCRIPTION = "CIP Core image for KernelCI"
> >
> > diff --git a/recipes-core/images/cip-core-image-security.bb
> > b/recipes-core/images/cip-core-image-security.bb
> > index 3421ce5..f114974 100644
> > --- a/recipes-core/images/cip-core-image-security.bb
> > +++ b/recipes-core/images/cip-core-image-security.bb
> > @@ -10,6 +10,7 @@
> >  #
> >
> >  inherit image
> > +require common-image.inc
> >
> >  DESCRIPTION = "CIP Core image including security packages"
> >
> > diff --git a/recipes-core/images/cip-core-image.bb
> > b/recipes-core/images/cip-core-image.bb
> > index 0ec7220..711d3d3 100644
> > --- a/recipes-core/images/cip-core-image.bb
> > +++ b/recipes-core/images/cip-core-image.bb
> > @@ -10,6 +10,7 @@
> >  #
> >
> >  inherit image
> > +require common-image.inc
> >
> >  ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --
> always --match 'v[0-9].[0-9]*'"
> >  DESCRIPTION = "CIP Core image"
> > diff --git a/recipes-core/images/common-image.inc
> > b/recipes-core/images/common-image.inc
> > new file mode 100644
> > index 0000000..863f817
> > --- /dev/null
> > +++ b/recipes-core/images/common-image.inc
> > @@ -0,0 +1,13 @@
> > +#
> > +# CIP Core, generic profile
> > +#
> > +# Copyright (c) Toshiba Corporation 2023 # # Authors:
> > +#  Venkata Pyla <venkata.pyla@toshiba-tsip.com> # #
> > +SPDX-License-Identifier: MIT #
> > +
> > +# Install in build system for creating reproducible DOS filesystems
> > +DEPENDS += "dosfstools"
> 
> Why this now? Patch 1 is adding it as IMAGES_BUILD_DEPS, and that should
> be enough as you correctly analyzed. Do we want that change rather in
> conf/distro/cip-core-common.inc?

It is not required; I was confused then with your comment I thought you are expecting this change for some reason.

If you agree you can discard the Patch 2.

> Jan
> 
> --
> Siemens AG, Technology
> Linux Expert Center


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images
  2023-09-26  1:39           ` [cip-dev] " Venkata.Pyla
@ 2023-09-26  7:10             ` Jan Kiszka
  2023-09-26  7:41               ` Venkata.Pyla
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Kiszka @ 2023-09-26  7:10 UTC (permalink / raw)
  To: Venkata.Pyla, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 26.09.23 03:39, Venkata.Pyla@toshiba-tsip.com wrote:
> 
> 
>> -----Original Message-----
>> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On Behalf
>> Of Jan Kiszka via lists.cip-project.org
>> Sent: Monday, September 25, 2023 10:43 PM
>> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
>> tsip.com>; cip-dev@lists.cip-project.org
>> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
>> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
>> <kazuhiro3.hayashi@toshiba.co.jp>
>> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as
>> DEPENDENCY to all images
>>
>> On 25.09.23 18:58, venkata.pyla@toshiba-tsip.com wrote:
>>> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>>
>>> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>> ---
>>>  recipes-core/images/cip-core-image-kernelci.bb |  1 +
>>> recipes-core/images/cip-core-image-security.bb |  1 +
>>>  recipes-core/images/cip-core-image.bb          |  1 +
>>>  recipes-core/images/common-image.inc           | 13 +++++++++++++
>>>  4 files changed, 16 insertions(+)
>>>  create mode 100644 recipes-core/images/common-image.inc
>>>
>>> diff --git a/recipes-core/images/cip-core-image-kernelci.bb
>>> b/recipes-core/images/cip-core-image-kernelci.bb
>>> index 479c14c..8a58e7b 100644
>>> --- a/recipes-core/images/cip-core-image-kernelci.bb
>>> +++ b/recipes-core/images/cip-core-image-kernelci.bb
>>> @@ -10,6 +10,7 @@
>>>  #
>>>
>>>  inherit image
>>> +require common-image.inc
>>>
>>>  DESCRIPTION = "CIP Core image for KernelCI"
>>>
>>> diff --git a/recipes-core/images/cip-core-image-security.bb
>>> b/recipes-core/images/cip-core-image-security.bb
>>> index 3421ce5..f114974 100644
>>> --- a/recipes-core/images/cip-core-image-security.bb
>>> +++ b/recipes-core/images/cip-core-image-security.bb
>>> @@ -10,6 +10,7 @@
>>>  #
>>>
>>>  inherit image
>>> +require common-image.inc
>>>
>>>  DESCRIPTION = "CIP Core image including security packages"
>>>
>>> diff --git a/recipes-core/images/cip-core-image.bb
>>> b/recipes-core/images/cip-core-image.bb
>>> index 0ec7220..711d3d3 100644
>>> --- a/recipes-core/images/cip-core-image.bb
>>> +++ b/recipes-core/images/cip-core-image.bb
>>> @@ -10,6 +10,7 @@
>>>  #
>>>
>>>  inherit image
>>> +require common-image.inc
>>>
>>>  ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --
>> always --match 'v[0-9].[0-9]*'"
>>>  DESCRIPTION = "CIP Core image"
>>> diff --git a/recipes-core/images/common-image.inc
>>> b/recipes-core/images/common-image.inc
>>> new file mode 100644
>>> index 0000000..863f817
>>> --- /dev/null
>>> +++ b/recipes-core/images/common-image.inc
>>> @@ -0,0 +1,13 @@
>>> +#
>>> +# CIP Core, generic profile
>>> +#
>>> +# Copyright (c) Toshiba Corporation 2023 # # Authors:
>>> +#  Venkata Pyla <venkata.pyla@toshiba-tsip.com> # #
>>> +SPDX-License-Identifier: MIT #
>>> +
>>> +# Install in build system for creating reproducible DOS filesystems
>>> +DEPENDS += "dosfstools"
>>
>> Why this now? Patch 1 is adding it as IMAGES_BUILD_DEPS, and that should
>> be enough as you correctly analyzed. Do we want that change rather in
>> conf/distro/cip-core-common.inc?
> 
> It is not required; I was confused then with your comment I thought you are expecting this change for some reason.
> 
> If you agree you can discard the Patch 2.

OK, but the question remains on patch 1 if we only want to include the
tool in the reproducible mode or unconditionally. In the latter case, my
suggestion above would come into play.

Jan

-- 
Siemens AG, Technology
Linux Expert Center



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images
  2023-09-26  7:10             ` Jan Kiszka
@ 2023-09-26  7:41               ` Venkata.Pyla
  2023-09-26  9:19                 ` Jan Kiszka
  0 siblings, 1 reply; 20+ messages in thread
From: Venkata.Pyla @ 2023-09-26  7:41 UTC (permalink / raw)
  To: jan.kiszka, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi



> -----Original Message-----
> From: Jan Kiszka <jan.kiszka@siemens.com>
> Sent: Tuesday, September 26, 2023 12:41 PM
> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
> tsip.com>; cip-dev@lists.cip-project.org
> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
> <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as
> DEPENDENCY to all images
> 
> On 26.09.23 03:39, Venkata.Pyla@toshiba-tsip.com wrote:
> >
> >
> >> -----Original Message-----
> >> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org>
> >> On Behalf Of Jan Kiszka via lists.cip-project.org
> >> Sent: Monday, September 25, 2023 10:43 PM
> >> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
> >> tsip.com>; cip-dev@lists.cip-project.org
> >> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
> >> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
> >> <kazuhiro3.hayashi@toshiba.co.jp>
> >> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools
> >> as DEPENDENCY to all images
> >>
> >> On 25.09.23 18:58, venkata.pyla@toshiba-tsip.com wrote:
> >>> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> >>>
> >>> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> >>> ---
> >>>  recipes-core/images/cip-core-image-kernelci.bb |  1 +
> >>> recipes-core/images/cip-core-image-security.bb |  1 +
> >>>  recipes-core/images/cip-core-image.bb          |  1 +
> >>>  recipes-core/images/common-image.inc           | 13 +++++++++++++
> >>>  4 files changed, 16 insertions(+)
> >>>  create mode 100644 recipes-core/images/common-image.inc
> >>>
> >>> diff --git a/recipes-core/images/cip-core-image-kernelci.bb
> >>> b/recipes-core/images/cip-core-image-kernelci.bb
> >>> index 479c14c..8a58e7b 100644
> >>> --- a/recipes-core/images/cip-core-image-kernelci.bb
> >>> +++ b/recipes-core/images/cip-core-image-kernelci.bb
> >>> @@ -10,6 +10,7 @@
> >>>  #
> >>>
> >>>  inherit image
> >>> +require common-image.inc
> >>>
> >>>  DESCRIPTION = "CIP Core image for KernelCI"
> >>>
> >>> diff --git a/recipes-core/images/cip-core-image-security.bb
> >>> b/recipes-core/images/cip-core-image-security.bb
> >>> index 3421ce5..f114974 100644
> >>> --- a/recipes-core/images/cip-core-image-security.bb
> >>> +++ b/recipes-core/images/cip-core-image-security.bb
> >>> @@ -10,6 +10,7 @@
> >>>  #
> >>>
> >>>  inherit image
> >>> +require common-image.inc
> >>>
> >>>  DESCRIPTION = "CIP Core image including security packages"
> >>>
> >>> diff --git a/recipes-core/images/cip-core-image.bb
> >>> b/recipes-core/images/cip-core-image.bb
> >>> index 0ec7220..711d3d3 100644
> >>> --- a/recipes-core/images/cip-core-image.bb
> >>> +++ b/recipes-core/images/cip-core-image.bb
> >>> @@ -10,6 +10,7 @@
> >>>  #
> >>>
> >>>  inherit image
> >>> +require common-image.inc
> >>>
> >>>  ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags
> >>> --dirty --
> >> always --match 'v[0-9].[0-9]*'"
> >>>  DESCRIPTION = "CIP Core image"
> >>> diff --git a/recipes-core/images/common-image.inc
> >>> b/recipes-core/images/common-image.inc
> >>> new file mode 100644
> >>> index 0000000..863f817
> >>> --- /dev/null
> >>> +++ b/recipes-core/images/common-image.inc
> >>> @@ -0,0 +1,13 @@
> >>> +#
> >>> +# CIP Core, generic profile
> >>> +#
> >>> +# Copyright (c) Toshiba Corporation 2023 # # Authors:
> >>> +#  Venkata Pyla <venkata.pyla@toshiba-tsip.com> # #
> >>> +SPDX-License-Identifier: MIT #
> >>> +
> >>> +# Install in build system for creating reproducible DOS filesystems
> >>> +DEPENDS += "dosfstools"
> >>
> >> Why this now? Patch 1 is adding it as IMAGES_BUILD_DEPS, and that
> >> should be enough as you correctly analyzed. Do we want that change
> >> rather in conf/distro/cip-core-common.inc?
> >
> > It is not required; I was confused then with your comment I thought you are
> expecting this change for some reason.
> >
> > If you agree you can discard the Patch 2.
> 
> OK, but the question remains on patch 1 if we only want to include the tool in
> the reproducible mode or unconditionally. In the latter case, my suggestion
> above would come into play.

I didn’t understand your question properly then, I am pasting your comment again as below.

>> +    IMAGER_BUILD_DEPS += "dosfstools"
> This will lead to funny effects when also the image requests dosfstools and HOST_ARCH, thus PACKAGE_ARCH == DISTRO_ARCH: If the package is built early enough, the target image will get our custom version. If it is built "too late", the distro version is used. All that would be non-reproducible.
What do you mean by "image requests dosfstools and HOST_ARCH"? -> dosfstools is requested to install in target image?
If it so, do you think dosfstools requested for target image MAY get it from Debian instead from local build? That would make image non-reproducible

Do you think we need add more stricter DEPENDENCY rule that will install before image is getting installed from Distro

> 
> Jan
> 
> --
> Siemens AG, Technology
> Linux Expert Center

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images
  2023-09-26  7:41               ` Venkata.Pyla
@ 2023-09-26  9:19                 ` Jan Kiszka
  2023-09-26 11:51                   ` Venkata.Pyla
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Kiszka @ 2023-09-26  9:19 UTC (permalink / raw)
  To: Venkata.Pyla, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 26.09.23 09:41, Venkata.Pyla@toshiba-tsip.com wrote:
> 
> 
>> -----Original Message-----
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>> Sent: Tuesday, September 26, 2023 12:41 PM
>> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
>> tsip.com>; cip-dev@lists.cip-project.org
>> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
>> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
>> <kazuhiro3.hayashi@toshiba.co.jp>
>> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as
>> DEPENDENCY to all images
>>
>> On 26.09.23 03:39, Venkata.Pyla@toshiba-tsip.com wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org>
>>>> On Behalf Of Jan Kiszka via lists.cip-project.org
>>>> Sent: Monday, September 25, 2023 10:43 PM
>>>> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
>>>> tsip.com>; cip-dev@lists.cip-project.org
>>>> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
>>>> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
>>>> <kazuhiro3.hayashi@toshiba.co.jp>
>>>> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools
>>>> as DEPENDENCY to all images
>>>>
>>>> On 25.09.23 18:58, venkata.pyla@toshiba-tsip.com wrote:
>>>>> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>>>>
>>>>> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>>>> ---
>>>>>  recipes-core/images/cip-core-image-kernelci.bb |  1 +
>>>>> recipes-core/images/cip-core-image-security.bb |  1 +
>>>>>  recipes-core/images/cip-core-image.bb          |  1 +
>>>>>  recipes-core/images/common-image.inc           | 13 +++++++++++++
>>>>>  4 files changed, 16 insertions(+)
>>>>>  create mode 100644 recipes-core/images/common-image.inc
>>>>>
>>>>> diff --git a/recipes-core/images/cip-core-image-kernelci.bb
>>>>> b/recipes-core/images/cip-core-image-kernelci.bb
>>>>> index 479c14c..8a58e7b 100644
>>>>> --- a/recipes-core/images/cip-core-image-kernelci.bb
>>>>> +++ b/recipes-core/images/cip-core-image-kernelci.bb
>>>>> @@ -10,6 +10,7 @@
>>>>>  #
>>>>>
>>>>>  inherit image
>>>>> +require common-image.inc
>>>>>
>>>>>  DESCRIPTION = "CIP Core image for KernelCI"
>>>>>
>>>>> diff --git a/recipes-core/images/cip-core-image-security.bb
>>>>> b/recipes-core/images/cip-core-image-security.bb
>>>>> index 3421ce5..f114974 100644
>>>>> --- a/recipes-core/images/cip-core-image-security.bb
>>>>> +++ b/recipes-core/images/cip-core-image-security.bb
>>>>> @@ -10,6 +10,7 @@
>>>>>  #
>>>>>
>>>>>  inherit image
>>>>> +require common-image.inc
>>>>>
>>>>>  DESCRIPTION = "CIP Core image including security packages"
>>>>>
>>>>> diff --git a/recipes-core/images/cip-core-image.bb
>>>>> b/recipes-core/images/cip-core-image.bb
>>>>> index 0ec7220..711d3d3 100644
>>>>> --- a/recipes-core/images/cip-core-image.bb
>>>>> +++ b/recipes-core/images/cip-core-image.bb
>>>>> @@ -10,6 +10,7 @@
>>>>>  #
>>>>>
>>>>>  inherit image
>>>>> +require common-image.inc
>>>>>
>>>>>  ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags
>>>>> --dirty --
>>>> always --match 'v[0-9].[0-9]*'"
>>>>>  DESCRIPTION = "CIP Core image"
>>>>> diff --git a/recipes-core/images/common-image.inc
>>>>> b/recipes-core/images/common-image.inc
>>>>> new file mode 100644
>>>>> index 0000000..863f817
>>>>> --- /dev/null
>>>>> +++ b/recipes-core/images/common-image.inc
>>>>> @@ -0,0 +1,13 @@
>>>>> +#
>>>>> +# CIP Core, generic profile
>>>>> +#
>>>>> +# Copyright (c) Toshiba Corporation 2023 # # Authors:
>>>>> +#  Venkata Pyla <venkata.pyla@toshiba-tsip.com> # #
>>>>> +SPDX-License-Identifier: MIT #
>>>>> +
>>>>> +# Install in build system for creating reproducible DOS filesystems
>>>>> +DEPENDS += "dosfstools"
>>>>
>>>> Why this now? Patch 1 is adding it as IMAGES_BUILD_DEPS, and that
>>>> should be enough as you correctly analyzed. Do we want that change
>>>> rather in conf/distro/cip-core-common.inc?
>>>
>>> It is not required; I was confused then with your comment I thought you are
>> expecting this change for some reason.
>>>
>>> If you agree you can discard the Patch 2.
>>
>> OK, but the question remains on patch 1 if we only want to include the tool in
>> the reproducible mode or unconditionally. In the latter case, my suggestion
>> above would come into play.
> 
> I didn’t understand your question properly then, I am pasting your comment again as below.

Your patch one currently only adds the self-built dosfstools when the
user explicitly selects reproducible building. In other cases - simpler
ones, granted - we apply reproducibility fixes unconditionally. Should
we do that for dosfstools as well? That is my only question.

Jan

-- 
Siemens AG, Technology
Linux Expert Center



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images
  2023-09-26  9:19                 ` Jan Kiszka
@ 2023-09-26 11:51                   ` Venkata.Pyla
  2023-09-26 12:57                     ` Jan Kiszka
  0 siblings, 1 reply; 20+ messages in thread
From: Venkata.Pyla @ 2023-09-26 11:51 UTC (permalink / raw)
  To: jan.kiszka, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi



> -----Original Message-----
> From: Jan Kiszka <jan.kiszka@siemens.com>
> Sent: Tuesday, September 26, 2023 2:49 PM
> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
> tsip.com>; cip-dev@lists.cip-project.org
> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
> <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as
> DEPENDENCY to all images
> 
> On 26.09.23 09:41, Venkata.Pyla@toshiba-tsip.com wrote:
> >
> >
> >> -----Original Message-----
> >> From: Jan Kiszka <jan.kiszka@siemens.com>
> >> Sent: Tuesday, September 26, 2023 12:41 PM
> >> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
> >> tsip.com>; cip-dev@lists.cip-project.org
> >> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
> >> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
> >> <kazuhiro3.hayashi@toshiba.co.jp>
> >> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools
> >> as DEPENDENCY to all images
> >>
> >> On 26.09.23 03:39, Venkata.Pyla@toshiba-tsip.com wrote:
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org>
> >>>> On Behalf Of Jan Kiszka via lists.cip-project.org
> >>>> Sent: Monday, September 25, 2023 10:43 PM
> >>>> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
> >>>> tsip.com>; cip-dev@lists.cip-project.org
> >>>> Cc: dinesh kumar(TSIP TMIEC ODG Porting)
> <dinesh.kumar@toshiba-
> >>>> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
> >>>> <kazuhiro3.hayashi@toshiba.co.jp>
> >>>> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add
> >>>> dosfstools as DEPENDENCY to all images
> >>>>
> >>>> On 25.09.23 18:58, venkata.pyla@toshiba-tsip.com wrote:
> >>>>> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> >>>>>
> >>>>> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> >>>>> ---
> >>>>>  recipes-core/images/cip-core-image-kernelci.bb |  1 +
> >>>>> recipes-core/images/cip-core-image-security.bb |  1 +
> >>>>>  recipes-core/images/cip-core-image.bb          |  1 +
> >>>>>  recipes-core/images/common-image.inc           | 13 +++++++++++++
> >>>>>  4 files changed, 16 insertions(+)  create mode 100644
> >>>>> recipes-core/images/common-image.inc
> >>>>>
> >>>>> diff --git a/recipes-core/images/cip-core-image-kernelci.bb
> >>>>> b/recipes-core/images/cip-core-image-kernelci.bb
> >>>>> index 479c14c..8a58e7b 100644
> >>>>> --- a/recipes-core/images/cip-core-image-kernelci.bb
> >>>>> +++ b/recipes-core/images/cip-core-image-kernelci.bb
> >>>>> @@ -10,6 +10,7 @@
> >>>>>  #
> >>>>>
> >>>>>  inherit image
> >>>>> +require common-image.inc
> >>>>>
> >>>>>  DESCRIPTION = "CIP Core image for KernelCI"
> >>>>>
> >>>>> diff --git a/recipes-core/images/cip-core-image-security.bb
> >>>>> b/recipes-core/images/cip-core-image-security.bb
> >>>>> index 3421ce5..f114974 100644
> >>>>> --- a/recipes-core/images/cip-core-image-security.bb
> >>>>> +++ b/recipes-core/images/cip-core-image-security.bb
> >>>>> @@ -10,6 +10,7 @@
> >>>>>  #
> >>>>>
> >>>>>  inherit image
> >>>>> +require common-image.inc
> >>>>>
> >>>>>  DESCRIPTION = "CIP Core image including security packages"
> >>>>>
> >>>>> diff --git a/recipes-core/images/cip-core-image.bb
> >>>>> b/recipes-core/images/cip-core-image.bb
> >>>>> index 0ec7220..711d3d3 100644
> >>>>> --- a/recipes-core/images/cip-core-image.bb
> >>>>> +++ b/recipes-core/images/cip-core-image.bb
> >>>>> @@ -10,6 +10,7 @@
> >>>>>  #
> >>>>>
> >>>>>  inherit image
> >>>>> +require common-image.inc
> >>>>>
> >>>>>  ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags
> >>>>> --dirty --
> >>>> always --match 'v[0-9].[0-9]*'"
> >>>>>  DESCRIPTION = "CIP Core image"
> >>>>> diff --git a/recipes-core/images/common-image.inc
> >>>>> b/recipes-core/images/common-image.inc
> >>>>> new file mode 100644
> >>>>> index 0000000..863f817
> >>>>> --- /dev/null
> >>>>> +++ b/recipes-core/images/common-image.inc
> >>>>> @@ -0,0 +1,13 @@
> >>>>> +#
> >>>>> +# CIP Core, generic profile
> >>>>> +#
> >>>>> +# Copyright (c) Toshiba Corporation 2023 # # Authors:
> >>>>> +#  Venkata Pyla <venkata.pyla@toshiba-tsip.com> # #
> >>>>> +SPDX-License-Identifier: MIT #
> >>>>> +
> >>>>> +# Install in build system for creating reproducible DOS
> >>>>> +filesystems DEPENDS += "dosfstools"
> >>>>
> >>>> Why this now? Patch 1 is adding it as IMAGES_BUILD_DEPS, and that
> >>>> should be enough as you correctly analyzed. Do we want that change
> >>>> rather in conf/distro/cip-core-common.inc?
> >>>
> >>> It is not required; I was confused then with your comment I thought
> >>> you are
> >> expecting this change for some reason.
> >>>
> >>> If you agree you can discard the Patch 2.
> >>
> >> OK, but the question remains on patch 1 if we only want to include
> >> the tool in the reproducible mode or unconditionally. In the latter
> >> case, my suggestion above would come into play.
> >
> > I didn’t understand your question properly then, I am pasting your comment
> again as below.
> 
> Your patch one currently only adds the self-built dosfstools when the user
> explicitly selects reproducible building. In other cases - simpler ones, granted -
> we apply reproducibility fixes unconditionally. Should we do that for
> dosfstools as well? That is my only question.

I understand now, we can enable dosfstools unconditionally also, maybe we can do that in distro configuration, 
here https://gitlab.com/cip-project/cip-core/isar-cip-core/-/blob/master/conf/distro/cip-core-common.inc?

I will send v3 patch with this modification.


> 
> Jan
> 
> --
> Siemens AG, Technology
> Linux Expert Center

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images
  2023-09-26 11:51                   ` Venkata.Pyla
@ 2023-09-26 12:57                     ` Jan Kiszka
  2023-09-26 16:40                       ` [isar-cip-core v3 0/2] Add dosfstools recipe venkata.pyla
                                         ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Jan Kiszka @ 2023-09-26 12:57 UTC (permalink / raw)
  To: Venkata.Pyla, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 26.09.23 13:51, Venkata.Pyla@toshiba-tsip.com wrote:
> 
> 
>> -----Original Message-----
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>> Sent: Tuesday, September 26, 2023 2:49 PM
>> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
>> tsip.com>; cip-dev@lists.cip-project.org
>> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
>> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
>> <kazuhiro3.hayashi@toshiba.co.jp>
>> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools as
>> DEPENDENCY to all images
>>
>> On 26.09.23 09:41, Venkata.Pyla@toshiba-tsip.com wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>> Sent: Tuesday, September 26, 2023 12:41 PM
>>>> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
>>>> tsip.com>; cip-dev@lists.cip-project.org
>>>> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
>>>> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
>>>> <kazuhiro3.hayashi@toshiba.co.jp>
>>>> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add dosfstools
>>>> as DEPENDENCY to all images
>>>>
>>>> On 26.09.23 03:39, Venkata.Pyla@toshiba-tsip.com wrote:
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org>
>>>>>> On Behalf Of Jan Kiszka via lists.cip-project.org
>>>>>> Sent: Monday, September 25, 2023 10:43 PM
>>>>>> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
>>>>>> tsip.com>; cip-dev@lists.cip-project.org
>>>>>> Cc: dinesh kumar(TSIP TMIEC ODG Porting)
>> <dinesh.kumar@toshiba-
>>>>>> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
>>>>>> <kazuhiro3.hayashi@toshiba.co.jp>
>>>>>> Subject: Re: [cip-dev] [isar-cip-core v2 2/2] images: Add
>>>>>> dosfstools as DEPENDENCY to all images
>>>>>>
>>>>>> On 25.09.23 18:58, venkata.pyla@toshiba-tsip.com wrote:
>>>>>>> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>>>>>>
>>>>>>> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>>>>>> ---
>>>>>>>  recipes-core/images/cip-core-image-kernelci.bb |  1 +
>>>>>>> recipes-core/images/cip-core-image-security.bb |  1 +
>>>>>>>  recipes-core/images/cip-core-image.bb          |  1 +
>>>>>>>  recipes-core/images/common-image.inc           | 13 +++++++++++++
>>>>>>>  4 files changed, 16 insertions(+)  create mode 100644
>>>>>>> recipes-core/images/common-image.inc
>>>>>>>
>>>>>>> diff --git a/recipes-core/images/cip-core-image-kernelci.bb
>>>>>>> b/recipes-core/images/cip-core-image-kernelci.bb
>>>>>>> index 479c14c..8a58e7b 100644
>>>>>>> --- a/recipes-core/images/cip-core-image-kernelci.bb
>>>>>>> +++ b/recipes-core/images/cip-core-image-kernelci.bb
>>>>>>> @@ -10,6 +10,7 @@
>>>>>>>  #
>>>>>>>
>>>>>>>  inherit image
>>>>>>> +require common-image.inc
>>>>>>>
>>>>>>>  DESCRIPTION = "CIP Core image for KernelCI"
>>>>>>>
>>>>>>> diff --git a/recipes-core/images/cip-core-image-security.bb
>>>>>>> b/recipes-core/images/cip-core-image-security.bb
>>>>>>> index 3421ce5..f114974 100644
>>>>>>> --- a/recipes-core/images/cip-core-image-security.bb
>>>>>>> +++ b/recipes-core/images/cip-core-image-security.bb
>>>>>>> @@ -10,6 +10,7 @@
>>>>>>>  #
>>>>>>>
>>>>>>>  inherit image
>>>>>>> +require common-image.inc
>>>>>>>
>>>>>>>  DESCRIPTION = "CIP Core image including security packages"
>>>>>>>
>>>>>>> diff --git a/recipes-core/images/cip-core-image.bb
>>>>>>> b/recipes-core/images/cip-core-image.bb
>>>>>>> index 0ec7220..711d3d3 100644
>>>>>>> --- a/recipes-core/images/cip-core-image.bb
>>>>>>> +++ b/recipes-core/images/cip-core-image.bb
>>>>>>> @@ -10,6 +10,7 @@
>>>>>>>  #
>>>>>>>
>>>>>>>  inherit image
>>>>>>> +require common-image.inc
>>>>>>>
>>>>>>>  ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags
>>>>>>> --dirty --
>>>>>> always --match 'v[0-9].[0-9]*'"
>>>>>>>  DESCRIPTION = "CIP Core image"
>>>>>>> diff --git a/recipes-core/images/common-image.inc
>>>>>>> b/recipes-core/images/common-image.inc
>>>>>>> new file mode 100644
>>>>>>> index 0000000..863f817
>>>>>>> --- /dev/null
>>>>>>> +++ b/recipes-core/images/common-image.inc
>>>>>>> @@ -0,0 +1,13 @@
>>>>>>> +#
>>>>>>> +# CIP Core, generic profile
>>>>>>> +#
>>>>>>> +# Copyright (c) Toshiba Corporation 2023 # # Authors:
>>>>>>> +#  Venkata Pyla <venkata.pyla@toshiba-tsip.com> # #
>>>>>>> +SPDX-License-Identifier: MIT #
>>>>>>> +
>>>>>>> +# Install in build system for creating reproducible DOS
>>>>>>> +filesystems DEPENDS += "dosfstools"
>>>>>>
>>>>>> Why this now? Patch 1 is adding it as IMAGES_BUILD_DEPS, and that
>>>>>> should be enough as you correctly analyzed. Do we want that change
>>>>>> rather in conf/distro/cip-core-common.inc?
>>>>>
>>>>> It is not required; I was confused then with your comment I thought
>>>>> you are
>>>> expecting this change for some reason.
>>>>>
>>>>> If you agree you can discard the Patch 2.
>>>>
>>>> OK, but the question remains on patch 1 if we only want to include
>>>> the tool in the reproducible mode or unconditionally. In the latter
>>>> case, my suggestion above would come into play.
>>>
>>> I didn’t understand your question properly then, I am pasting your comment
>> again as below.
>>
>> Your patch one currently only adds the self-built dosfstools when the user
>> explicitly selects reproducible building. In other cases - simpler ones, granted -
>> we apply reproducibility fixes unconditionally. Should we do that for
>> dosfstools as well? That is my only question.
> 
> I understand now, we can enable dosfstools unconditionally also, maybe we can do that in distro configuration, 
> here https://gitlab.com/cip-project/cip-core/isar-cip-core/-/blob/master/conf/distro/cip-core-common.inc?
> 

Yes, that was my idea as well.

> I will send v3 patch with this modification.
> 

Thanks in advance,
Jan

-- 
Siemens AG, Technology
Linux Expert Center



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [isar-cip-core v3 0/2] Add dosfstools recipe
  2023-09-26 12:57                     ` Jan Kiszka
@ 2023-09-26 16:40                       ` venkata.pyla
  2023-09-27  5:54                         ` Jan Kiszka
  2023-09-26 16:40                       ` [isar-cip-core v3 1/2] dosfstools: Add recipe to build it locally venkata.pyla
  2023-09-26 16:40                       ` [isar-cip-core v3 2/2] conf/distro/cip-core-common.inc: Set dosfstools as build dependency venkata.pyla
  2 siblings, 1 reply; 20+ messages in thread
From: venkata.pyla @ 2023-09-26 16:40 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: venkata pyla, dinesh.kumar, kazuhiro3.hayashi

From: venkata pyla <venkata.pyla@toshiba-tsip.com>

Hi,

This patch series add recipe that build custom dosfstools and use it for
creating reproducible DOS images.

v3 changes:
  - dosfstools: Add recipe to build it locally
     (Remove dosfstools dependency from reproucible option)
  - distro: Set dosfstools as build dependency
     (new commit)

v2 changes:
  dosfstools: Add recipe to build it locally
     (modified from `dpkg-gbp` to `apt://`)
  images: Add dosfstools as DEPENDENCY to all images
     (new commit)

 conf/distro/cip-core-common.inc               |   1 +
 .../dosfstools/dosfstools_latest.bb           |  28 +++
 ...Honor-the-SOURCE_DATE_EPOCH-variable.patch | 160 ++++++++++++++++++
 3 files changed, 189 insertions(+)
 create mode 100644 recipes-devtools/dosfstools/dosfstools_latest.bb
 create mode 100644 recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch

-- 
2.20.1




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [isar-cip-core v3 1/2] dosfstools: Add recipe to build it locally
  2023-09-26 12:57                     ` Jan Kiszka
  2023-09-26 16:40                       ` [isar-cip-core v3 0/2] Add dosfstools recipe venkata.pyla
@ 2023-09-26 16:40                       ` venkata.pyla
  2023-09-26 16:40                       ` [isar-cip-core v3 2/2] conf/distro/cip-core-common.inc: Set dosfstools as build dependency venkata.pyla
  2 siblings, 0 replies; 20+ messages in thread
From: venkata.pyla @ 2023-09-26 16:40 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: venkata pyla, dinesh.kumar, kazuhiro3.hayashi

From: venkata pyla <venkata.pyla@toshiba-tsip.com>

mkdosfs doesn't generate fat file-systems reproducibly, due to the
reason that the utility mkfs.fat is not honoring the variable
SOURCE_DATE_EPOCH and including build time stamps in the file system
headers, this issue has been fixed in upstream master branch but not
release yet, so building it locally with the patch.

This local build can be dropped when this patch[1] is available in
Debian releases, issue[2] is already available to make release with
this patch.

[1] https://github.com/dosfstools/dosfstools/commit/8da7bc93315cb0c32ad868f17808468b81fa76ec
[2] https://github.com/dosfstools/dosfstools/issues/179

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
 .../dosfstools/dosfstools_latest.bb           |  28 +++
 ...Honor-the-SOURCE_DATE_EPOCH-variable.patch | 160 ++++++++++++++++++
 2 files changed, 188 insertions(+)
 create mode 100644 recipes-devtools/dosfstools/dosfstools_latest.bb
 create mode 100644 recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch

diff --git a/recipes-devtools/dosfstools/dosfstools_latest.bb b/recipes-devtools/dosfstools/dosfstools_latest.bb
new file mode 100644
index 0000000..ebdf983
--- /dev/null
+++ b/recipes-devtools/dosfstools/dosfstools_latest.bb
@@ -0,0 +1,28 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation 2023
+#
+# Authors:
+#  Venkata Pyla <venkata.pyla@toshiba-tsip.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg
+
+CHANGELOG_V="<orig-version>+cip"
+
+SRC_URI = "apt://${PN}"
+SRC_URI += "file://0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch;apply=no"
+
+# this is a host tool
+PACKAGE_ARCH = "${HOST_ARCH}"
+
+do_prepare_build() {
+	deb_add_changelog
+
+	cd ${S}
+	quilt import ${WORKDIR}/*.patch
+	quilt push -a
+}
diff --git a/recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch b/recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
new file mode 100644
index 0000000..30c2132
--- /dev/null
+++ b/recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
@@ -0,0 +1,160 @@
+From 8da7bc93315cb0c32ad868f17808468b81fa76ec Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
+Date: Wed, 5 Dec 2018 19:52:51 +0100
+Subject: [PATCH] Honor the SOURCE_DATE_EPOCH variable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Implement the SOURCE_DATE_EPOCH specification[1] for reproducible
+builds. If SOURCE_DATE_EPOCH is set, use it as timestamp instead of the
+current time.
+
+[1] https://reproducible-builds.org/specs/source-date-epoch/
+
+Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
+---
+ src/boot.c     | 23 +++++++++++++++++++++--
+ src/common.c   | 18 ++++++++++++++++--
+ src/mkfs.fat.c | 19 ++++++++++++++++---
+ 3 files changed, 53 insertions(+), 7 deletions(-)
+
+diff --git a/src/boot.c b/src/boot.c
+index 4de450d..8f78e1c 100644
+--- a/src/boot.c
++++ b/src/boot.c
+@@ -33,6 +33,8 @@
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <time.h>
++#include <errno.h>
++#include <ctype.h>
+ 
+ #include "common.h"
+ #include "fsck.fat.h"
+@@ -672,6 +674,7 @@ void write_volume_label(DOS_FS * fs, char *label)
+ {
+     time_t now;
+     struct tm *mtime;
++    char *source_date_epoch = NULL;
+     off_t offset;
+     int created;
+     DIR_ENT de;
+@@ -687,8 +690,24 @@ void write_volume_label(DOS_FS * fs, char *label)
+     if (de.name[0] == 0xe5)
+ 	de.name[0] = 0x05;
+ 
+-    now = time(NULL);
+-    mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++        char *tmp = NULL;
++        long long conversion = 0;
++        errno = 0;
++        conversion = strtoll(source_date_epoch, &tmp, 10);
++        now = conversion;
++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
++                || errno != 0 || (long long)now != conversion) {
++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
++                source_date_epoch);
++        }
++        mtime = gmtime(&now);
++    } else {
++        now = time(NULL);
++        mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
++    }
++
+     if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) {
+ 	de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
+ 					   (mtime->tm_min << 5) +
+diff --git a/src/common.c b/src/common.c
+index 6a2e396..4f1afcb 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <stdarg.h>
+ #include <errno.h>
++#include <ctype.h>
+ #include <wctype.h>
+ #include <termios.h>
+ #include <sys/time.h>
+@@ -298,8 +299,21 @@ void check_atari(void)
+ uint32_t generate_volume_id(void)
+ {
+     struct timeval now;
+-
+-    if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
++    char *source_date_epoch = NULL;
++
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++        char *tmp = NULL;
++        long long conversion = 0;
++        errno = 0;
++        conversion = strtoll(source_date_epoch, &tmp, 10);
++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
++                || errno != 0) {
++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
++                source_date_epoch);
++        }
++        return (uint32_t)conversion;
++    } else if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
+         srand(getpid());
+         /* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
+         return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
+diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
+index 37fc8ff..1948635 100644
+--- a/src/mkfs.fat.c
++++ b/src/mkfs.fat.c
+@@ -1074,7 +1074,7 @@ static void setup_tables(void)
+         }
+ 
+         /* If is not available then generate random 32 bit disk signature */
+-        if (invariant)
++        if (invariant || getenv("SOURCE_DATE_EPOCH"))
+             disk_sig = volume_id;
+         else if (!disk_sig)
+             disk_sig = generate_volume_id();
+@@ -1287,7 +1287,7 @@ static void setup_tables(void)
+ 	    de->name[0] = 0x05;
+ 	de->attr = ATTR_VOLUME;
+ 	if (create_time != (time_t)-1) {
+-	    if (!invariant)
++	    if (!invariant && !getenv("SOURCE_DATE_EPOCH"))
+ 		ctime = localtime(&create_time);
+ 	    else
+ 		ctime = gmtime(&create_time);
+@@ -1477,6 +1477,7 @@ int main(int argc, char **argv)
+     int blocks_specified = 0;
+     struct timeval create_timeval;
+     long long conversion;
++    char *source_date_epoch = NULL;
+ 
+     enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET};
+     const struct option long_options[] = {
+@@ -1497,8 +1498,20 @@ int main(int argc, char **argv)
+ 	    program_name = p + 1;
+     }
+ 
+-    if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1)
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++        errno = 0;
++        conversion = strtoll(source_date_epoch, &tmp, 10);
++        create_time = conversion;
++        if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
++                || errno != 0 || (long long)create_time != conversion) {
++            die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
++                source_date_epoch);
++        }
++    } else if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1) {
+         create_time = create_timeval.tv_sec;
++    }
++
+     volume_id = generate_volume_id();
+     check_atari();
+ 
+-- 
+2.39.2
+
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [isar-cip-core v3 2/2] conf/distro/cip-core-common.inc: Set dosfstools as build dependency
  2023-09-26 12:57                     ` Jan Kiszka
  2023-09-26 16:40                       ` [isar-cip-core v3 0/2] Add dosfstools recipe venkata.pyla
  2023-09-26 16:40                       ` [isar-cip-core v3 1/2] dosfstools: Add recipe to build it locally venkata.pyla
@ 2023-09-26 16:40                       ` venkata.pyla
  2023-09-27  7:04                         ` Jan Kiszka
  2 siblings, 1 reply; 20+ messages in thread
From: venkata.pyla @ 2023-09-26 16:40 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: venkata pyla, dinesh.kumar, kazuhiro3.hayashi

From: venkata pyla <venkata.pyla@toshiba-tsip.com>

custom dosfstools is included with fix that will help create DOS images
reproducibly.

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
 conf/distro/cip-core-common.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/conf/distro/cip-core-common.inc b/conf/distro/cip-core-common.inc
index 5d3ce10..5a158f2 100644
--- a/conf/distro/cip-core-common.inc
+++ b/conf/distro/cip-core-common.inc
@@ -14,3 +14,4 @@ KERNEL_NAME ?= "cip"
 WKS_FILE ?= "${MACHINE}.wks"
 
 CIP_IMAGE_OPTIONS ?= ""
+IMAGER_BUILD_DEPS ?= "dosfstools"
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [isar-cip-core v3 0/2] Add dosfstools recipe
  2023-09-26 16:40                       ` [isar-cip-core v3 0/2] Add dosfstools recipe venkata.pyla
@ 2023-09-27  5:54                         ` Jan Kiszka
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Kiszka @ 2023-09-27  5:54 UTC (permalink / raw)
  To: venkata.pyla, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 26.09.23 18:40, venkata.pyla@toshiba-tsip.com wrote:
> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> 
> Hi,
> 
> This patch series add recipe that build custom dosfstools and use it for
> creating reproducible DOS images.
> 
> v3 changes:
>   - dosfstools: Add recipe to build it locally
>      (Remove dosfstools dependency from reproucible option)
>   - distro: Set dosfstools as build dependency
>      (new commit)
> 
> v2 changes:
>   dosfstools: Add recipe to build it locally
>      (modified from `dpkg-gbp` to `apt://`)
>   images: Add dosfstools as DEPENDENCY to all images
>      (new commit)
> 
>  conf/distro/cip-core-common.inc               |   1 +
>  .../dosfstools/dosfstools_latest.bb           |  28 +++
>  ...Honor-the-SOURCE_DATE_EPOCH-variable.patch | 160 ++++++++++++++++++
>  3 files changed, 189 insertions(+)
>  create mode 100644 recipes-devtools/dosfstools/dosfstools_latest.bb
>  create mode 100644 recipes-devtools/dosfstools/files/0001-Honor-the-SOURCE_DATE_EPOCH-variable.patch
> 

Thanks, applied.

BTW, did I ask if you opened a debian bug for this as well? Even if
upstream does not decide that such a patch is stable-worth, it would be
good to track, also for other reproducibility efforts.

Jan

-- 
Siemens AG, Technology
Linux Expert Center



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [isar-cip-core v3 2/2] conf/distro/cip-core-common.inc: Set dosfstools as build dependency
  2023-09-26 16:40                       ` [isar-cip-core v3 2/2] conf/distro/cip-core-common.inc: Set dosfstools as build dependency venkata.pyla
@ 2023-09-27  7:04                         ` Jan Kiszka
  2023-09-27  7:16                           ` Venkata.Pyla
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Kiszka @ 2023-09-27  7:04 UTC (permalink / raw)
  To: venkata.pyla, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 26.09.23 18:40, venkata.pyla@toshiba-tsip.com wrote:
> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> 
> custom dosfstools is included with fix that will help create DOS images
> reproducibly.
> 
> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> ---
>  conf/distro/cip-core-common.inc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/conf/distro/cip-core-common.inc b/conf/distro/cip-core-common.inc
> index 5d3ce10..5a158f2 100644
> --- a/conf/distro/cip-core-common.inc
> +++ b/conf/distro/cip-core-common.inc
> @@ -14,3 +14,4 @@ KERNEL_NAME ?= "cip"
>  WKS_FILE ?= "${MACHINE}.wks"
>  
>  CIP_IMAGE_OPTIONS ?= ""
> +IMAGER_BUILD_DEPS ?= "dosfstools"

Unfortunately, the patch does not apply to the buster version of
dosfstools, see e.g.
https://gitlab.com/cip-project/cip-core/isar-cip-core/-/jobs/5172706817.
We either need an adjusted patch for that release or need to skip buster.

Jan

-- 
Siemens AG, Technology
Linux Expert Center



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [isar-cip-core v3 2/2] conf/distro/cip-core-common.inc: Set dosfstools as build dependency
  2023-09-27  7:04                         ` Jan Kiszka
@ 2023-09-27  7:16                           ` Venkata.Pyla
  0 siblings, 0 replies; 20+ messages in thread
From: Venkata.Pyla @ 2023-09-27  7:16 UTC (permalink / raw)
  To: jan.kiszka, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi



> -----Original Message-----
> From: Jan Kiszka <jan.kiszka@siemens.com>
> Sent: Wednesday, September 27, 2023 12:34 PM
> To: pyla venkata(TSIP TMIEC ODG Porting) <Venkata.Pyla@toshiba-
> tsip.com>; cip-dev@lists.cip-project.org
> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-
> tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4)
> <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [isar-cip-core v3 2/2] conf/distro/cip-core-common.inc: Set
> dosfstools as build dependency
> 
> On 26.09.23 18:40, venkata.pyla@toshiba-tsip.com wrote:
> > From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> >
> > custom dosfstools is included with fix that will help create DOS
> > images reproducibly.
> >
> > Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> > ---
> >  conf/distro/cip-core-common.inc | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/conf/distro/cip-core-common.inc
> > b/conf/distro/cip-core-common.inc index 5d3ce10..5a158f2 100644
> > --- a/conf/distro/cip-core-common.inc
> > +++ b/conf/distro/cip-core-common.inc
> > @@ -14,3 +14,4 @@ KERNEL_NAME ?= "cip"
> >  WKS_FILE ?= "${MACHINE}.wks"
> >
> >  CIP_IMAGE_OPTIONS ?= ""
> > +IMAGER_BUILD_DEPS ?= "dosfstools"
> 
> Unfortunately, the patch does not apply to the buster version of dosfstools,
> see e.g.
> https://gitlab.com/cip-project/cip-core/isar-cip-core/-/jobs/5172706817.
> We either need an adjusted patch for that release or need to skip buster.

sorry I didn't check this in buster before sending this patch, 
I think it is better to skip for buster, as reproducible builds are not achievable in buster and so it is not important.

Let me skip this in v4.

> 
> Jan
> 
> --
> Siemens AG, Technology
> Linux Expert Center

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-09-27  7:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-22 10:12 [isar-cip-core] dosfstools: Add recipe to build it locally venkata.pyla
2023-09-22 14:26 ` Jan Kiszka
2023-09-24 15:28   ` Venkata.Pyla
2023-09-25  5:35     ` Jan Kiszka
2023-09-25 16:58       ` [isar-cip-core v2 0/2] Add dosfstools recipe venkata.pyla
2023-09-25 16:58       ` [isar-cip-core v2 1/2] dosfstools: Add recipe to build it locally venkata.pyla
2023-09-25 16:58       ` [isar-cip-core v2 2/2] images: Add dosfstools as DEPENDENCY to all images venkata.pyla
2023-09-25 17:13         ` Jan Kiszka
2023-09-26  1:39           ` [cip-dev] " Venkata.Pyla
2023-09-26  7:10             ` Jan Kiszka
2023-09-26  7:41               ` Venkata.Pyla
2023-09-26  9:19                 ` Jan Kiszka
2023-09-26 11:51                   ` Venkata.Pyla
2023-09-26 12:57                     ` Jan Kiszka
2023-09-26 16:40                       ` [isar-cip-core v3 0/2] Add dosfstools recipe venkata.pyla
2023-09-27  5:54                         ` Jan Kiszka
2023-09-26 16:40                       ` [isar-cip-core v3 1/2] dosfstools: Add recipe to build it locally venkata.pyla
2023-09-26 16:40                       ` [isar-cip-core v3 2/2] conf/distro/cip-core-common.inc: Set dosfstools as build dependency venkata.pyla
2023-09-27  7:04                         ` Jan Kiszka
2023-09-27  7:16                           ` Venkata.Pyla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.