summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-02-07 10:04:51 +0100
committerDaniel Baumann <daniel@debian.org>2012-02-07 10:04:51 +0100
commitb1c3aecd289434670fd488a2ce04d26f3c8d7cd8 (patch)
tree395f8dd53774739768b101b43bf518d38391295c
parent6c989729883bf804cd80aaeea8505a335f863d0e (diff)
downloadvyos-live-build-b1c3aecd289434670fd488a2ce04d26f3c8d7cd8.tar.gz
vyos-live-build-b1c3aecd289434670fd488a2ce04d26f3c8d7cd8.zip
Handling /etc/resolv.conf even if it's a dangling symlink like with resolv.conf, thanks to Stephane Graber <stgraber@ubuntu.com> (Closes: #657640).
-rwxr-xr-xscripts/build/lb_chroot_resolv6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/build/lb_chroot_resolv b/scripts/build/lb_chroot_resolv
index d405924b6..d47c3edbf 100755
--- a/scripts/build/lb_chroot_resolv
+++ b/scripts/build/lb_chroot_resolv
@@ -51,6 +51,10 @@ case "${1}" in
# If you want to have a custom resolv.conf, please
# overwrite it with normal local_includes mechanism.
Truncate chroot/etc/resolv.conf.orig
+ elif [ -L chroot/etc/resolv.conf ]
+ then
+ # Move resolv.conf aside if it's a symlink (likely resolvconf)
+ mv chroot/etc/resolv.conf chroot/etc/resolv.conf.orig
fi
if [ -f /etc/resolv.conf ]
@@ -77,7 +81,7 @@ case "${1}" in
# Copying local resolv.conf
cp -a config/includes.chroot/etc/resolv.conf chroot/etc/resolv.conf
rm -f chroot/etc/resolv.conf.orig
- elif [ -e chroot/etc/resolv.conf.orig ]
+ elif [ -e chroot/etc/resolv.conf.orig ] || [ -L chroot/etc/resolv.conf.orig ]
then
# Restoring resolv file or symlink
mv chroot/etc/resolv.conf.orig chroot/etc/resolv.conf