Skip to content

Commit

Permalink
fs/erofs: enable support for reproducible build
Browse files Browse the repository at this point in the history
By default, mkfs.erofs will sue the current date to set some metadata
in the filesystem it generates, and will also use generate a random UUID
for that filesystem. This is not reproducible.

When BR2_REPRODUCIBLE is selected, set the filesystem timestamps to
$SOURCE_DATE_EPOCH, and the filesystem UUID to the nil uuid (as good
as any other arbitrary one).

Signed-off-by: Casey Reeves <[email protected]>
[[email protected]:
  - one multi-line assignment, not two
  - slightly rephrase the commit log
]
Signed-off-by: Yann E. MORIN <[email protected]>
  • Loading branch information
Casey Reeves authored and yann-morin-1998 committed Jan 16, 2023
1 parent 162f656 commit ac5ecaf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/erofs/erofs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ ifeq ($(BR2_TARGET_ROOTFS_EROFS_LZ4HC),y)
ROOTFS_EROFS_ARGS += -zlz4hc
endif

ifeq ($(BR2_REPRODUCIBLE),y)
ROOTFS_EROFS_ARGS += \
-T $(SOURCE_DATE_EPOCH) \
-U 00000000-0000-0000-0000-000000000000
endif

ifneq ($(BR2_TARGET_ROOTFS_EROFS_PCLUSTERSIZE),0)
ROOTFS_EROFS_ARGS += -C$(strip $(BR2_TARGET_ROOTFS_EROFS_PCLUSTERSIZE))
endif
Expand Down

0 comments on commit ac5ecaf

Please sign in to comment.