ITEM: BQ2842L

Could not bring up network on en0.


Env:
  AIX 4.1.4
  RISC E20
  sysback 3.3.3.9

Desc:  
  Customer does a network boot from a token-ring (tok0)
  then choose option 1 and choose to change the input device
  from tok0 to ent1.
  The customer then choose option 2 (it failes on option 3 as well)
  
  He gets this error message:

            *********************************                                    
           *      Configuring network      *                                    
           *********************************                                    
 Could not bring up network on en0.                                             
 .                                                                              
 Press Enter to return to main menu ..                                
          
 That error message is very strange, because he was trying to use ent1 
 (not ent0) to install.                                                         

Action:
  I investigated into /usr/lpp/sysback/sysnet and I found (using set -x) 
  where the problem was located.  At line 481, the following piece of 
  code is executed:  

   ----------------------------------------------------------------------         
    \# Bring up and configure network interface                                  
    if ¦ $netdev != $BOOTDEV ¦                                                  
       then                                                                     
       if ¦ "$subnetmask" != undefined ¦                                        
          then ifconfig $ifconfigname inet $cIPaddr up netmask                  
 $subnetmask \\                                                                  
          2>/dev/null                                                           
          else ifconfig $ifconfigname inet $cIPaddr up 2>/dev/null              
       fi                                                                       
    fi                                                                          
    rc=$?                                                                       
 ----------------------------------------------------------------------         
 
At that point:                                                                 
   $netdev = ent1                                                              
   $BOOTDEV = ent0                                                             
   $subnetmask = 255.255.255.0                                                 
   $cIPaddr = 192.168.129.15                                                   
   $ifconfigname =               (empty string)                                
                                                                               
 So the following command is executed:                                          
     ifconfig inet 192.168.129.15 up netmask 255.255.255.0                      
 and this command fails with rc=1.  It is obvious that the error is due         
 to the empty value of $ifconfigname.                                           
                                                                               
 I further investigated into /usr/lpp/sysback/sysnet at line 377.               
 -----------------------------------------------------------------------        
 \# Get network install device info                                              
 cat /tmp/..netinfo | read netdev cIPaddr sIPaddr subnetmask gIPaddr            
 ringspeed \\                                                                    
          entif entconnect                                                      
                                                                                
 \# Gateway?                                                                     
 if ¦ "$gIPaddr" = "undefined" ¦                                                
    then gateway=no                                                             
    else gateway=yes                                                            
 fi                                                                             
                                                                                
 \# Get network interface                                                        
 case $netdev in                                                                
    ent*) ifconfigname=$entif;;                                                 
    tok*) ifconfigname=tr`expr "$netdev" : "tok\\(.*\\)"`;;                       
 esac                                                                           
 -----------------------------------------------------------------------        
 ifconfigname is set to $entif, which is itself read from                       
 /tmp/..netinfo.                                                                
 .                                                                              
 I inserted a "cat /tmp/..netinfo; sleep 30" at that point, and here            
 is the output shown:                                                           
 -----------------------------------------------------------------------        
 ent1 192.168.129.15 192.168.129.41 255.255.255.0 192.168.129.41 en0            
 -----------------------------------------------------------------------        
 I think that there are 2 problems here:                                        
  - the 6th field (Ring Speed in case of Token Ring) was not written in         
 /tmp/..netinfo;                                                             
  - en0 should be en1.                                                          
 This missing field explains why $entif is empty.                               
 .                                                                              
 As that file is created in /usr/lpp/sysback/inst/sysmenus,  I looked           
 into that file, inside the changenet() function (line 88 and after).           
 .                                                                              
 At the beginning of that function, /tmp/..netinfo already exists and           
 contains the values used during the network boot (IP client, IP server,        
 IP gateway, netmask, ...).  I inserted a "cat /tmp/..netinfo;sleep 30"         
 at that point, and here is the output shown:                                   
 -----------------------------------------------------------------------        
 ent0 139.165.32.33 139.165.32.13 255.255.255.0 139.165.32.13  en0              
 -----------------------------------------------------------------------        
 Here, there are 2 space characters between "139.165.32.13" and                 
 "en0". I think that the /tmp/..netinfo file that is created at boot            
 time is not correct: the 6th field was not written.  "en0" is correct          
 at that point, since the boot process was achieved using ent0...                                                                             
 So I could conclude that there is a bug inside the                             
 /usr/lpp/sysback/netinst/boot4 script.  I looked into that file, at            
 line 212 and after:                                                            
 -----------------------------------------------------------------------        
    \# Create install image server info file                                     
    ¦ -z "$SUBMASK" ¦ && SUBMASK=undefined                                      
    echo "$PHY_BOOT_DEV $CLIENT_IPADDR $INSTSRV $SUBMASK $INSTGATE              
  $RINGSPEED $LDEV $ENTCON" > /tmp/..netinfo                                    
 -----------------------------------------------------------------------        
 If I compare the last line with the content of the /tmp/..netinfo file,        
 I can conclude that RINGSPEED and ENTCON were both empty strings.              
 .                                                                              
 In the same script, I can see that the values of RINGSPEED and ENTCON          
 should be set at line 65 and after:                                            
 -----------------------------------------------------------------------        
    \# Get network adapter attributes                                            
    case "$HTYPE" in                                                            
  79)   \# 'O' = token-ring                                                 
          if ¦ "$HATTR" -eq 3 -o "$HATTR" -eq 5 ¦                               
             then RINGSPEED=16                                                  
             else RINGSPEED=4                                                   
          fi                                                                    
       ENTCON=0                                                                 
       ;;                                                                       
       68)   \# 'D' = ethernet                                                   
          enet_type=`odmget -q name="$PHY_BOOT_DEV" CuDv`                       
       RINGSPEED=0                                                              
          case "$enet_type" in                                                  
             *ethernet*)                                                        
          \# Standard ethernet                                                   
             if ¦ "$HATTR" -eq 7 ¦                                              
                      then ENTCON=bnc                                           
                      else ENTCON=dix                                           
                   fi                                                           
                   ;;                                                           
    *)   \# Integrated ethernet                                         
          ENTCON=0                                                              
                   ;;                                                           
          esac                                                                  
       ;;                                                                       
    esac                                                                        
 -----------------------------------------------------------------------        
 It seems obvious that the problem is due to the value of HTYPE                 
 that is neither 79, neither 68.  Indeed, if HTYPE was 68, RINGSPEED            
 and ENTCON would have been set to 0.                                           
 .                                                                              
 I inserted "echo $HTYPE > /tmp/..htype" in that script, rebuild the            
 boot image, and "cat" that file. The value of HTYPE is 0 !!!!!!                
 .                                                                              
 Then I investigated in the same script at line 146 and after:                  
 -----------------------------------------------------------------------        
    \# Read IPL control block for network information                            
    set -- `bootinfo -c
    CLIENT_IPADDR=$1                                                            
    BOOT_SERV_IP=$2                                                             
    BOOT_GATE_IP=$3                                                             
    HTYPE=$4                                                                    
 -----------------------------------------------------------------------        
 It appears that $HTYPE depends on the result of "bootinfo -c".                 
 .                                                                              
 I inserted "bootinfo -c > /tmp/..bootinfo" in that script, rebuild the         
 boot image, and "cat" that file. Here is the result:                           
 -----------------------------------------------------------------------        
 139.165.32.33 139.165.32.13 139.165.32.13 0 0 0 /tftpboot/eden                 
 1.4.255.255.255.0.0.0.0.0..(total=59 "0" characters)..0.0.0. 0                 
 -----------------------------------------------------------------------        
                                                                               
 My final conclusion is that rc.boot4 (and maybe also rc.boot3) must            
 be fixed so that it (they) take(s) into account that kind of                   
 "bootinfo -c" result.                                                          
 .                                                                              
 A workaround for our problem is adding the following lines before              
 the "esac" that matches "case $HTYPE":                                         
 -----------------------------------------------------------------------        
            0)  \# E20 model Ethernet card                                       
                RINGSPEED=0                                                     
                ENTCON=0                                                        
                ;;                                                              
 -----------------------------------------------------------------------        
 This fixes (temporarily?) the first problem.                                   
                                                                               
 For the second problem, I found a bug inside                                   
 /usr/lpp/sysback/inst/sysmenus, at line 110 and after (inside the              
 changenet() function):                                                         
 -----------------------------------------------------------------------        
    \# Get current settings                                                      
    cat /tmp/..netinfo | read olddev clientIP serverIP subnet \\                 
                gatewayIP ringspeed ent_if                                      
 ent_con                                                                        
 -----------------------------------------------------------------------        
 I can see that ent_if is read from /tmp/..netinfo and remains unchanged        
 if we do not change the type of Ethernet interface (using choice *5*           
 in the menu).                                                                  
                                                                               
 However, the changenet() function is called whenever the user selects          
 another interface for the restore (in my case, $device = ent1). So,            
 ent_if must be changed into the corresponding value for that interface.        
                                                                               
 I added the following lines after the lines I just mentioned above:            
 -----------------------------------------------------------------------        
         if ¦¦ $device = ent* ¦¦                                                
            then if ¦¦ $ent_if = et* ¦¦                                         
                    then ent_if=et$devno                                        
                    else ent_if=en$devno                                        
                 fi                                                             
         fi                                                                     
 -----------------------------------------------------------------------

This is fixed in sysback 3.3.3.10

Next Action:
  Sending sysback 3.3.3.10 to the customer



Support Line: Could not bring up network on en0. ITEM: BQ2842L
Dated: November 1996 Category: N/A
This HTML file was generated 99/06/24~13:30:20
Comments or suggestions? Contact us