diff mbox series

[isar-cip-core,v1] Set fixed UUID for EROFS

Message ID 20250303062220.4190969-1-Shivanand.Kunijadar@toshiba-tsip.com (mailing list archive)
State Accepted
Headers show
Series [isar-cip-core,v1] Set fixed UUID for EROFS | expand

Commit Message

Shivanand Kunijadar March 3, 2025, 6:22 a.m. UTC
Pass fixed UUID based on the SOURCE_DATE_EPOCH variable to make the EROFS
filesystem reproducible.

Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
---
 classes/erofs.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Jan Kiszka March 4, 2025, 5:12 a.m. UTC | #1
On 03.03.25 07:22, Shivanand Kunijadar wrote:
> Pass fixed UUID based on the SOURCE_DATE_EPOCH variable to make the EROFS
> filesystem reproducible.
> 
> Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
> ---
>  classes/erofs.bbclass | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/classes/erofs.bbclass b/classes/erofs.bbclass
> index 72458bb..2743bd1 100644
> --- a/classes/erofs.bbclass
> +++ b/classes/erofs.bbclass
> @@ -25,6 +25,14 @@ python __anonymous() {
>      for dir in exclude_directories:
>          args += " --exclude-regex '^{dir}/.*' ".format(dir=dir)
>      d.appendVar('EROFS_CREATION_ARGS', args)
> +
> +    import uuid
> +
> +    sde_time = int(d.getVar('SOURCE_DATE_EPOCH'))
> +    erofs_uuid = uuid.UUID(int=sde_time)
> +
> +    args = "-U " + str(erofs_uuid)
> +    d.appendVar('EROFS_CREATION_ARGS', args)
>  }
>  
>  IMAGE_CMD:erofs[depends] = "${PN}:do_transform_template"

Thanks, applied.

Jan
diff mbox series

Patch

diff --git a/classes/erofs.bbclass b/classes/erofs.bbclass
index 72458bb..2743bd1 100644
--- a/classes/erofs.bbclass
+++ b/classes/erofs.bbclass
@@ -25,6 +25,14 @@  python __anonymous() {
     for dir in exclude_directories:
         args += " --exclude-regex '^{dir}/.*' ".format(dir=dir)
     d.appendVar('EROFS_CREATION_ARGS', args)
+
+    import uuid
+
+    sde_time = int(d.getVar('SOURCE_DATE_EPOCH'))
+    erofs_uuid = uuid.UUID(int=sde_time)
+
+    args = "-U " + str(erofs_uuid)
+    d.appendVar('EROFS_CREATION_ARGS', args)
 }
 
 IMAGE_CMD:erofs[depends] = "${PN}:do_transform_template"