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 <jack.ding@windriver.com>
This commit is contained in:
Don Penney 2018-06-12 10:23:06 -04:00 committed by Jack Ding
parent 697da9720b
commit 6ee64f7f4e
1 changed files with 1 additions and 1 deletions

View File

@ -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"