[171] | 1 | #!/bin/bash |
---|
| 2 | # Program: |
---|
| 3 | # Remove DRBL virt module |
---|
| 4 | # Author: |
---|
| 5 | # Jazz, Rock {jazz, rock}@nchc.org.tw |
---|
| 6 | # Version: |
---|
| 7 | # 1.0 |
---|
| 8 | # History: |
---|
| 9 | # 2010/07/20 Rock First release (1.0) |
---|
| 10 | |
---|
| 11 | # [Source] |
---|
| 12 | source /opt/drbl-virt/conf/drbl-virt.conf |
---|
[175] | 13 | source $Work_Path/functions_drbl_virt |
---|
[171] | 14 | |
---|
| 15 | # [Main] |
---|
| 16 | check_systemInfo |
---|
| 17 | |
---|
[186] | 18 | # = 1. Install Hypervisior = |
---|
[171] | 19 | case $Linux_Distribution in |
---|
| 20 | # for Ubuntu |
---|
| 21 | "Ubuntu") |
---|
| 22 | echo "Only support Debain" |
---|
| 23 | ;; |
---|
| 24 | # for Debian |
---|
| 25 | "Debian") |
---|
| 26 | # check xen package |
---|
| 27 | check_debian_xen_pkg="" |
---|
| 28 | check_debian_xen |
---|
| 29 | echo $check_debian_xen_pkg |
---|
| 30 | |
---|
| 31 | if [ $check_debian_xen_pkg == "no" ]; then |
---|
| 32 | echo -e "Don'f find Xen package, please check APT sources.list" |
---|
| 33 | exit 0 |
---|
| 34 | fi |
---|
| 35 | |
---|
| 36 | # check bit |
---|
| 37 | echo $Linux_bit | grep 64 > /dev/null |
---|
| 38 | if [ $? == 0 ]; then |
---|
| 39 | Linux_bit="amd64" |
---|
| 40 | else |
---|
| 41 | Linux_bit="686" |
---|
| 42 | fi |
---|
| 43 | |
---|
| 44 | # check version |
---|
| 45 | echo $Linux_Version | grep "^5" > /dev/null |
---|
| 46 | if [ $? == 0 ]; then |
---|
| 47 | hypervisior="" |
---|
| 48 | check_hypervisior |
---|
| 49 | echo $hyprtvisior |
---|
| 50 | |
---|
| 51 | if [ $hypervisior == "Xen" ]; then |
---|
[179] | 52 | echo "" |
---|
| 53 | echo "Install Xen Hypervisior" |
---|
| 54 | aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml |
---|
| 55 | cp $Work_Home/conf/debian-lenny_xend-config.sxp /etc/xen/xend-config.sxp |
---|
[178] | 56 | if [ $1 == "stop" ]; then |
---|
[179] | 57 | echo "" |
---|
| 58 | echo "DRBL server default will not enabled xend." |
---|
| 59 | echo "DRBL client default will enabled xend." |
---|
[178] | 60 | update-rc.d xend remove |
---|
| 61 | update-rc.d xendomains remove |
---|
| 62 | elif [ $1 == "start" ]; then |
---|
| 63 | update-rc.d xend defaults |
---|
| 64 | update-rc.d xendomains defaults |
---|
| 65 | fi |
---|
| 66 | |
---|
[171] | 67 | else |
---|
| 68 | aptitude install kvm |
---|
| 69 | fi |
---|
[178] | 70 | |
---|
[171] | 71 | fi |
---|
| 72 | ;; |
---|
| 73 | # for Fedora |
---|
| 74 | "Fedora") |
---|
| 75 | echo "Only support Debain" |
---|
| 76 | ;; |
---|
| 77 | *) |
---|
| 78 | echo "Only support Debain" |
---|
| 79 | ;; |
---|
| 80 | esac |
---|
| 81 | |
---|
[186] | 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 |
---|