From 30e5050c234f1b8ecefc91a9cae37cb21c79c299 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 05 Aug 2014 14:53:19 -0400 Subject: installers/pc: Save mirror address to /etc/hosts If the user gives a network interface a static configuration, /etc/resolv.conf may be overwritten with values invalid for the current network. --- diff --git a/installers/pc.sh b/installers/pc.sh index 39e1e94..5729743 100755 --- a/installers/pc.sh +++ b/installers/pc.sh @@ -60,8 +60,13 @@ main() "${0%installers/pc.sh}./miniprokit.sh" install \ -a "${host_arch}" -P "${host_plat}" \ ${mirror:+-m} ${mirror} "${mountpoint}" + mirror="$(printf '%s\n' "${mirror}" | \ + sed 's|^.*://||; s|^.*@||; s|/.*$||g;')" + printf '%s %s\n' "$(nslookup "${mirror}" | sed -n 's/Address: //p' | \ + head -n 1)" "${mirror}" >"${mountpoint}/etc/hosts" "${0%installers/pc.sh}./miniprokit.sh" shell "${mountpoint}" \ <"${0%pc.sh}data/pc.sh" + rm "${mountpoint}/etc/hosts" umount_fs "${mountpoint}" } -- cgit v0.9.1