summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-05-12 16:19:24 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-14 14:15:11 +0100
commit54865c7c1eff7de0dde358f54614c11ea3fc98ac (patch)
tree11ca10dca5198d521a21290b5b2521036ea9f36a /meta
parent81da240a5f8263dffb70e00bd52a0783ee6718fc (diff)
downloadpoky-54865c7c1eff7de0dde358f54614c11ea3fc98ac.tar.gz
classes/kernel: Generate reproducible kernel module tarball
If reproducible binaries are requested, generate the kernel modules tarball in a reproducible way. Namely, sort the tarball contents, clamp the mtime to the source date epoch, compress the archive with a consistent compression level (9), and don't include the name and timestamp in the compressed file. [YOCTO #12719] (From OE-Core rev: 5c6a472c82a9b3c122fc54d3ee7171508c643a8b) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/kernel.bbclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index a724645466..6846d6040d 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -691,7 +691,13 @@ kernel_do_deploy() {
691 691
692 if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then 692 if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
693 mkdir -p ${D}${root_prefix}/lib 693 mkdir -p ${D}${root_prefix}/lib
694 tar -cvzf $deployDir/modules-${MODULE_TARBALL_NAME}.tgz -C ${D}${root_prefix} lib 694 if [ -n "${SOURCE_DATE_EPOCH}" ]; then
695 TAR_ARGS="--sort=name --clamp-mtime --mtime=@${SOURCE_DATE_EPOCH}"
696 else
697 TAR_ARGS=""
698 fi
699 tar $TAR_ARGS -cv -C ${D}${root_prefix} lib | gzip -9n > $deployDir/modules-${MODULE_TARBALL_NAME}.tgz
700
695 ln -sf modules-${MODULE_TARBALL_NAME}.tgz $deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz 701 ln -sf modules-${MODULE_TARBALL_NAME}.tgz $deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz
696 fi 702 fi
697 703