Skip to content

Commit

Permalink
Improve reproducibility of initramfs
Browse files Browse the repository at this point in the history
Use SOURCE_DATE_EPOCH variable
  • Loading branch information
marmarek committed Feb 27, 2019
1 parent eb4c9ed commit 43235dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,12 @@ if [ -z "$modules_dep" ]; then
depmod -F %buildroot/boot/System.map-%kernelrelease \
-b "$tmpdir" -a %kernelrelease || exit 1
pushd "$tmpdir"
if [ -n "$SOURCE_DATE_EPOCH" ]; then
find . -exec touch --no-dereferece --date="@${SOURCE_DATE_EPOCH}" {} +
fi
find . -print0 | sort -z \
| cpio --null -R 0:0 -H newc -o --quiet \
| gzip > %buildroot/%vm_install_dir/initramfs || exit 1
| cpio --null -R 0:0 -H newc -o --reproducible --quiet \
| gzip -n > %buildroot/%vm_install_dir/initramfs || exit 1
popd
fi

Expand Down

0 comments on commit 43235dd

Please sign in to comment.