Changeset 171 for drbl-virt/sbin/functions_drbl_virt
- Timestamp:
- Aug 10, 2010, 4:00:31 PM (14 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
drbl-virt/sbin/functions_drbl_virt
r161 r171 19 19 function check_root(){ 20 20 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 24 23 fi 25 24 } 25 26 function check_root_run(){ 27 if [ $USER != "root" ]; then 28 echo -e "Please change root to run it!" 29 sudo su -c ~/"$0" "$@" 30 exit 31 fi 32 } 33 26 34 27 35 # [Check CPU support] … … 40 48 } 41 49 42 50 # [Select Hypervisior(Xen/KVM)] 43 51 function VMM_select(){ 44 52 if [ $cpu_flag == "yes" ]; then … … 47 55 read -p "Which VMM/Hypervisior will be used in DRBL (1)Xen (2)KVM: " VMM_select 48 56 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 50 62 else 51 63 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 55 68 fi 56 69 } 57 70 58 # [create drbl-virt path] 71 72 # [Create drbl-virt path] 59 73 function install_drbl-virt_dir(){ 60 74 mkdir -p $Work_Home/.tmp 61 75 } 62 76 63 # [check Hypervisior] 77 78 # [Check Hypervisior] 64 79 function check_hypervisior(){ 65 return $(cat $Work_Home/.tmp/hypervisior) 80 hypervisior=$(cat $Work_Home/.tmp/hypervisior) 81 } 82 83 84 # [Check Debian Xen package] 85 function check_debian_xen(){ 86 aptitude update 87 check_debian_xen_pkg=$(aptitude search xen-linux-system) 88 if [ -n $check_debian_xen_pkg ]; then 89 check_debian_xen_pkg="yes" 90 else 91 check_debian_xen_pkg="no" 92 fi 93 } 94 95 96 # [Check Xen kernel] 97 function check_xen_nu(){ 98 Kernels=$(ls /boot | grep vmlinuz) 99 Kernel_choose="" 100 jude="no" 101 102 while [ $jude != "yes" -a $jude != "y" ] 103 do 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 115 done 116 117 Xen_Kernel=$(echo $Kernels | cut -d " " -f${Kernel_choose}) 118 #echo "debug: Xen_Kernel=$Xen_Kernel" 66 119 } 67 120 68 121 # [DRBL Check] 69 122 123 124
Note: See TracChangeset
for help on using the changeset viewer.