From 9d53e3b06334af7d568815dabf6821c6068bc7ac Mon Sep 17 00:00:00 2001 From: adv Date: Mon, 30 May 2011 17:43:24 +0000 Subject: [PATCH] =?UTF-8?q?version=201.0.2=20#404=20=20=20boot-tools=20no?= =?UTF-8?q?=20configura=20la=20interfaz=20de=20red,=20hasta=20que=20la=20s?= =?UTF-8?q?e=C3=B1al=20portadora=20ethernet=20sea=20detectada.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/branches/version1.0@2046 a21b9725-9963-47de-94b9-378ad31fedc9 --- .../etc/initramfs-tools/scripts/ogfunctions | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/clientstructure/etc/initramfs-tools/scripts/ogfunctions b/clientstructure/etc/initramfs-tools/scripts/ogfunctions index ec01878..16539dd 100644 --- a/clientstructure/etc/initramfs-tools/scripts/ogfunctions +++ b/clientstructure/etc/initramfs-tools/scripts/ogfunctions @@ -260,10 +260,10 @@ ifconfig lo 127.0.0.1 ogconfigure_networking() { -echo "ogconfigure_networking: Buscando interfaz a configurar DEVICE" +#echo "ogconfigure_networking: Buscando interfaz a configurar DEVICE" if [ -n "${BOOTIF}" ] then - echo " variable BOOTIF exportada con pxelinux.0 con valor $BOOTIF" + #echo " variable BOOTIF exportada con pxelinux.0 con valor $BOOTIF" IP=$IPOPTS temp_mac=${BOOTIF#*-} # convert to typical mac address format by replacing "-" with ":" @@ -289,7 +289,7 @@ then fi done 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 #TODO Detectar que interfaz se ha iniciado case ${IP} in @@ -313,11 +313,23 @@ if [ -z "${DEVICE}" ]; then ogconfigure_networking fi -if [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ]; then - echo "variable DEVICE con valor $DEVICE y fichero /tmp/net-$DEVICE encontrados" - return 0 -else - echo "variable DEVICE con valor $DEVICE encontrada, procedemos a configurala y a crear el fichero /tmp/net-$DEVICE" +[ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0 +#if [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ]; then +# echo "variable DEVICE con valor $DEVICE y fichero /tmp/net-$DEVICE encontrados" +# return 0 +#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 # support ip options see linux sources