Ignore:
Timestamp:
Aug 10, 2010, 4:00:31 PM (14 years ago)
Author:
rock
Message:

Add: DRBL patch for Xen

File:
1 moved

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/functions_drbl_virt

    r161 r171  
    1919function check_root(){     
    2020  if [ $USER != "root" ]; then
    21     echo -e "Please input root password to run it!"
    22     su -c "$0" "$@"                   
    23 
     21    echo -e "Please change root to run it!"
     22    exit
    2423  fi
    2524}
     25
     26function check_root_run(){
     27    if [ $USER != "root" ]; then
     28    echo -e "Please change root to run it!"
     29    sudo su -c ~/"$0" "$@"
     30    exit
     31fi
     32}
     33
    2634
    2735# [Check CPU support]
     
    4048}
    4149
    42 
     50# [Select Hypervisior(Xen/KVM)]
    4351function VMM_select(){
    4452if [ $cpu_flag == "yes" ]; then
     
    4755       read -p "Which VMM/Hypervisior will be used in DRBL (1)Xen (2)KVM: " VMM_select
    4856    done
    49     echo "Xen" > $Work_Home/.tmp/hypervisior
     57  if [ $VMM_select == "1"  ]; then
     58    echo "Xen" > $Work_Home/.tmp/hypervisior
     59  else
     60    echo "KVM" > $Work_Home/.tmp/hypervisior
     61  fi 
    5062else
    5163    echo "Xen will be the only Hypervisior in your DRBL"
    52     echo -e "Because CPU don't support virtualization, \nit can't choose KVM to be the Hypervisior"
    53     VMM_select=2
    54     echo "KVM" > $Work_Home/.tmp/hypervisior
     64    echo -e "Because CPU don't support virtualization, it can't choose KVM to be the Hypervisior"
     65    echo ""
     66    VMM_select=1
     67    echo "Xen" > $Work_Home/.tmp/hypervisior
    5568fi 
    5669}   
    5770
    58 # [create drbl-virt path]
     71
     72# [Create drbl-virt path]
    5973function install_drbl-virt_dir(){
    6074    mkdir -p $Work_Home/.tmp
    6175}
    6276
    63 # [check Hypervisior]
     77
     78# [Check Hypervisior]
    6479function check_hypervisior(){
    65     return $(cat $Work_Home/.tmp/hypervisior)
     80    hypervisior=$(cat $Work_Home/.tmp/hypervisior)   
     81}
     82
     83
     84# [Check Debian Xen package]
     85function check_debian_xen(){
     86aptitude update
     87check_debian_xen_pkg=$(aptitude search xen-linux-system)
     88if [ -n $check_debian_xen_pkg  ]; then
     89    check_debian_xen_pkg="yes"
     90else
     91    check_debian_xen_pkg="no"
     92fi
     93}
     94
     95
     96# [Check Xen kernel]
     97function check_xen_nu(){
     98Kernels=$(ls /boot | grep vmlinuz)
     99Kernel_choose=""
     100jude="no"
     101
     102while [ $jude != "yes" -a $jude != "y" ]
     103do
     104    declare -i i=1
     105    echo ""
     106   
     107    for Kernel in $Kernels
     108    do
     109        echo "($i) $Kernel"
     110        i=i+1
     111    done
     112
     113    read -p "Xen Kenrel is (1/2/...): " Kernel_choose
     114    read -p "Are you sure (yes/no): " jude
     115done
     116
     117Xen_Kernel=$(echo $Kernels | cut -d " " -f${Kernel_choose})
     118#echo "debug: Xen_Kernel=$Xen_Kernel"
    66119}
    67120
    68121# [DRBL Check]
    69122
     123
     124
Note: See TracChangeset for help on using the changeset viewer.