[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#769844: linux: please make linux build reproducibly



On Wed, 2015-01-07 at 20:49 +0100, Jérémy Bobbio wrote:
> > > +@@ -301,7 +301,9 @@ if [ ! -z ${output_file} ]; then
> > > + 	if [ -z ${cpio_file} ]; then
> > > + 		timestamp=
> > > + 		if test -n "$KBUILD_BUILD_TIMESTAMP"; then
> > > +-			timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)"
> > > ++			source_date=$(echo "$KBUILD_BUILD_TIMESTAMP" |
> > > ++					sed -e 's/.*(\([0-9-]\+\)).*/\1/')
> > > ++			timestamp="$(date -d"$source_date" +%s || :)"
> > 
> > This solution may not work.  The patched source can be built with a
> > normal timestamp override, via linux-source.
> 
> The above construction will work given a standard date in
> KBUILD_BUILD_TIMESTAMP. The sed expression only match parenthesises.
> I am open to other suggestions.

How about changing debian/rules.real to set some other variable (e.g.
DEB_BUILD_TIMESTAMP, or whatever) to our special version string and
patching the relevant code (not here, but the scripts/mkcompile_h one)
to prefer $DEB_BUILD_TIMESTAMP but still support $KBUILD_BUILD_TIMESTAMP
as a fallback?

I think we would still need to set KBUILD_BUILD_TIMESTAMP to the
debian/changelog date in rules.real.

Ian.


Reply to: