version 1.0.2 #404 boot-tools no configura la interfaz de red, hasta que la señal portadora ethernet sea detectada.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2046 a21b9725-9963-47de-94b9-378ad31fedc9master
							parent
							
								
									77f0ed2160
								
							
						
					
					
						commit
						9d53e3b063
					
				| 
						 | 
					@ -260,10 +260,10 @@ ifconfig lo 127.0.0.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ogconfigure_networking()
 | 
					ogconfigure_networking()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
echo "ogconfigure_networking: Buscando interfaz a configurar DEVICE"
 | 
					#echo "ogconfigure_networking: Buscando interfaz a configurar DEVICE"
 | 
				
			||||||
if [ -n "${BOOTIF}" ] 
 | 
					if [ -n "${BOOTIF}" ] 
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
	echo " variable BOOTIF exportada con pxelinux.0 con valor $BOOTIF"
 | 
						#echo " variable BOOTIF exportada con pxelinux.0 con valor $BOOTIF"
 | 
				
			||||||
	IP=$IPOPTS
 | 
						IP=$IPOPTS
 | 
				
			||||||
	temp_mac=${BOOTIF#*-}
 | 
						temp_mac=${BOOTIF#*-}
 | 
				
			||||||
	# convert to typical mac address format by replacing "-" with ":"
 | 
						# convert to typical mac address format by replacing "-" with ":"
 | 
				
			||||||
| 
						 | 
					@ -289,7 +289,7 @@ then
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
	done
 | 
						done
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	echo "variable BOOTIF no exportada, intentamos detectar que interfaz se ha iniciado"
 | 
						#echo "variable BOOTIF no exportada, intentamos detectar que interfaz se ha iniciado"
 | 
				
			||||||
	IP=$ip
 | 
						IP=$ip
 | 
				
			||||||
	#TODO Detectar que interfaz se ha iniciado
 | 
						#TODO Detectar que interfaz se ha iniciado
 | 
				
			||||||
	case ${IP} in
 | 
						case ${IP} in
 | 
				
			||||||
| 
						 | 
					@ -313,11 +313,23 @@ if [ -z "${DEVICE}" ]; then
 | 
				
			||||||
	ogconfigure_networking
 | 
						ogconfigure_networking
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ]; then 
 | 
					[ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0
 | 
				
			||||||
	echo "variable DEVICE con valor $DEVICE  y fichero /tmp/net-$DEVICE encontrados"
 | 
					#if [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ]; then 
 | 
				
			||||||
	return 0
 | 
					#	echo "variable DEVICE con valor $DEVICE  y fichero /tmp/net-$DEVICE encontrados"
 | 
				
			||||||
else
 | 
					#	return 0
 | 
				
			||||||
	echo "variable DEVICE con valor $DEVICE encontrada, procedemos a configurala y a crear el fichero /tmp/net-$DEVICE"
 | 
					#else
 | 
				
			||||||
 | 
					#	echo "variable DEVICE con valor $DEVICE encontrada, procedemos a configurala y a crear el fichero /tmp/net-$DEVICE"
 | 
				
			||||||
 | 
					#fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Activamos la interfaz antes de configurar.
 | 
				
			||||||
 | 
					ip address flush $DEVICE
 | 
				
			||||||
 | 
					ip link set dev $DEVICE up
 | 
				
			||||||
 | 
					# Si no se detecta señal portadora volver a configurar.
 | 
				
			||||||
 | 
					sleep 1
 | 
				
			||||||
 | 
					CARRIER=$(cat /sys/class/net/${DEVICE}/carrier)
 | 
				
			||||||
 | 
					if [ "$CARRIER" != "1" ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						ogconfigure_networking
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# support ip options see linux sources
 | 
					# support ip options see linux sources
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue