That won't be enough. A fresh installer image comes with no
/tmp/bsdinstall_etc/resolv.conf. The reason why you don't experience any problems now is that file has been created from earlier attempts. That file must be present before running
dhclient(8).
I experimented more on DHCP network interface configuration and populating
resolv.conf on a fresh installer image. The following settings seems to be enough, they create a
resolv.conf file and request an IP for the network interface and name server addresses from the DHCP server. No other settings are necessary.
/etc/rc.local
Code:
# resolv.conf from DHCP ends up in here, so make sure the directory exists
mkdir /tmp/bsdinstall_etc
# Add here the following two lines after the above command
touch /tmp/bsdinstall_etc/resolv.conf
dhclient em0
Setting
dhclient em0
in
/etc/installerconfig is not the right place to put. Network device configuration and name resolving of the installer images system shouldn't be mixed with commands targeting the to be new installed and configured system, they should all go into
/etc/rc.local. It works but it's bad scripting practice.
chk.jxcn is in error, the installer images system network configuration has nothing to do with a chrooted environment. See for reason third sentence, after the first quote.