2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-12-03 07:37:05 +00:00
Files
xcat-core/xCAT-server/share/xcat/install/scripts/post.rhels8
T
Vinícius Ferrão 63bd36cfd4 fix(install): leave the USB NIC of the BMC down on installed EL nodes
post.rhels8 turns on every NIC that has link during the installation.
The USB NIC of a BMC host interface always has link, so the installed
node starts DHCP on it at boot, gets no lease, and
NetworkManager-wait-online fails.

post.rhels8 now skips NICs bound to a USB class driver: cdc_ether,
cdc_ncm, cdc_eem or rndis_host, which Linux binds to the USB gadget of a
BMC. USB Ethernet adapters with their own driver, the other NICs with
link, and NICs without a sysfs entry come up as before.
2026-11-07 00:59:01 -03:00

50 lines
2.0 KiB
Bash

#!/bin/bash
# The nic name might change between the installation and 1st boot
# Active all the nics with network link during system boot
[ "$XCATDEBUGMODE" ] || export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
[ "$MASTER_IP" ] || export MASTER_IP="#ENV:MASTER_IP#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
activated_ifcfg=0
if compgen -G "/etc/sysconfig/network-scripts/ifcfg-*" >/dev/null 2>&1; then
for i in /etc/sysconfig/network-scripts/ifcfg-*
do
[ "${i##*/}" = "ifcfg-lo" ] && continue
nicname="${i##*-}"
# A BMC host interface uses a USB class driver and has link but usually no DHCP server.
case "$(readlink -f "/sys/class/net/$nicname/device/driver" 2>/dev/null)" in
*/cdc_ether|*/cdc_ncm|*/cdc_eem|*/rndis_host) continue ;;
esac
if ethtool "$nicname" 2>/dev/null | grep -E -i -q "Link detected.*yes" >/dev/null 2>&1
then
case "$XCATDEBUGMODE" in
"1"|"2")
msgutil_r "$MASTER_IP" "info" "set NIC $nicname to be activated on system boot" "/var/log/xcat/xcat.log"
;;
esac
sed -i 's/ONBOOT=no/ONBOOT=yes/' "$i"
activated_ifcfg=1
fi
done
if [ "$activated_ifcfg" -eq 0 ]; then
xcat_enable_active_nm_autoconnect 1
fi
else
xcat_enable_active_nm_autoconnect 1
fi
# List of internal repos to be disabled
internet_repo_file_list="oracle-linux-ol8.repo oracle-linux-ol9.repo uek-ol8.repo uek-ol9.repo Rocky-AppStream.repo Rocky-BaseOS.repo Rocky-Extras.repo rocky.repo rocky-extras.repo CentOS-Base.repo centos.repo centos-addons.repo almalinux-ha.repo almalinux-nfv.repo almalinux-powertools.repo almalinux.repo almalinux-resilientstorage.repo almalinux-rt.repo openEuler.repo"
for repo_file in $internet_repo_file_list
do
if [ -f /etc/yum.repos.d/$repo_file ]; then
sed -i -e 's/^[[:space:]]*enabled[[:space:]]*=[[:space:]]*1/enabled=0/' /etc/yum.repos.d/$repo_file
fi
done
exit 0