Only copy /etc/resolv.conf to ${CHROOTDIR} if /etc/resolv.conf does

not already exist within ${CHROOTDIR}.  This allows re-using a build
chroot with CHROOTBUILD_SKIP set to a non-empty value and CHROOTDIR
set to '/' in release.conf.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Glen Barber 2017-11-15 19:14:44 +00:00
parent cac201b866
commit d294a5246f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325863

View file

@ -252,8 +252,8 @@ chroot_setup() {
extra_chroot_setup() {
mkdir -p ${CHROOTDIR}/dev
mount -t devfs devfs ${CHROOTDIR}/dev
[ -e /etc/resolv.conf ] && cp /etc/resolv.conf \
${CHROOTDIR}/etc/resolv.conf
[ -e /etc/resolv.conf -a ! -e ${CHROOTDIR}/etc/resolv.conf ] && \
cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf
# Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints
# is created. This is needed by ports-mgmt/pkg.
eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart