Ignore:
Timestamp:
Oct 19, 2010, 5:13:45 PM (14 years ago)
Author:
rock
Message:

Add: KVM support (bridge to eth for KVM env)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/drbl_bridge_xen_patch

    r215 r217  
    11#!/bin/bash
    22# Program:
    3 #   Patch DRBL to bridge eth in booting
     3#   Patch DRBL to bridge eth in booting (Xen)
    44# Author:
    55#   Jazz, Rock {jazz, rock}@nchc.org.tw
     
    1717# = 1. Patch DRBL initrd to support bridge =
    1818# == Patch /usr/bin/mkpxeinitrd-net (1)Xen network scripts (2)command (3)modules ==
    19 # backup mkpxeinitrd-net. if already has "drbl-virt add", dones't sed
     19# backup mkpxeinitrd-net. if already has "drbl-virt add", doesn't sed
    2020cat /usr/bin/mkpxeinitrd-net | grep "# drbl-virt add" >> /dev/null
    2121if [ $? != 0 ]; then
     
    4343# drbl-virt add
    4444NICs=\$(/sbin/ifconfig | grep eth | awk '{print \$1}')
    45 declare -i NICs_nu=\$(echo \$NICs |wc -l)
     45declare -i NICs_nu=\$(echo \$NICs |wc -w)
    4646NIC=""
    4747
     
    4949    for (( i=0 ; i<\$NICs_nu ; i++ ))
    5050    do
    51         NIC_IP=\$(ifconfig eth\${i} | grep "inet addr" | sed 's/inet addr://g' | sed 's/Bcast.*$//g')
     51        NIC_IP=\$(ifconfig eth\${i} | grep "inet addr" | sed 's/inet addr://g' | sed 's/Bcast.*$//g' | sed 's/^[ ]*//')
    5252        if [ -n \$NIC_IP ]; then
    5353            NIC="eth\${i}"
Note: See TracChangeset for help on using the changeset viewer.