diff --git a/bsp-files/kickstarts/post_net_common.cfg b/bsp-files/kickstarts/post_net_common.cfg index 8b854ff9..3ca9f7d5 100755 --- a/bsp-files/kickstarts/post_net_common.cfg +++ b/bsp-files/kickstarts/post_net_common.cfg @@ -22,18 +22,14 @@ echo "repo --name=updates --baseurl=http://pxecontroller:${http_port:-8080}/upda echo http_port=$(get_http_port) >> /etc/platform/platform.conf # Obtain the boot interface from the PXE boot -BOOTIF=`cat /proc/cmdline |xargs -n1 echo |grep BOOTIF=` -if [ -d /sys/firmware/efi ] ; then - BOOTIF=${BOOTIF#BOOTIF=} -else - BOOTIF=${BOOTIF#BOOTIF=01-} - BOOTIF=${BOOTIF//-/:} -fi +BOOTIF=$(cat /proc/cmdline |xargs -n1 echo |grep BOOTIF=) +BOOTIF=${BOOTIF#BOOTIF=} mgmt_dev=none mgmt_vlan=0 if [ -n "$BOOTIF" ] ; then - ndev=`ip link show |grep -B 1 $BOOTIF |head -1 |awk '{print $2}' |sed -e 's/://'` + BOOTIF=$(echo $BOOTIF | sed -r -e 's/.*(..-..-..-..-..-..)$/\1/' -e 's/-/:/g') + ndev=$(ip -br link | awk -v mac="$BOOTIF" '$0 ~ mac {print $1}') if [ -n "$ndev" ] ; then mgmt_dev=$ndev # Retrieve the management VLAN from sysinv if it exists diff --git a/bsp-files/kickstarts/post_pxeboot_controller.cfg b/bsp-files/kickstarts/post_pxeboot_controller.cfg index 6e6d0c6b..cf76f145 100644 --- a/bsp-files/kickstarts/post_pxeboot_controller.cfg +++ b/bsp-files/kickstarts/post_pxeboot_controller.cfg @@ -17,17 +17,13 @@ echo "repo --name=updates --baseurl=xxxHTTP_URLxxx/patches/" > /tmp/repo-include . /tmp/ks-functions.sh # Obtain the boot interface from the PXE boot -BOOTIF=`cat /proc/cmdline |xargs -n1 echo |grep BOOTIF=` -if [ -d /sys/firmware/efi ] ; then - BOOTIF=${BOOTIF#BOOTIF=} -else - BOOTIF=${BOOTIF#BOOTIF=01-} - BOOTIF=${BOOTIF//-/:} -fi +BOOTIF=$(cat /proc/cmdline |xargs -n1 echo |grep BOOTIF=) +BOOTIF=${BOOTIF#BOOTIF=} mgmt_dev=none if [ -n "$BOOTIF" ] ; then - ndev=`ip link show |grep -B 1 $BOOTIF |head -1 |awk '{print $2}' |sed -e 's/://'` + BOOTIF=$(echo $BOOTIF | sed -r -e 's/.*(..-..-..-..-..-..)$/\1/' -e 's/-/:/g') + ndev=$(ip -br link | awk -v mac="$BOOTIF" '$0 ~ mac {print $1}') if [ -n "$ndev" ] ; then mgmt_dev=$ndev