Ignore:
Timestamp:
Oct 20, 2010, 11:10:46 AM (14 years ago)
Author:
rock
Message:

Milestone: KVM Support (Bridge patch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/drbl_bridge_kvm_patch

    r217 r218  
    2121if [ $? != 0 ]; then
    2222cp /usr/bin/mkpxeinitrd-net /usr/bin/mkpxeinitrd-net.drbl-virt_bak
     23# copy Xen network scripts
     24cp $Work_Home/conf/initrd_bin/network-bridge /usr/lib/mkpxeinitrd-net/initrd-skel/bin/
     25cp $Work_Home/conf/initrd_bin/xen-network-common.sh /usr/lib/mkpxeinitrd-net/initrd-skel/bin/
     26cp $Work_Home/conf/initrd_bin/xen-script-common.sh /usr/lib/mkpxeinitrd-net/initrd-skel/bin/
    2327
    2428# patch it to copy command
     
    3741#!/bin/bash
    3842# drbl-virt add
    39 NICs=$(/sbin/ifconfig | grep eth | awk '{print $1}')
    40 declare -i NICs_nu=$(echo $NICs |wc -w)
     43NICs=\$(/sbin/ifconfig | grep eth | awk '{print \$1}')
     44declare -i NICs_nu=\$(echo \$NICs |wc -w)
    4145 
    42 for NIC in $NICs
     46for NIC in \$NICs
    4347do
    44     NIC_IP=$(ifconfig $NIC | grep "inet addr" | sed 's/inet addr://g' | sed 's/Bcast.*$//g' | sed 's/^[ ]*//')
     48    NIC_IP=\$(ifconfig \$NIC | grep "inet addr" | sed 's/inet addr://g' | sed 's/Bcast.*$//g' | sed 's/^[ ]*//')
    4549
    46     if [ -n $NIC_IP ]; then
     50    if [ -n \$NIC_IP ]; then
    4751        break
    4852    fi
    4953done
    5054
    51 # add bridge and bridge to eth
    52 /bin/brctl addbr br0
    53 /bin/brctl addif br0 \$NIC
    54 /bin/ifconfig \$NIC 0.0.0.0 up
    55 /bin/ifconfig br0 \$NIC_IP up
     55# add bridge to eth
     56bash /bin/network-bridge start netdev=\$NIC
    5657EOF
    5758fi
Note: See TracChangeset for help on using the changeset viewer.