X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2Fenvs%2Fguest-setup0.sh;h=fb3133b9ffb50dc7f4c95daf51ab56959178a798;hb=0c2f88aa2ccffc538c276caac88da6841107bf81;hp=490bd570df24e2a2d5e711746fd7b07ae7a2bdbb;hpb=094281166bad07b351bda2e16b225f492c959bf3;p=kvmfornfv.git diff --git a/ci/envs/guest-setup0.sh b/ci/envs/guest-setup0.sh index 490bd570d..fb3133b9f 100755 --- a/ci/envs/guest-setup0.sh +++ b/ci/envs/guest-setup0.sh @@ -8,28 +8,33 @@ ## http://www.apache.org/licenses/LICENSE-2.0 ############################################################################### +source utils.sh -rpmdir=${1:-"/root/workspace/"} -rpmpat="kernel-4.1*.rpm" -rpm -ihv ${rpmdir}/rt-tests-0.96-1.el7.centos.x86_64.rpm +KERNEL_VERSION=$( getKernelVersion ) +if [ -z $KERNEL_VERSION ];then + echo "Kernel RPM not found" + exit 1 +fi +rpmdir=${1:-"/root/workspace/rpm"} +rpmpat="kernel-${KERNEL_VERSION}*.rpm" guest_isolcpus=1 -# The script's caller should passing the rpm directory that is built out from +# The script's caller should passing the rpm directory that is built out from # build.sh. The default rpmdir is the one used by yardstick scripts. install_kernel () { # Install the kernel rpm filenum=`ls -l ${rpmdir}/${rpmpat} |wc -l` if [ $filenum -eq 0 ] then - echo "No kernel rpm found in workspace/rpm" - exit 1 + echo "No kernel rpm found in workspace/rpm" + exit 1 elif [ $filenum -gt 1 ] then - echo "Multiple kernel rpm found in workspace/rpm" - exit 1 + echo "Multiple kernel rpm found in workspace/rpm" + exit 1 else - krpm=`find "${rpmdir}" -name "${rpmpat}"` - rpm -ihv $krpm + krpm=`find "${rpmdir}" -name "${rpmpat}"` + rpm -ihv $krpm fi } @@ -59,5 +64,6 @@ config_grub 'idle' 'poll' ## Disable clocksource verification at runtime config_grub 'tsc' 'reliable' -grub2-mkconfig -o /boot/grub2/grub.cfg +sed -ie 's/saved/0/g' /etc/default/grub install_kernel +grub2-mkconfig -o /boot/grub2/grub.cfg