In vm_install_base(), copy the host resolv.conf into

the build chroot before attempting to do anything that
requires working DNS (i.e., pkg bootstrap).

In vm_extra_pre_umount(), remove the resolv.conf before
the disk image is unmounted from the backing md(4).

Reported by:	cperciva
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Glen Barber 2014-11-19 20:19:53 +00:00
parent 9d3df3bdb7
commit 91333d6a2d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/release-vmimage/; revision=274725
3 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,8 @@ vm_extra_pre_umount() {
echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf
echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf
rm -f ${DESTDIR}/etc/resolv.conf
return 0
}

View File

@ -22,5 +22,7 @@ vm_extra_pre_umount() {
echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
rm -f ${DESTDIR}/etc/resolv.conf
return 0
}

View File

@ -85,6 +85,8 @@ vm_install_base() {
chroot ${DESTDIR} /etc/rc.d/ldconfig forcestart
umount ${DESTDIR}/dev
cp /etc/resolv.conf ${DESTDIR}/etc/resolv.conf
return 0
}
@ -131,6 +133,8 @@ vm_extra_pre_umount() {
# Prototype. When overridden, installs additional ports within the
# virtual machine environment.
rm -f ${DESTDIR}/etc/resolv.conf
return 0
}