aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-09-18 18:52:00 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-09-18 18:52:52 +0000
commit7100e42128e4272ec7604cad4554866943556214 (patch)
tree3f00a65ce4cde12d10d18042e6aa820b6694615d
parent65d723234bf5dcd99f083ab4d5087b75ded2cfa6 (diff)
downloadpbuilder-7100e42128e4272ec7604cad4554866943556214.tar
pbuilder-7100e42128e4272ec7604cad4554866943556214.tar.gz
Allow copying the local configuration from a defined directory, instead of system /etc.
New configuration variable: CONFDIR Closes: #580086
-rw-r--r--pbuilder-modules18
-rw-r--r--pbuilderrc6
-rw-r--r--pbuilderrc.510
3 files changed, 28 insertions, 6 deletions
diff --git a/pbuilder-modules b/pbuilder-modules
index e5ec024..cd61f89 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -451,13 +451,19 @@ EOF
function copy_local_configuration () {
log "I: copying local configuration"
+ if [ -n "$CONFDIR" ] && [ -d "$CONFDIR" ]; then
+ log "I: copying files from $CONFDIR (if possible) instead of using the system ones"
+ fi
for a in hosts hostname resolv.conf mailname; do
- if [ -f "/etc/$a" ]; then
- rm -f "$BUILDPLACE/etc/$a"
- cp "$( readlink -f "/etc/$a" )" "$BUILDPLACE/etc/$a";
- else
- log "W: No local /etc/$a to copy, relying on $BUILDPLACE/etc/$a to be correct"
- fi
+ if [ -n "$CONFDIR" ] && [ -f "$CONFDIR/$a" ]; then
+ rm -f "$BUILDPLACE/etc/$a"
+ cp "$( readlink -f "$CONFDIR/$a" )" "$BUILDPLACE/etc/$a"
+ elif [ -f "/etc/$a" ]; then
+ rm -f "$BUILDPLACE/etc/$a"
+ cp "$( readlink -f "/etc/$a" )" "$BUILDPLACE/etc/$a"
+ else
+ log "W: No local /etc/$a to copy, relying on $BUILDPLACE/etc/$a to be correct"
+ fi
done
}
diff --git a/pbuilderrc b/pbuilderrc
index 08eeefc..7885665 100644
--- a/pbuilderrc
+++ b/pbuilderrc
@@ -122,3 +122,9 @@ AUTOCLEANAPTCACHE=""
#default COMPRESSPROG
COMPRESSPROG="gzip"
+
+# pbuilder copies some configuration files (like /etc/hosts or /etc/hostname)
+# from the host system into the chroot. If the directory specified here
+# exists and contains one of the copied files (without the leading /etc) that
+# file will be copied from here instead of the system one
+CONFDIR="/etc/pbuilder/conf_files"
diff --git a/pbuilderrc.5 b/pbuilderrc.5
index 352e59b..5a1f6aa 100644
--- a/pbuilderrc.5
+++ b/pbuilderrc.5
@@ -425,6 +425,16 @@ being mounted.
.TP
.BI "ADDITIONAL_BUILDRESULTS="""
Array of additional files to copy out of the build area.
+.TP
+.BI "CONFDIR=" "/etc/pbuilder/conf_files"
+.B pbuilder
+copies some configuration files (like
+.B /etc/hosts
+or
+.BR /etc/hostname )
+from the host system into the chroot. If the directory specified here
+exists and contains one of the copied files (without the leading /etc) that
+file will be copied from here instead of the system one.
.SH "AUTHOR"
Initial coding, and main maintenance is done by