X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2Fenvs%2Fhost-setup0.sh;h=e852726d749ec56d671254ba23e80623acabbc65;hb=HEAD;hp=28c49b8b88ba1e3f5770cbbaf2b1a2d165985f7b;hpb=42e2343970d47d0aa081a565c0f51873778e555c;p=kvmfornfv.git diff --git a/ci/envs/host-setup0.sh b/ci/envs/host-setup0.sh index 28c49b8b8..e852726d7 100755 --- a/ci/envs/host-setup0.sh +++ b/ci/envs/host-setup0.sh @@ -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.4*.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