summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorJérémy Bobbio <lunar@debian.org>2015-01-19 18:56:06 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-19 19:09:44 +0100
commit385d843820d3a2f5561f0eb7ea7372f1e7fdbaa8 (patch)
tree884dbba468ce82a5bec9690e90597d4ba707aed3 /etc
parent30679ab6a81684b380653637e4f2a5fe31a15cae (diff)
downloadjenkins.debian.net-385d843820d3a2f5561f0eb7ea7372f1e7fdbaa8.tar.xz
reproducible: change the hostname in the second build
Diffstat (limited to 'etc')
-rwxr-xr-xetc/pbuilder/rebuild-hooks/D01_hostname10
-rw-r--r--etc/sudoers.d/jenkins1
2 files changed, 11 insertions, 0 deletions
diff --git a/etc/pbuilder/rebuild-hooks/D01_hostname b/etc/pbuilder/rebuild-hooks/D01_hostname
new file mode 100755
index 00000000..1bf4c2d2
--- /dev/null
+++ b/etc/pbuilder/rebuild-hooks/D01_hostname
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+# exit if we are in the same UTS namespace than init
+[ "$(readlink /proc/1/ns/uts)" = "$(readlink /proc/self/ns/uts)" ] && exit 0
+
+echo "I: Changing hostname to test build reproducibility" >&2
+sed -e '/^127.0.0.1/s/$/ i-capture-the-hostname/' -i /etc/hosts
+hostname i-capture-the-hostname
diff --git a/etc/sudoers.d/jenkins b/etc/sudoers.d/jenkins
index 11713c2e..677e5886 100644
--- a/etc/sudoers.d/jenkins
+++ b/etc/sudoers.d/jenkins
@@ -30,6 +30,7 @@ jenkins ALL= \
/bin/cp -rv /media/*, \
/bin/chown -R jenkins\:jenkins /var/lib/jenkins/jobs/*,\
SETENV: NOPASSWD: /usr/sbin/pbuilder *, \
+ SETENV: NOPASSWD: /usr/bin/unshare /usr/sbin/pbuilder *, \
/bin/mv /var/cache/pbuilder/base*.tgz /var/cache/pbuilder/base*.tgz, \
/bin/rm /var/cache/pbuilder/base*.tgz, \
/bin/rm -v /var/cache/pbuilder/base*.tgz, \