Index: drbl-virt/sbin/functions_drbl_virt
===================================================================
--- drbl-virt/sbin/funs_drbl_virt	(revision 161)
+++ drbl-virt/sbin/functions_drbl_virt	(revision 171)
@@ -19,9 +19,17 @@
 function check_root(){      
   if [ $USER != "root" ]; then
-    echo -e "Please input root password to run it!"
-    su -c "$0" "$@"                   
-
+    echo -e "Please change root to run it!"
+    exit
   fi
 } 
+
+function check_root_run(){
+    if [ $USER != "root" ]; then
+    echo -e "Please change root to run it!"
+    sudo su -c ~/"$0" "$@"
+    exit
+fi
+}
+
 
 # [Check CPU support]
@@ -40,5 +48,5 @@
 }
 
-
+# [Select Hypervisior(Xen/KVM)]
 function VMM_select(){
 if [ $cpu_flag == "yes" ]; then
@@ -47,23 +55,70 @@
        read -p "Which VMM/Hypervisior will be used in DRBL (1)Xen (2)KVM: " VMM_select
     done
-    echo "Xen" > $Work_Home/.tmp/hypervisior
+	if [ $VMM_select == "1"  ]; then
+	  echo "Xen" > $Work_Home/.tmp/hypervisior
+	else
+	  echo "KVM" > $Work_Home/.tmp/hypervisior
+	fi	
 else
     echo "Xen will be the only Hypervisior in your DRBL"
-    echo -e "Because CPU don't support virtualization, \nit can't choose KVM to be the Hypervisior"
-    VMM_select=2
-    echo "KVM" > $Work_Home/.tmp/hypervisior
+    echo -e "Because CPU don't support virtualization, it can't choose KVM to be the Hypervisior"
+    echo ""
+    VMM_select=1
+    echo "Xen" > $Work_Home/.tmp/hypervisior
 fi  
 }   
 
-# [create drbl-virt path]
+
+# [Create drbl-virt path]
 function install_drbl-virt_dir(){
     mkdir -p $Work_Home/.tmp
 }
 
-# [check Hypervisior]
+
+# [Check Hypervisior]
 function check_hypervisior(){
-    return $(cat $Work_Home/.tmp/hypervisior)
+    hypervisior=$(cat $Work_Home/.tmp/hypervisior)    
+}
+
+
+# [Check Debian Xen package]
+function check_debian_xen(){
+aptitude update
+check_debian_xen_pkg=$(aptitude search xen-linux-system)
+if [ -n $check_debian_xen_pkg  ]; then
+    check_debian_xen_pkg="yes"
+else
+    check_debian_xen_pkg="no"
+fi
+}
+
+
+# [Check Xen kernel]
+function check_xen_nu(){
+Kernels=$(ls /boot | grep vmlinuz)
+Kernel_choose=""
+jude="no"
+
+while [ $jude != "yes" -a $jude != "y" ]
+do
+    declare -i i=1
+    echo ""
+    
+    for Kernel in $Kernels
+    do
+        echo "($i) $Kernel" 
+        i=i+1
+    done
+
+    read -p "Xen Kenrel is (1/2/...): " Kernel_choose
+    read -p "Are you sure (yes/no): " jude
+done
+
+Xen_Kernel=$(echo $Kernels | cut -d " " -f${Kernel_choose})
+#echo "debug: Xen_Kernel=$Xen_Kernel"
 }
 
 # [DRBL Check]
 
+
+
