source: drbl-virt/sbin/funs_drbl_virt @ 165

Last change on this file since 165 was 161, checked in by rock, 14 years ago

Add: drbl_patch.sh drbl_virt_remove.sh conf/xend-config.sxp

File size: 1.5 KB
Line 
1#!/bin/bash
2# Program:
3#   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# [Variable Declation]
12cpu_flag="no"
13Linux_bit=""
14Linux_Distribution=""
15Linux_Version=""
16VMM_select=""
17
18# [Check Root]
19function check_root(){     
20  if [ $USER != "root" ]; then
21    echo -e "Please input root password to run it!"
22    su -c "$0" "$@"                   
23
24  fi
25} 
26
27# [Check CPU support]
28function cpu_check(){
29egrep '(vmx|svm)' --color=always /proc/cpuinfo > /dev/null
30if [ $? == 0 ]; then
31    cpu_flag="yes"
32fi
33}
34
35# [Check System Version]
36function check_systemInfo(){
37Linux_bit=$(uname -m)
38Linux_Distribution=$(lsb_release -i | awk '{print $3}')
39Linux_Version=$(lsb_release -r | awk '{print $2}')
40}
41
42
43function VMM_select(){
44if [ $cpu_flag == "yes" ]; then
45    while [ "$VMM_select" != "1" -a "$VMM_select" != "2"  ]
46    do
47       read -p "Which VMM/Hypervisior will be used in DRBL (1)Xen (2)KVM: " VMM_select
48    done
49    echo "Xen" > $Work_Home/.tmp/hypervisior
50else
51    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
55fi 
56}   
57
58# [create drbl-virt path]
59function install_drbl-virt_dir(){
60    mkdir -p $Work_Home/.tmp
61}
62
63# [check Hypervisior]
64function check_hypervisior(){
65    return $(cat $Work_Home/.tmp/hypervisior)
66}
67
68# [DRBL Check]
69
Note: See TracBrowser for help on using the repository browser.