summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-05 21:32:47 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-05 21:32:47 +0200
commit4e98b52ea75d5a91f88e47089ae5e279ffa1c140 (patch)
tree9ba1d9c1011cf19da89a2baec10c87323c0ea841
parentf0c8e7292d3de3e4af5f923855c422a0bdb7f394 (diff)
downloadrebel-4e98b52ea75d5a91f88e47089ae5e279ffa1c140.tar
rebel-4e98b52ea75d5a91f88e47089ae5e279ffa1c140.zip
examples: image: do not rely on INPUT_HASH for reproducibility
-rw-r--r--examples/recipes/image/build.yml13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/recipes/image/build.yml b/examples/recipes/image/build.yml
index 3f6d8f3..0d5fac4 100644
--- a/examples/recipes/image/build.yml
+++ b/examples/recipes/image/build.yml
@@ -46,12 +46,15 @@ tasks:
default: {}
run: |
IMAGE={{destdir}}/{{basename}}.ext4
- UUID="$(
- python3 \
- -c 'import sys; import uuid; print(uuid.UUID(hex=sys.argv[1][:32], version=4))' \
- "$INPUT_HASH"
- )"
mkdir {{destdir}}
make_ext4fs -l 2G -T "$SOURCE_DATE_EPOCH" -L root "$IMAGE" {{sysroot}}
+ E2FSPROGS_FAKE_TIME="$SOURCE_DATE_EPOCH" tune2fs -U '00000000-0000-4000-8000-000000000000' "$IMAGE"
+
+ HASH=$(sha256sum "$IMAGE")
+ UUID=$(
+ python3 \
+ -c 'import sys; import uuid; print(uuid.UUID(hex=sys.argv[1][:32], version=4))' \
+ "$HASH"
+ )
E2FSPROGS_FAKE_TIME="$SOURCE_DATE_EPOCH" tune2fs -U "$UUID" "$IMAGE"