Hi Felix,
On Thu, 2023-12-07 at 21:11 +0530, venkat...@toshiba-tsip.com wrote:
> From: venkata pyla <venkat...@toshiba-tsip.com>
>
> E2FSPROGS_FAKE_TIME: sets fixed times for the inodes in the file
> system.
> hash_seed: creates reproducible directory indexes in the file system.
>
> Reference commit in e2fsprogs:
> e1f7100643a46456be107b33098f6034b0835e6d
>
> Signed-off-by: venkata pyla <venkat...@toshiba-tsip.com>
> ---
> scripts/lib/wic/partition.py | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/scripts/lib/wic/partition.py
> b/scripts/lib/wic/partition.py
> index e50871b8..90b2c037 100644
> --- a/scripts/lib/wic/partition.py
> +++ b/scripts/lib/wic/partition.py
> @@ -280,6 +280,17 @@ class Partition():
>
> extraopts = self.mkfs_extraopts or "-F -i 8192"
>
> + if os.getenv('SOURCE_DATE_EPOCH'):
> + sde_time = int(os.getenv('SOURCE_DATE_EPOCH'))
> + pseudo = "export E2FSPROGS_FAKE_TIME=%s;%s" % (sde_time,
> pseudo)
> +
> + # Set hash_seed to generate deterministic directory
> indexes
> + namespace = uuid.UUID("e7429877-e7b3-4a68-a5c9-
> 2f2fdf33d460")
> + if self.fsuuid:
> + namespace = uuid.UUID(self.fsuuid)
> + hash_seed = str(uuid.uuid5(namespace, str(sde_time)))
> + extraopts += " -E hash_seed=%s" % hash_seed
> +
Hi, while reworking the SDE in ISAR, I stumbled upon this as well.
This patch only covers the .wic part, but we need a similar patch for
the IMAGE_CMD:ext4 as well. I tried to mimic the pattern there, but I
was not able to make the .ext4 build reproducible (the diff indicated
that the inodes are still shuffled around). This makes me wonder if
mke2fs.ext4 even supports producing a reproducible rootfs.
Have you been able to create a bit-by-bit identical .wic of an ext4
partition?
Best regards,
Felix
> label_str = ""
> if self.label:
> label_str = "-L %s" % self.label
--
Siemens AG, Technology
Linux Expert Center