diff --git a/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl index b32f1f01d..b1ac4c9b8 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl @@ -151,4 +151,5 @@ reboot %end %post #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat# +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels7# %end diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels7 b/xCAT-server/share/xcat/install/scripts/post.rhels7 new file mode 100644 index 000000000..5a15719d6 --- /dev/null +++ b/xCAT-server/share/xcat/install/scripts/post.rhels7 @@ -0,0 +1,9 @@ +#the nic name might change between the installation and 1st boot +#active all the nics with network link during system boot +for i in $(find /etc/sysconfig/network-scripts/ifcfg-*|egrep -v ifcfg-lo ) +do + nicname=$(echo $i|awk -F 'ifcfg-' '{print $2}') + if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1 + then sed -i 's/ONBOOT=no/ONBOOT=yes/' $i + fi +done