VirtualBox

Changeset 4315

Show
Ignore:
Timestamp:
08/23/07 16:32:48 (1 year ago)
Author:
vboxsync
Message:

sync

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/debian/rules

    r4310 r4315  
    183183        sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge ucs1.3,$(debrel)),yes,)|g;' \ 
    184184            debian/vboxdrv.init.tmpl > debian/vboxdrv.init 
    185 #     sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge,$(debrel)),yes,)|g;' \ 
     185      sed -e 's|%NOLSB%|$(if $(filter _Debian_sarge,$(debrel)),yes,)|g;' \ 
    186186            debian/vboxnet.init.tmpl > debian/vboxnet.init 
    187187        dh_installinit --name=vboxdrv 
    188 #     dh_installinit --name=vboxnet 
     188      dh_installinit --name=vboxnet 
    189189        if [ "$(debrel)" = "_Ubuntu_dapper" -o "$(debrel)" = "_Debian_sarge" ]; then \ 
    190190            cat debian/postrm.dapper > debian/postrm; fi 
  • trunk/debian/vboxnet.init.tmpl

    r4071 r4315  
    88#  Copyright (C) 2007 innotek GmbH 
    99#  
    10 #  This file is part of VirtualBox Open Source Edition (OSE), as 
    11 #  available from http://www.virtualbox.org. This file is free software; 
    12 #  you can redistribute it and/or modify it under the terms of the GNU 
    13 #  General Public License as published by the Free Software Foundation, 
    14 #  in version 2 as it comes in the "COPYING" file of the VirtualBox OSE 
    15 #  distribution. VirtualBox OSE is distributed in the hope that it will 
    16 #  be useful, but WITHOUT ANY WARRANTY of any kind. 
     10#  innotek GmbH confidential 
     11#  All rights reserved 
    1712 
    1813# chkconfig: 35 30 60 
     
    9186start_network() { 
    9287    log_action_begin_msg "Starting VirtualBox host networking" 
    93     # If there is no configuration file or if the service is already running, 
    94     # assume that we have successfully started. 
    95     if [ -f "$VARFILE" -o ! -f "$CONFIG" ]; then 
     88    # If the service is already running, return successfully. 
     89    if [ -f "$VARFILE" ]; then 
    9690      log_action_end_msg 0 
    9791      return 0 
     
    10599    if ! touch "$VARFILE" 2> /dev/null; then 
    106100      failure "Cannot create $VARFILE" 
     101    fi 
     102    # If there is no configuration file, report success 
     103    if [ ! -f "$CONFIG" ]; then 
     104      log_action_end_msg 0 
     105      return 0 
    107106    fi 
    108107    # Fail if we can't read our configuration 
     
    127126        then 
    128127          # Try to create the interface 
    129           if (VBoxTunctl -t "$1" -u "$2" > /dev/null 2>&1 && 
    130               ifconfig "$1" up 2> /dev/null) 
     128          if VBoxTunctl -t "$1" -u "$2" > /dev/null 2>&1 
    131129          then 
    132             # Add the interface to a bridge if one was specified 
    133             if [ ! -z "$3" ]; then 
    134               if brctl addif "$3" "$1" 2> /dev/null; then 
    135                 echo "$1 $2 $3" > "$VARFILE" 
     130            # On SUSE Linux Enterprise Server, the interface does not 
     131            # appear immediately, so we loop trying to bring it up. 
     132            i=1 
     133            while [ $i -le 10 ] 
     134            do 
     135              ifconfig "$1" up 2> /dev/null 
     136              if ifconfig | grep "$1" > /dev/null 2>&1 
     137              then 
     138                # Add the interface to a bridge if one was specified 
     139                if [ ! -z "$3" ] 
     140                then 
     141                  if brctl addif "$3" "$1" 2> /dev/null 
     142                  then 
     143                    echo "$1 $2 $3" > "$VARFILE" 
     144                  else 
     145                    echo "$1 $2" > "$VARFILE" 
     146                    echo "Warning - failed to add interface $1 to the bridge $3" 
     147                  fi 
     148                else 
     149                  echo "$1 $2" > $VARFILE 
     150                fi 
     151                i=20 
    136152              else 
    137                 echo "$1 $2" > "$VARFILE" 
    138                 echo "Warning - failed to add interface $1 to the bridge $3" 
     153                i=`expr $i + 1` 
     154                sleep .1 
    139155              fi 
    140             else 
    141               echo "$1 $2" > $VARFILE 
     156            done 
     157            if [ $i -ne 20 ] 
     158            then 
     159              echo "Warning - failed to bring up the interface $1" 
    142160            fi 
    143161          else 
    144             echo 
    145             echo "Warning - invalid line in $CONFIG:" 
    146             echo "  $line" 
     162            echo "Warning - failed to create the interface $1 for the user $2" 
    147163          fi 
    148164        else 
     
    157173    if ls -g "$TAPDEV" 2>/dev/null | grep -q root; then 
    158174      chgrp vboxusers "$TAPDEV" 
     175      chmod 0660 "$TAPDEV" 
    159176    fi 
    160177    log_action_end_msg 0 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy