From 081e7fdd6a2f559bf94d46379391fa758b344d43 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Mon, 11 Jul 2022 12:54:55 +0000 Subject: [PATCH] Debian: Get http port from insturl for system node installs only The Debian kickstart is not defaulting the http_port to 8080 in /etc/platform/platform.conf when no port is specified in the insturl environment variable. This is seen to occur on initial controller-0 install because the http port is typically not specified on the command line in that case. The CentOS kickstart only ever tried to parse the http port value from the command line for 'system node' installs. See stx/metal/bsp-files/kickstarts/post_net_common.cfg With the unified kickstart, in Debian, an extra check needs to be added to only parse the insturl string for the http port for 'system node' installs. This update will continue to default the http port to 8080 unless its a 'system node' install which is identified by 'pxecontroller' in the insturl environment variable. In which case the http port should be present and will be extracted and added to platform.conf as done in CentOS. Test Plan: PASS: Debian build and install PASS: Verify platform.conf:http_port defaults to 8080 for controller-0 pxeboot or USB install cases. PASS: Verify platform.conf:http_port is updated with port number specified in insturl for the 'system node' install case. Closes-Bug: 1980381 Change-Id: Ibfa30a45fcf435eebb183d12c2380e06074fd157 --- kickstart/files/kickstart.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 3cc3e659..7859cefb 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -1466,7 +1466,7 @@ EOF # Set http port # Persist the default http port number to platform configuration. # This will get overwritten when by manifest during sw configuration phase. -if [[ "${insturl}" == *"http"* ]] ; then +if [[ "${insturl}" == *"pxecontroller"* && "${insturl}" == *"http"* ]] ; then http_port=$(echo $(cat /proc/cmdline |xargs -n1 echo |grep '^insturl=' | sed -r 's#^[^/]*://[^/]*:([0-9]*)/.*#\1#')) else http_port=8080