Changeset 172 for drbl-virt/sbin


Ignore:
Timestamp:
Aug 10, 2010, 4:40:41 PM (14 years ago)
Author:
rock
Message:

Add: Check for Xen & kernel version

Location:
drbl-virt/sbin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/drbl_xen_patch.sh

    r171 r172  
    3535# == Copy xen image to /tftpboot/nbi_img/ ==
    3636echo "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/
     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/
    4141echo ""
    4242
    4343# == Modify PXE booting menu ==
    4444# backup
    45 cp /tftpboot/nbi_img/pxelinux.cfg/default /tftpboot/nbi_img/pxelinux.cfg/default.drbl-virt_bak
     45#cp /tftpboot/nbi_img/pxelinux.cfg/default /tftpboot/nbi_img/pxelinux.cfg/default.drbl-virt_bak
    4646
    4747
  • drbl-virt/sbin/functions_drbl_virt

    r171 r172  
    9797function check_xen_nu(){
    9898Kernels=$(ls /boot | grep vmlinuz)
     99declare -i Kernels_nu=$(echo $Kernels | wc -w)
    99100Kernel_choose=""
     101
     102Xens=$(ls /boot | grep -i ^xen)
     103declare -i Xen_nu=$(echo $Xen | wc -w)
     104Xen_choose=""
     105
    100106jude="no"
    101107
     
    103109do
    104110    declare -i i=1
     111    declare -i j=1
    105112    echo ""
    106113   
    107     for Kernel in $Kernels
    108     do
    109         echo "($i) $Kernel"
    110         i=i+1
    111     done
     114    if [ $Kernels_nu -gt 1  ]; then
     115        for Kernel in $Kernels
     116        do
     117            echo "($i) $Kernel"
     118            i=i+1
     119        done
    112120
    113     read -p "Xen Kenrel is (1/2/...): " Kernel_choose
     121        read -p "Xen Kenrel is (1/2/...): " Kernel_choose
     122        Xen_Kernel=$(echo $Kernels | cut -d " " -f${Kernel_choose})
     123
     124    else
     125        Xen_Kernel=$Kernels
     126    fi
     127
     128    if [ $Xen_nu -gt 1  ]; then
     129        for Xen in $Xens
     130        do
     131            echo "($i) $Xen"
     132            j=j+1
     133        done
     134
     135        read -p "Xen is (1/2/...): " Xen_choose
     136        Xen=$(echo $Xens | cut -d " " -f${Xen_choose})
     137    else
     138        Xen=$Xens
     139    fi
     140
    114141    read -p "Are you sure (yes/no): " jude
    115142done
    116143
    117 Xen_Kernel=$(echo $Kernels | cut -d " " -f${Kernel_choose})
     144
    118145#echo "debug: Xen_Kernel=$Xen_Kernel"
    119146}
Note: See TracChangeset for help on using the changeset viewer.