mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
appliance: Create an /etc/resolv.conf file referring to qemu user network nameserver (RHBZ#1044585).
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user