Bug 12719

Summary: Support reproducible build for kernel modules tarball
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Juro Bystricky <juro.bystricky>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Medium CC: bluelightning, meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, stephano
Version: 2.5   
Target Milestone: 6.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Juro Bystricky 2018-04-27 13:32:53 UTC
The goal of this enhancement is to build reproducible modules-qemux86.tgz tarballs for:

$ MACHINE=qemux86 bitbake core-image-minimal


The resulting tarballs of this build are placed in the folder <builddir>/tmp/deploy/images/qemux86

Repeating the build in a different folder will place the tarballs in:
<builddir-different>/tmp/deploy/images/qemux86

The build is deemed reproducible if the tarballs are binary identical.
This is rather simple, replacing the line in kernel.bbclass:

tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib

with:

sde=$(get_sde)
tar -I "gzip -9n" --sort=name --clamp-mtime --mtime=@$sde -cvf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib

But we should wait until we resolve:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12707

(Otherwise we would need to do some run-time checks for supported "tar" command line arguments)
Comment 1 Richard Purdie 2020-05-07 08:08:56 UTC
I believe we now have the minimum tar version needed at least.
Comment 2 Randy MacLeod 2023-10-24 14:24:20 UTC
Bulk move from 4.99 or 0.00 to 5.99