Skip to content

Commit 9c28591

Browse files
committed
feat: add reproducibility check
1 parent 7ad9288 commit 9c28591

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# mkosi artifacts
22

33
build/
4+
build.*/
45
env.json
56
mkosi.builddir/
67
mkosi.cache/

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,38 @@ build-dev: check-perms setup ## Build module with development tools
5050

5151
##@ Utilities
5252

53+
check-repro: ## Build same module twice and compare resulting images
54+
@rm -rf build.1
55+
@rm -rf build.2
56+
57+
@rm -rf build/* mkosi.builddir/* mkosi.cache/* mkosi.packages/*
58+
@sleep 5
59+
60+
@echo "Building image #1..."
61+
$(WRAPPER) mkosi --force -I $(IMAGE).conf
62+
@cp -r build build.1
63+
64+
@rm -rf build/* mkosi.builddir/* mkosi.cache/* mkosi.packages/*
65+
@sleep 5
66+
67+
@echo "Building image #2..."
68+
$(WRAPPER) mkosi --force -I $(IMAGE).conf
69+
@cp -r build build.2
70+
71+
@echo "Comparing..."
72+
73+
@echo ""
74+
@sha256sum build.1/tdx-debian.vmlinuz
75+
@sha256sum build.2/tdx-debian.vmlinuz
76+
77+
@echo ""
78+
@sha256sum build.1/tdx-debian.initrd
79+
@sha256sum build.2/tdx-debian.initrd
80+
81+
@echo ""
82+
@sha256sum build.1/tdx-debian.efi
83+
@sha256sum build.2/tdx-debian.efi
84+
5385
measure: ## Export TDX measurements for the built EFI file
5486
@if [ ! -f build/tdx-debian.efi ]; then \
5587
echo "Error: build/tdx-debian.efi not found. Run 'make build' first."; \

0 commit comments

Comments
 (0)