source: drbl-virt/sbin/drbl_virt_funs @ 160

Last change on this file since 160 was 159, checked in by rock, 14 years ago
File size: 1.2 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 "Please change user to root !!!"
22    exit                   
23  fi
24} 
25
26# [Check CPU support]
27function cpu_check(){
28egrep '(vmx|svm)' --color=always /proc/cpuinfo > /dev/null
29if [ $? == 0 ]; then
30    cpu_flag="yes"
31fi
32}
33
34# [Check System Version]
35function check_systemInfo(){
36Linux_bit=$(uname -m)
37Linux_Distribution=$(lsb_release -i | awk '{print $3}')
38Linux_Version=$(lsb_release -r | awk '{print $2}')
39}
40
41
42function VMM_select(){
43if [ $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
48else
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
52fi 
53}   
54
55# [DRBL Check]
56
Note: See TracBrowser for help on using the repository browser.