From 968fb132a9cfde5b0ef1468e4ccd97359f69490f Mon Sep 17 00:00:00 2001 From: Don Penney Date: Tue, 12 Jun 2018 10:23:06 -0400 Subject: [PATCH] Fix anaconda host IP caching to handle port number in URL A hook was added to run before Anaconda installer to lookup the IP address of the boot server and write it to /etc/hosts, in order to avoid DNS queries during the installation. However, the regex to grab the server from the kickstart URL did not handle the case where a port was specified, ie http://bootserver:8080/..., and the hook would hang trying to ping an invalid name. This update extends the regex in the hook to ignore the port number, if present. Change-Id: Idec2219f0be55f08e7fd648a91a32428178715f6 Story: 2002856 Task: 22805 Signed-off-by: Jack Ding Signed-off-by: Scott Little --- .../centos/patches/0004-Cache-server-ip-in-etc-hosts.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch b/base/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch index f3469aa68..320a7bdff 100644 --- a/base/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch +++ b/base/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch @@ -50,7 +50,7 @@ index 0000000..e3f79a4 +cat /proc/cmdline | grep -q 'inst\.ks=http://' +if [ $? -eq 0 ] +then -+ server=$(cat /proc/cmdline | sed -r 's#.*inst\.ks=http://([^/]*)/.*#\1#') ++ server=$(cat /proc/cmdline | sed -r 's#.*inst\.ks=http://([^/:]*)(:[^/]*)?/.*#\1#') + if [ -n "$server" ] + then + echo "Testing connectivity to server: $server"