From e5cda1f731630f98f61c43ddb19944d0b47a2c64 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Fri, 30 Nov 2012 15:40:24 +0000 Subject: [PATCH] Use system resolv.conf file when available Where possible use the system configured resolv.conf file to to support resolution of internal servers such as proxies. Use previous hardcoded google dns nameserver as fallback Change-Id: Ibc1e8a3b96e733a2f7fbcdd4b2c5d3e8926424c4 --- lib/img-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/img-functions b/lib/img-functions index 05faad87..a73face3 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -86,7 +86,13 @@ function create_base () { # Recreate resolv.conf sudo touch $TMP_MOUNT_PATH/etc/resolv.conf sudo chmod 777 $TMP_MOUNT_PATH/etc/resolv.conf - echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf + # use system configured resolv.conf if available to support internal proxy resolving + if [ -e /etc/resolv.conf ] + then + cat /etc/resolv.conf > $TMP_MOUNT_PATH/etc/resolv.conf + else + echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf + fi # supporting kernel file systems sudo mount -t proc none $TMP_MOUNT_PATH/proc