diff options
author | Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com> | 2018-11-06 18:08:14 +0530 |
---|---|---|
committer | Thomas Abraham <thomas.abraham@arm.com> | 2018-12-27 16:04:39 +0530 |
commit | 6e2f0815d048abb70b961d9921218305601ea637 (patch) | |
tree | 2458572d68ef2570bd0b2dabfe6c1f618b49ab35 /sgi | |
parent | 72b8b2cbd03a98fca20c6ab773f04ed868f2c95d (diff) |
sgi/common: add helper function to parse IP address from fedora boot log
Add helper function to find and return IP address from a fedora boot
log file. This can be used to find the IP address obtained by a Fedora
OS running on the model.
Change-Id: I2a1ab3e3743cbda8baaf3f8f716c7cf0bebe0766
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Diffstat (limited to 'sgi')
-rw-r--r-- | sgi/sgi_common_util.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sgi/sgi_common_util.sh b/sgi/sgi_common_util.sh index e228fb4..2a8e23e 100644 --- a/sgi/sgi_common_util.sh +++ b/sgi/sgi_common_util.sh @@ -145,3 +145,19 @@ parse_log_file () done return 0 } + +## +# Get the IP address of the Fast Model running Fedora OS. +# +# In case if host dhcp server doesn't assign fixed IP address to the fast model, +# this function will be useful to extract the IP from the UART0_ARMTF Log +## +get_ip_addr_fedora () { + local _IP="" + console_op=$(grep -e 'Admin Console' $PWD/$platform/$UART0_ARMTF_OUTPUT_FILE_NAME) + re="https://([^/]+):" # regular expression + if [[ $console_op =~ $re ]]; then _IP=${BASH_REMATCH[1]}; fi + echo -e "\n[INFO] IP address of the model: $_IP" + eval "$1=$_IP" + return 0 +} |