mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-26 08:55:24 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			83 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			83 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
|       <chroot-scripts config:type="list">
 | |
|         <script>
 | |
|           <filename>boot.sh</filename>
 | |
|           <interpreter>shell</interpreter>
 | |
|           <debug config:type="boolean">false</debug>
 | |
|           <source>
 | |
| 
 | |
| <![CDATA[
 | |
| #!/bin/sh
 | |
| 
 | |
| mkdir -p /mnt/var/log/xcat/
 | |
| {
 | |
| 
 | |
| cat /tmp/pre-install.log >> /mnt/var/log/xcat/xcat.log
 | |
| 
 | |
| echo "Running AutoYaST Chroot-Installation script..."
 | |
| 
 | |
| export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
 | |
| if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
 | |
|     set -x
 | |
| fi
 | |
| 
 | |
| AWK=`find / -name awk | head -1`
 | |
| #old awk /mounts/instsys/bin/awk -f
 | |
| if [ ! -e /usr/bin/awk ]; then
 | |
|     ln -s $AWK /usr/bin/awk
 | |
| fi
 | |
| 
 | |
| XCATDPORT=#TABLE:site:key=xcatiport:value#
 | |
| XCATDHOST="#XCATVAR:XCATMASTER#"
 | |
| 
 | |
| (cat >/tmp/updateflag << 'EOF'
 | |
| #INCLUDE:#TABLE:site:key=installdir:value#/postscripts/updateflag.awk#
 | |
| EOF
 | |
| ) >/tmp/updateflag 
 | |
| 
 | |
| chmod 755 /tmp/updateflag
 | |
| 
 | |
| /tmp/updateflag $XCATDHOST $XCATDPORT
 | |
| 
 | |
| export PRINIC=#TABLEBLANKOKAY:noderes:THISNODE:primarynic#
 | |
| if [ "$PRINIC" == "mac" ]
 | |
| then
 | |
|     export PRINIC='#GETPRINICMAC:THISNODE#'
 | |
| fi
 | |
| if [ -z "$PRINIC" ]
 | |
| then
 | |
|     for karg in $(cat /proc/cmdline |sed -e 's/-/:/g' -e 's/ /\n/g'); do
 | |
|         if  [ "${karg%%=*}" = "BOOTIF" ]; then
 | |
|             #export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=01:}"|awk '{print $1}'`
 | |
|             export PRINIC=${karg#*=01:}
 | |
|             export PRINIC=`ip -o link|grep -i "$PRINIC"|awk  '{print $2}'|sed s/://`
 | |
|         fi
 | |
|         if  [ "${karg%%=*}" = "netdevice" ]; then
 | |
|             export PRINIC="${karg#*=}";
 | |
|             if [ "${#PRINIC}" = "20" ]; then
 | |
|                export PRINIC=${PRINIC:3:21}
 | |
|             fi
 | |
|         fi
 | |
|     done
 | |
|     if [ -z "$PRINIC" ]; then
 | |
|         export PRINIC=eth0
 | |
|     fi
 | |
| fi
 | |
| if [ -z "$PRINIC" ]
 | |
| then
 | |
|     export PRINIC=eth0
 | |
| elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+$ ;echo $?` == "0" ]]; then
 | |
|     #export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'`
 | |
|     export PRINIC=`ip -o link|grep -i "$PRINIC"|awk  '{print $2}'|sed s/://`
 | |
| fi
 | |
| echo 'export PRINIC='"$PRINIC" > /mnt/tmp/prinicsetting
 | |
| 
 | |
| if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
 | |
|     set +x
 | |
| fi
 | |
| } >>/mnt/var/log/xcat/xcat.log 2>&1
 | |
| ]]>
 | |
| 
 | |
|           </source>
 | |
|         </script>
 | |
|       </chroot-scripts>
 |