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] |
---|
12 | cpu_flag="no" |
---|
13 | Linux_bit="" |
---|
14 | Linux_Distribution="" |
---|
15 | Linux_Version="" |
---|
16 | VMM_select="" |
---|
17 | |
---|
18 | # [Check Root] |
---|
19 | function 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] |
---|
28 | function cpu_check(){ |
---|
29 | egrep '(vmx|svm)' --color=always /proc/cpuinfo > /dev/null |
---|
30 | if [ $? == 0 ]; then |
---|
31 | cpu_flag="yes" |
---|
32 | fi |
---|
33 | } |
---|
34 | |
---|
35 | # [Check System Version] |
---|
36 | function check_systemInfo(){ |
---|
37 | Linux_bit=$(uname -m) |
---|
38 | Linux_Distribution=$(lsb_release -i | awk '{print $3}') |
---|
39 | Linux_Version=$(lsb_release -r | awk '{print $2}') |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | function VMM_select(){ |
---|
44 | if [ $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 |
---|
50 | else |
---|
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 |
---|
55 | fi |
---|
56 | } |
---|
57 | |
---|
58 | # [create drbl-virt path] |
---|
59 | function install_drbl-virt_dir(){ |
---|
60 | mkdir -p $Work_Home/.tmp |
---|
61 | } |
---|
62 | |
---|
63 | # [check Hypervisior] |
---|
64 | function 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.