mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-12 09:08:20 +04:00
UBIFS root file systems differ between builds, e.g. the one of the Microchip SAMA7G5-EK: the superblock gets a random UUID, the inodes get the ctime of the build host, which can't be reset with touch, and the entries of each directory are added in readdir() order, which depends on the host file system and decides inode numbers and layout. Add a patch that, when SOURCE_DATE_EPOCH is set, uses a time-based (version 1) UUID with that time and clamps all inode times to it. The node ID of the UUID is taken from the new --uuid-node option, which the image build sets from IMG_PART_DISKGUID, itself derived from SOURCE_DATE_EPOCH and the kernel vermagic. Directory entries are added sorted by name. Two trees with the same contents but different ctimes and readdir() order now give identical images; without SOURCE_DATE_EPOCH the UUID stays random. Link: https://github.com/openwrt/openwrt/pull/25430 Signed-off-by: Paul Spooren <mail@aparcar.org>