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
This commit is contained in:
Eric MacDonald 2022-07-11 12:54:55 +00:00
parent a91e25e784
commit 081e7fdd6a

View File

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