Changeset 187 for drbl-virt


Ignore:
Timestamp:
Aug 26, 2010, 5:24:32 PM (14 years ago)
Author:
rock
Message:

BugFix?: some install error

Location:
drbl-virt/sbin
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/add_value

    r185 r187  
    1313
    1414# delete
    15 sed -i "/# drbl-virt $eth add/d" $2
    16 sed -i "/# drbl-virt $eth end/d" $2
     15sed -i "/# drbl-virt $3 add/d" $2
     16sed -i "/# drbl-virt $3 end/d" $2
    1717
    1818#
    19 echo "# Crawlzilla $eth add" >> $2
     19echo "# drbl-virt $3 add" >> $2
    2020cat $1 >> $2
    21 echo "# Crawlzilla $eth end" >> $2
     21echo "# drbl-virt $3 end" >> $2
  • drbl-virt/sbin/drbl_virt.sh

    r186 r187  
    1818VMM_select
    1919
    20 # [Install VMM/Hypervisior] 1=Xen, 2=KVM
     20# = 1.[Install VMM/Hypervisior] 1=Xen, 2=KVM =
    2121if [ $VMM_select == 1 ]; then
    22     bash "xen_install.sh start"
     22    $Work_Path/xen_install.sh start
    2323else
    24     bash "kvm_install.sh"
     24    $Work_Path/kvm_install.sh
    2525fi
    2626
    27 # [DRBL Environment Configuration]
     27# = 2. Patch DRBL =                                                                                                               
     28$Work_Path/drbl_xen_patch.sh
     29 
     30# = 3. drbl_xen_repush.sh =
     31$Work_Path/drbl_xen_repush.sh
    2832
  • drbl-virt/sbin/drbl_xen_patch.sh

    r185 r187  
    3535# == Modify PXE booting menu ==
    3636# if menu doesn't has drbl-virt, then add it
    37 cat /opt/drbl/sbin/generate-pxe-menu | grep "label drbl-virt"
     37cat /opt/drbl/sbin/generate-pxe-menu | grep "label drbl-virt" >> /dev/null
    3838if [  $? != 0 ]; then
    3939# backup generate-pxe-menu
     
    6868# == Patch /usr/bin/mkpxeinitrd-net (1)Xen network scripts (2)command (3)modules ==
    6969# backup mkpxeinitrd-net. if already has "drbl-virt add", dones't sed
    70 cat /usr/bin/mkpxeinitrd-net | grep "# drbl-virt add"
     70cat /usr/bin/mkpxeinitrd-net | grep "# drbl-virt add" >> /dev/null
    7171if [ $? != 0 ]; then
    7272cp /usr/bin/mkpxeinitrd-net /usr/bin/mkpxeinitrd-net.drbl-virt_bak
     
    113113fi
    114114# == Run start_xen_bridge.sh when booting  ==
    115 cat linuxrc-or-init | grep "bash /bin/start_xen_bridge.sh"
    116 if [ $? !=0 ]; then
     115cat /usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init | grep "bash /bin/start_xen_bridge.sh" >> /dev/null
     116if [ $? != 0 ]; then
    117117    # backup linuxrc-or-init
    118118    cp /usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init /usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init.drbl-virt_bak
     
    140140    mkdir /home/domains
    141141fi
    142 cp /boot/*{Xen_Kernel}* /home/domains
     142cp /boot/*${Xen_Kernel}* /home/domains
    143143
  • drbl-virt/sbin/drbl_xen_repush.sh

    r185 r187  
    5757    VM_hosts=$(cat /opt/drbl-virt/etc/IP_VM_$eth | awk '{print $2}')
    5858    VM_MACs=$(cat /opt/drbl-virt/etc/macadr-VM-$eth.txt)
     59
     60    echo -e "VM_IPs=$VM_IPs \n VM_IPs_nu=$VM_IPs_nu \n VM_hosts=$VM_hosts \n VM_MACs=$VM_MACs"
     61
    5962    # delete duplicating value(ip,hostname) in IP_HOST_TABLE
    6063    if [ -e /etc/drbl/IP_HOST_TABLE ]; then
     
    6265    fi
    6366    # add ip & hostname
    64     $Work_Path/add_value /opt/drbl-virt/etc/IP_VM_$eth /etc/drbl/IP_HOST_TABLE
     67    $Work_Path/add_value /opt/drbl-virt/etc/IP_VM_$eth /etc/drbl/IP_HOST_TABLE $eth
    6568   
    6669    # == Add Mac address to macadr-ethX.txt ==
     
    6871    $Work_Path/duplicate_del_MAC /etc/drbl/macadr-$eth.txt
    6972    fi
    70 
     73    cat /opt/drbl-virt/etc/macadr-VM-$eth.txt >> /etc/drbl/macadr-$eth.txt
    7174done
    7275     
  • drbl-virt/sbin/duplicate_del_MAC

    r185 r187  
    11#!/bin/bash
    22# Program:
    3 #   Delete duplicating ip & hostname
     3#   Delete duplicating VM MAC
    44# Author:
    55#   Rock {waue, shunfa, rock}@nchc.org.tw
     
    1515cp $1 $1.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
    1616
    17 # Delete duplating VM IP
    18 for vm_ip in $(echo $VM_IPs)
     17# Delete duplating VM MAC
     18for vm_mac in $(echo $VM_MACs)
    1919do
    20     vm_ip_lines=$(cat -n $1 | grep $vm_ip | awk '{print $1}' )
     20    vm_mac_lines=$(cat -n $1 | grep $vm_mac | awk '{print $1}' )
    2121    # no duplicated vlaue, doesn't do it
    22     if [ -n $vm_ip_lines ]; then
    23         vm_ip_count=$(echo $vm_ip_lines | wc -w)
     22    if [ -n $vm_mac_lines ]; then
     23        vm_mac_count=$(echo $vm_mac_lines | wc -w)
    2424
    25         for (( i=1; i<=${VM_ip_count}; i++ ))
     25        for (( i=1; i<=${VM_mac_count}; i++ ))
    2626        do
    27             del_line=$(echo $vm_ip_lines | cut -d " " -f${i})
     27            del_line=$(echo $vm_mac_lines | cut -d " " -f${i})
    2828            sed -i "${del_line}d" $1
    2929        done
     
    3131done
    3232 
    33 # Dlete duplicating hostname in file
    34 for vm_host in $(echo $VM_hosts)
    35 do
    36     # line numbers
    37     vm_host_lines=$(cat -n $1 | grep "$vm_host" | awk '{print $1}')
    38     # no duplicated vlaue, doesn't do it
    39     if [ -n $vm_host_lines ]; then
    40         vm_host_count=$(echo $vm_host_lines | wc -w)
    41  
    42         for (( i=1; i<=${vm_host_count}; i++ ))
    43         do
    44             del_line=$(echo $vm_host_lines | cut -d " " -f${i})
    45             sed -i "${del_line}d" $1
    46         done                                                                                                                                                             
    47     fi
    48 done
    4933
  • drbl-virt/sbin/functions_drbl_virt

    r185 r187  
    8080aptitude update
    8181check_debian_xen_pkg=$(aptitude search xen-linux-system)
    82 if [ -n $check_debian_xen_pkg  ]; then
     82if [ -n "$check_debian_xen_pkg"  ]; then
    8383    check_debian_xen_pkg="yes"
    8484else
  • drbl-virt/sbin/xen_install.sh

    r186 r187  
    2727        check_debian_xen_pkg=""
    2828        check_debian_xen
    29         echo $check_debian_xen_pkg
     29        #echo $check_debian_xen_pkg
    3030
    3131        if [ $check_debian_xen_pkg == "no" ]; then
     
    4747            hypervisior=""
    4848            check_hypervisior
    49             echo $hyprtvisior
     49            #echo $hypervisior
    5050
    5151            if [ $hypervisior == "Xen" ]; then
    5252                echo ""
    5353                echo "Install Xen Hypervisior"
    54                 aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml
     54                aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml ipcalc
    5555                cp $Work_Home/conf/debian-lenny_xend-config.sxp /etc/xen/xend-config.sxp
    5656                if [ $1 == "stop" ]; then
     
    8080esac
    8181
    82 # = 2. Patch DRBL =
    83 $Work_Path/drbl_xen_patch.sh
    84 
    85 # = 3. drbl_xen_repush.sh =
    86 $Work_Path/drbl_xen_repush.sh
Note: See TracChangeset for help on using the changeset viewer.