Changeset 171
- Timestamp:
- Aug 10, 2010, 4:00:31 PM (14 years ago)
- Location:
- drbl-virt
- Files:
-
- 1 added
- 2 edited
- 1 copied
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
drbl-virt/install.sh
r162 r171 12 12 Work_Home="/opt/drbl-virt" 13 13 Work_Path="/opt/drbl-virt/sbin" 14 Now_ path="pwd $0"14 Now_Path="$(dirname $0)" 15 15 PATH=${PATH}:$Work_Path 16 16 17 17 # [Source] 18 source funs_drbl_virt18 source $Now_Path/sbin/functions_drbl_virt 19 19 20 20 # [Main] … … 23 23 24 24 mkdir -p $Work_Home 25 cp - r $Now_path/sbin $Work_Path/26 cp - r $Now_path/conf $Work_Path/27 25 cp -fr $Now_Path/sbin $Work_Home/ 26 cp -fr $Now_Path/conf $Work_Home/ 27 cp -fr $Now_Path/uninstall.sh $Work_Home/ -
drbl-virt/sbin/drbl_kvm_patch.sh
r161 r171 9 9 # 2010/07/20 Rock First release (1.0) 10 10 11 # [PATH]12 #Work_Path=$(dirname "$0")13 #PATH=${PATH}:$Work_Path14 15 11 # [Source] 16 #source funs_drbl_virt17 12 source functions_drbl_virt 13 source /opt/drbl-virt/conf/drbl-virt.conf 18 14 # [Main] 19 15 20 # [Install VMM/Hypervisior]21 if [ $VMM_select == 1 ]; then22 source xen_intall.sh23 else24 source kvm_intall.sh25 fi26 16 27 17 # [DRBL Environment Configuration] -
drbl-virt/sbin/drbl_virt.sh
r161 r171 9 9 # 2010/07/20 Rock First release (1.0) 10 10 11 # [PATH]12 Work_Home="/opt/drbl-virt"13 Work_Path="/opt/drbl-virt/sbin"14 PATH=${PATH}:$Work_Path15 16 11 # [Source] 17 source funs_drbl_virt18 12 source /opt/drbl-virt/conf/drbl-virt.conf 13 source /opt/drbl-virt/sbin/functions_drbl_virt 19 14 # [Main] 20 15 install_drbl-virt_dir … … 22 17 check_systemInfo 23 18 VMM_select 19 #check_root 24 20 25 21 # [Install VMM/Hypervisior] 1=Xen, 2=KVM 26 22 if [ $VMM_select == 1 ]; then 27 source xen_in tall.sh23 source xen_install.sh 28 24 else 29 source kvm_in tall.sh25 source kvm_install.sh 30 26 fi 31 27 -
drbl-virt/sbin/drbl_xen_patch.sh
r161 r171 9 9 # 2010/07/20 Rock First release (1.0) 10 10 11 # [PATH]12 #Work_Path=$(dirname "$0")13 #PATH=${PATH}:$Work_Path14 15 11 # [Source] 16 #source funs_drbl_virt 12 source functions_drbl_virt 13 source /opt/drbl-virt/conf/drbl-virt.conf 17 14 18 15 # [Main] 19 16 20 # [Install VMM/Hypervisior] 21 if [ $VMM_select == 1 ]; then 22 source xen_intall.sh 23 else 24 source kvm_intall.sh 25 fi 17 # = 1. Patch DRBL xen env for client = 18 # == Shutdown all drbl client == 19 echo "Please check all client are shutdown !!!" 20 read -p "Push 'Enter' to continue......" 26 21 27 # [DRBL Environment Configuration] 22 # == Change xen kernel for drbl client == 23 check_xen_nu 24 Xen_Kernel=$(echo $Xen_Kernel | sed 's/^vmlinuz-//g' ) 25 echo "/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel" 26 #/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel 27 echo "" 28 28 29 # == Re-delpoy drbl client == 30 echo "Re-delpoy drbl client" 31 echo "/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf" 32 #/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf 33 echo "" 34 35 # == Copy xen image to /tftpboot/nbi_img/ == 36 echo "copy Xen image & Kernel to /tftpboot/nbi_img/" 37 cp /boot/*xen* /tftpboot/nbi_img/ 38 cp /boot/vmlinuz-${Xen_Kernel} /tftpboot/nbi_img/ 39 cp /boot/initrd.img-${Xen_Kernel} /tftpboot/nbi_img/ 40 cp /boot/config-${Xen_Kernel} /tftpboot/nbi_img/ 41 echo "" 42 43 # == Modify PXE booting menu == 44 # backup 45 cp /tftpboot/nbi_img/pxelinux.cfg/default /tftpboot/nbi_img/pxelinux.cfg/default.drbl-virt_bak 46 47 48 # = 2. Patch DRBL initrd to support bridge = 49 # == Patch /usr/bin/mkpxeinitrd-net (1)modules (2)xen network scripts == 50 51 # == Copy xen netwrok scripts == 52 53 # == run xen network scripts (/usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init) == 54 55 56 -
drbl-virt/sbin/functions_drbl_virt
r161 r171 19 19 function check_root(){ 20 20 if [ $USER != "root" ]; then 21 echo -e "Please input root password to run it!" 22 su -c "$0" "$@" 23 21 echo -e "Please change root to run it!" 22 exit 24 23 fi 25 24 } 25 26 function check_root_run(){ 27 if [ $USER != "root" ]; then 28 echo -e "Please change root to run it!" 29 sudo su -c ~/"$0" "$@" 30 exit 31 fi 32 } 33 26 34 27 35 # [Check CPU support] … … 40 48 } 41 49 42 50 # [Select Hypervisior(Xen/KVM)] 43 51 function VMM_select(){ 44 52 if [ $cpu_flag == "yes" ]; then … … 47 55 read -p "Which VMM/Hypervisior will be used in DRBL (1)Xen (2)KVM: " VMM_select 48 56 done 49 echo "Xen" > $Work_Home/.tmp/hypervisior 57 if [ $VMM_select == "1" ]; then 58 echo "Xen" > $Work_Home/.tmp/hypervisior 59 else 60 echo "KVM" > $Work_Home/.tmp/hypervisior 61 fi 50 62 else 51 63 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 64 echo -e "Because CPU don't support virtualization, it can't choose KVM to be the Hypervisior" 65 echo "" 66 VMM_select=1 67 echo "Xen" > $Work_Home/.tmp/hypervisior 55 68 fi 56 69 } 57 70 58 # [create drbl-virt path] 71 72 # [Create drbl-virt path] 59 73 function install_drbl-virt_dir(){ 60 74 mkdir -p $Work_Home/.tmp 61 75 } 62 76 63 # [check Hypervisior] 77 78 # [Check Hypervisior] 64 79 function check_hypervisior(){ 65 return $(cat $Work_Home/.tmp/hypervisior) 80 hypervisior=$(cat $Work_Home/.tmp/hypervisior) 81 } 82 83 84 # [Check Debian Xen package] 85 function check_debian_xen(){ 86 aptitude update 87 check_debian_xen_pkg=$(aptitude search xen-linux-system) 88 if [ -n $check_debian_xen_pkg ]; then 89 check_debian_xen_pkg="yes" 90 else 91 check_debian_xen_pkg="no" 92 fi 93 } 94 95 96 # [Check Xen kernel] 97 function check_xen_nu(){ 98 Kernels=$(ls /boot | grep vmlinuz) 99 Kernel_choose="" 100 jude="no" 101 102 while [ $jude != "yes" -a $jude != "y" ] 103 do 104 declare -i i=1 105 echo "" 106 107 for Kernel in $Kernels 108 do 109 echo "($i) $Kernel" 110 i=i+1 111 done 112 113 read -p "Xen Kenrel is (1/2/...): " Kernel_choose 114 read -p "Are you sure (yes/no): " jude 115 done 116 117 Xen_Kernel=$(echo $Kernels | cut -d " " -f${Kernel_choose}) 118 #echo "debug: Xen_Kernel=$Xen_Kernel" 66 119 } 67 120 68 121 # [DRBL Check] 69 122 123 124 -
drbl-virt/uninstall.sh
r161 r171 10 10 11 11 # [PATH] 12 Work_Path=$(dirname "$0") 12 Work_Home="/opt/drbl-virt" 13 Work_Path="/opt/drbl-virt/sbin" 14 Now_Path="$(dirname $0)" 13 15 PATH=${PATH}:$Work_Path 14 16 15 17 # [Source] 16 source funs_drbl_virt 17 18 source $Now_Path/sbin/functions_drbl_virt 18 19 # [Main] 19 20 check_systemInfo 21 checkroot 20 22 21 23 case $Linux_Distribution in … … 54 56 esac 55 57 58 cd 59 rm -fr $Work_Home
Note: See TracChangeset
for help on using the changeset viewer.