MFC r325863:

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.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Glen Barber 2017-11-20 15:46:23 +00:00
parent ff942643fd
commit 36149ef35f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=326014

View File

@ -246,8 +246,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