From 147185c198abaa08b14112c38730d7806deae6e0 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 4 Mar 2015 01:23:52 -0800 Subject: [PATCH] fix defect #4539 [FVT] On RHEL 7.1 ppc64, the name of network adapters changed after the operating system --- xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl | 1 + xCAT-server/share/xcat/install/scripts/post.rhels7 | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 xCAT-server/share/xcat/install/scripts/post.rhels7 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