Execution of Livemigration through Yardstick
[kvmfornfv.git] / ci / envs / host-setup0.sh
index 79d1f58..e852726 100755 (executable)
@@ -9,10 +9,17 @@
 ## http://www.apache.org/licenses/LICENSE-2.0
 ###############################################################################
 
+source utils.sh
 source host-config
 
+KERNEL_VERSION=$( getKernelVersion )
+if [ -z $KERNEL_VERSION ];then
+   echo "Kernel RPM not found"
+   exit 1
+fi
 rpmdir=${1:-"/root/workspace/rpm/"}
-rpmpat="kernel-4.1*.rpm"
+rpmpat="kernel-${KERNEL_VERSION}*.rpm"
+rpmdev="kernel-devel-${KERNEL_VERSION}*.rpm"
 
 config_grub () {
     key=$1
@@ -25,7 +32,7 @@ config_grub () {
     fi
 }
 
-# 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
@@ -40,7 +47,9 @@ install_kernel () {
        exit 1
     else
        krpm=`find "${rpmdir}" -name "${rpmpat}"`
+        kdrpm=`find "${rpmdir}" -name "${rpmdev}"`
        rpm -ihv $krpm
+        rpm -ihv $kdrpm
     fi
 }
 
@@ -70,6 +79,6 @@ config_grub 'idle' 'poll'
 ## Disable clocksource verification at runtime
 config_grub 'tsc' 'reliable'
 
-grub2-mkconfig -o /boot/grub2/grub.cfg
-
 install_kernel
+
+grub2-mkconfig -o /boot/grub2/grub.cfg