mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-30 19:02:27 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| #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#
 | |
| 
 | |
| 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
 | |
|      if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
 | |
|         msgutil_r "$MASTER_IP" "info" "set NIC $nicname to be activated on system boot" "/var/log/xcat/xcat.log"
 | |
|      fi
 | |
|      sed -i 's/ONBOOT=no/ONBOOT=yes/' $i
 | |
|   fi
 | |
| 
 | |
|   #remove the entry 'HWADDR' from ifcfg-ethx, this is used to skip the
 | |
|   #nic name change during the install and first_reboot
 | |
|   sed -i '/HWADDR/d' $i
 | |
| done
 | |
| 
 | |
| # NetworkManager will conflict with the configuring xcat do later in postboot script, so disable it in postscript
 | |
| 
 | |
| # There are 2 other service related to NetworkManager: NetworkManager-dispatcher and NetworkManager-wait-online
 | |
| # Both of them are triggered by NetworkManager, so just disable NetworkManager here
 | |
| if [ -f "/usr/lib/systemd/system/NetworkManager.service" ]; then
 | |
|     systemctl disable NetworkManager
 | |
| fi
 | |
| GRUBOUT=$(find /boot -name grub.cfg)
 | |
| sed -i -e 's/GRUB.*TERMINAL=.*/GRUB_TERMINAL="console"/' -e 's/GRUB_SERIAL_COMMAND=.*//' /etc/sysconfig/grub
 | |
| sed -i -e 's/GRUB.*TERMINAL=.*/GRUB_TERMINAL="console"/' -e 's/GRUB_SERIAL_COMMAND=.*//' /etc/default/grub
 | |
| grub2-mkconfig -o $GRUBOUT
 |