From 6ee64f7f4ead06e4975f84f26b80436798bb352f 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: I4e7e2c17ccee3b6f0fa3e31d5606cb9caa53372e Story: 2002856 Task: 22805 Signed-off-by: Jack Ding --- anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch b/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch index f3469aa..320a7bd 100644 --- a/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch +++ b/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"