appliance: Create an /etc/resolv.conf file referring to qemu user network nameserver (RHBZ#1044585).

This commit is contained in:
Richard W.M. Jones
2013-12-18 16:03:43 +00:00
parent 1ee879f3e5
commit 1fcea09ee2
3 changed files with 2 additions and 13 deletions

View File

@@ -80,6 +80,8 @@ ip link set dev eth0 up
ip route add default via 169.254.2.2
echo nameserver 169.254.2.3 > /etc/resolv.conf
# Scan for MDs.
mdadm -As --auto=yes --run

View File

@@ -53,12 +53,6 @@ grep -v '^/usr/share/gnome/help/' |
grep -v '^/usr/share/cracklib/' |
grep -v '^/usr/share/i18n/' > supermin.d/hostfiles-t
# XXX resolv.conf? The old script had:
# echo nameserver 169.254.2.3 > resolv.conf
if ! grep -q /etc/resolv.conf supermin.d/hostfiles-t; then
echo /etc/resolv.conf >> supermin.d/hostfiles-t
fi
# Include any Augeas lenses from the host.
if grep -q /usr/share/augeas/lenses supermin.d/hostfiles-t; then
echo "/usr/share/augeas/lenses/*.aug" >> supermin.d/hostfiles-t

View File

@@ -93,13 +93,6 @@ guestfs__launch (guestfs_h *g)
if (g->backend_ops->launch (g, g->backend_data, g->backend_arg) == -1)
return -1;
/* If network is enabled, upload /etc/resolv.conf from the host so
* the guest will know how to reach the nameservers.
*/
if (g->enable_network && access ("/etc/resolv.conf", F_OK) == 0) {
guestfs_internal_upload (g, "/etc/resolv.conf", "/etc/resolv.conf", 0644);
}
return 0;
}