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 "Please change user to root !!!" |
---|
22 | exit |
---|
23 | fi |
---|
24 | } |
---|
25 | |
---|
26 | # [Check CPU support] |
---|
27 | function cpu_check(){ |
---|
28 | egrep '(vmx|svm)' --color=always /proc/cpuinfo > /dev/null |
---|
29 | if [ $? == 0 ]; then |
---|
30 | cpu_flag="yes" |
---|
31 | fi |
---|
32 | } |
---|
33 | |
---|
34 | # [Check System Version] |
---|
35 | function check_systemInfo(){ |
---|
36 | Linux_bit=$(uname -m) |
---|
37 | Linux_Distribution=$(lsb_release -i | awk '{print $3}') |
---|
38 | Linux_Version=$(lsb_release -r | awk '{print $2}') |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | function VMM_select(){ |
---|
43 | if [ $cpu_flag == "yes" ]; then |
---|
44 | while [ "$VMM_select" != "1" -a "$VMM_select" != "2" ] |
---|
45 | do |
---|
46 | read -p "Which VMM/Hypervisior will be used in DRBL (1)Xen (2)KVM: " VMM_select |
---|
47 | done |
---|
48 | else |
---|
49 | echo "Xen will be the only Hypervisior in your DRBL" |
---|
50 | echo -e "Because CPU don't support virtualization, \nit can't choose KVM to be the Hypervisior" |
---|
51 | VMM_select=2 |
---|
52 | fi |
---|
53 | } |
---|
54 | |
---|
55 | # [DRBL Check] |
---|
56 | |
---|
Note: See
TracBrowser
for help on using the repository browser.