All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH 0/2] ntp: Reproducible build
@ 2018-11-13  5:08 Douglas Royds
  2018-11-13  5:08 ` [meta-networking][PATCH 1/2] ntp: Reproducible build: Respect SOURCE_DATE_EPOCH Douglas Royds
  2018-11-13  5:08 ` [meta-networking][PATCH 2/2] ntp: Reproducible build: Use fixed path to posix shell Douglas Royds
  0 siblings, 2 replies; 3+ messages in thread
From: Douglas Royds @ 2018-11-13  5:08 UTC (permalink / raw)
  To: openembedded-devel

I have marked the "Use fixed path to posix shell" patch as submitted upstream,
but I have only raised an issue on the ntp project, asking for advice on an approach.
This patch does the job for OE, but isn't appropriate in its current form for upstream.

The "Respect SOURCE_DATE_EPOCH" patch has been submitted upstream in this form.

Douglas Royds (2):
  ntp: Reproducible build: Respect SOURCE_DATE_EPOCH
  ntp: Reproducible build: Use fixed path to posix shell

 ...producibility-fixed-path-to-posix-shell.patch | 15 +++++++++++++++
 ...producibility-respect-source-date-epoch.patch | 16 ++++++++++++++++
 .../recipes-support/ntp/ntp_4.2.8p12.bb          |  2 ++
 3 files changed, 33 insertions(+)
 create mode 100644 meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch
 create mode 100644 meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch

-- 
2.17.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [meta-networking][PATCH 1/2] ntp: Reproducible build: Respect SOURCE_DATE_EPOCH
  2018-11-13  5:08 [meta-networking][PATCH 0/2] ntp: Reproducible build Douglas Royds
@ 2018-11-13  5:08 ` Douglas Royds
  2018-11-13  5:08 ` [meta-networking][PATCH 2/2] ntp: Reproducible build: Use fixed path to posix shell Douglas Royds
  1 sibling, 0 replies; 3+ messages in thread
From: Douglas Royds @ 2018-11-13  5:08 UTC (permalink / raw)
  To: openembedded-devel

If a SOURCE_DATE_EPOCH is set in the environment, use that date in the build
version string, otherwise use the current build date.
See https://reproducible-builds.org/docs/source-date-epoch/

Should GNU date options fail, try BSD date options as a fall-back.
This patch can potentially be pushed upstream for use on Mac OSX or OpenBSD,
though it has not been tested on OSX or any BSD platform.

Upstream-Status: Submitted http://bugs.ntp.org/show_bug.cgi?id=3550
Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
---
 ...producibility-respect-source-date-epoch.patch | 16 ++++++++++++++++
 .../recipes-support/ntp/ntp_4.2.8p12.bb          |  1 +
 2 files changed, 17 insertions(+)
 create mode 100644 meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch

diff --git a/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch b/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch
new file mode 100644
index 000000000..58e71c3b8
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch
@@ -0,0 +1,16 @@
+--- ntp-4.2.8p12.original/scripts/build/mkver.in	2018-11-12 14:06:49.333020430 +1300
++++ ntp-4.2.8p12/scripts/build/mkver.in	2018-11-12 14:15:04.947480167 +1300
+@@ -15,7 +15,12 @@
+  *) ConfStr="${ConfStr}-@VER_SUFFIX@" ;;
+ esac
+ 
+-ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`"
++if [ -n "$SOURCE_DATE_EPOCH" ]; then
++   ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -d@$SOURCE_DATE_EPOCH 2>/dev/null`" ||
++   ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -r $SOURCE_DATE_EPOCH`"
++else
++   ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`"
++fi
+ 
+ if [ ! -f .version ]; then
+   echo 0 > .version
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb b/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
index 425430115..536679f4d 100644
--- a/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
+++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
@@ -12,6 +12,7 @@ DEPENDS = "libevent"
 
 SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
            file://ntp-4.2.4_p6-nano.patch \
+           file://reproducibility-respect-source-date-epoch.patch \
            file://ntpd \
            file://ntp.conf \
            file://ntpdate \
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [meta-networking][PATCH 2/2] ntp: Reproducible build: Use fixed path to posix shell
  2018-11-13  5:08 [meta-networking][PATCH 0/2] ntp: Reproducible build Douglas Royds
  2018-11-13  5:08 ` [meta-networking][PATCH 1/2] ntp: Reproducible build: Respect SOURCE_DATE_EPOCH Douglas Royds
@ 2018-11-13  5:08 ` Douglas Royds
  1 sibling, 0 replies; 3+ messages in thread
From: Douglas Royds @ 2018-11-13  5:08 UTC (permalink / raw)
  To: openembedded-devel

At configure time, the ntp build goes looking on the build machine for a posix
shell, using `which` to find it. Under OE, it settles on hosttools/bash,
resulting in this build host path being written into several binaries.
This did not affect the Debian reproducibility project, presumably because it
consistently found bash at /bin/bash.

Don't go looking, just use a fixed path to /bin/sh instead.

Upstream-Status: Submitted http://bugs.ntp.org/show_bug.cgi?id=3551
Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
---
 ...eproducibility-fixed-path-to-posix-shell.patch | 15 +++++++++++++++
 .../recipes-support/ntp/ntp_4.2.8p12.bb           |  1 +
 2 files changed, 16 insertions(+)
 create mode 100644 meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch

diff --git a/meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch b/meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch
new file mode 100644
index 000000000..571db75f7
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch
@@ -0,0 +1,15 @@
+--- ntp-4.2.8p12.original/sntp/libopts/m4/libopts.m4	2018-11-12 17:54:57.747220846 +1300
++++ ntp-4.2.8p12/sntp/libopts/m4/libopts.m4	2018-11-12 18:00:50.626211641 +1300
+@@ -114,12 +114,6 @@
+   AC_PROG_SED
+   [while :
+   do
+-      POSIX_SHELL=`which bash`
+-      test -x "$POSIX_SHELL" && break
+-      POSIX_SHELL=`which dash`
+-      test -x "$POSIX_SHELL" && break
+-      POSIX_SHELL=/usr/xpg4/bin/sh
+-      test -x "$POSIX_SHELL" && break
+       POSIX_SHELL=`/bin/sh -c '
+           exec 2>/dev/null
+           if ! true ; then exit 1 ; fi
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb b/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
index 536679f4d..53e41297a 100644
--- a/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
+++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p12.bb
@@ -12,6 +12,7 @@ DEPENDS = "libevent"
 
 SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
            file://ntp-4.2.4_p6-nano.patch \
+           file://reproducibility-fixed-path-to-posix-shell.patch \
            file://reproducibility-respect-source-date-epoch.patch \
            file://ntpd \
            file://ntp.conf \
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-13  5:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13  5:08 [meta-networking][PATCH 0/2] ntp: Reproducible build Douglas Royds
2018-11-13  5:08 ` [meta-networking][PATCH 1/2] ntp: Reproducible build: Respect SOURCE_DATE_EPOCH Douglas Royds
2018-11-13  5:08 ` [meta-networking][PATCH 2/2] ntp: Reproducible build: Use fixed path to posix shell Douglas Royds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.