2 ##############################################################################
3 ## Copyright (c) 2015 Intel Corp.
5 ## All rights reserved. This program and the accompanying materials
6 ## are made available under the terms of the Apache License, Version 2.0
7 ## which accompanies this distribution, and is available at
8 ## http://www.apache.org/licenses/LICENSE-2.0
9 ###############################################################################
13 KERNEL_VERSION=$( getKernelVersion )
14 if [ -z $KERNEL_VERSION ];then
15 echo "Kernel RPM not found"
18 rpmdir=${1:-"/root/workspace/rpm"}
19 rpmpat="kernel-${KERNEL_VERSION}*.rpm"
22 # The script's caller should passing the rpm directory that is built out from
23 # build.sh. The default rpmdir is the one used by yardstick scripts.
25 # Install the kernel rpm
26 filenum=`ls -l ${rpmdir}/${rpmpat} |wc -l`
29 echo "No kernel rpm found in workspace/rpm"
31 elif [ $filenum -gt 1 ]
33 echo "Multiple kernel rpm found in workspace/rpm"
36 krpm=`find "${rpmdir}" -name "${rpmpat}"`
45 if grep '[" ]'${key} /etc/default/grub > /dev/null ; then
46 sed -i 's/\([" ]\)'${key}'=[^ "]*/\1'${key}'='${val}'/' /etc/default/grub
48 sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="\1 '${key}'='${val}'"/' /etc/default/grub
52 # Isolate CPUs from the general scheduler
53 config_grub 'isolcpus' ${guest_isolcpus}
55 # Stop timer ticks on isolated CPUs whenever possible
56 config_grub 'nohz_full' ${guest_isolcpus}
58 # Disable machine check
59 config_grub 'mce' 'off'
61 # Use polling idle loop to improve performance
62 config_grub 'idle' 'poll'
64 ## Disable clocksource verification at runtime
65 config_grub 'tsc' 'reliable'
67 sed -ie 's/saved/0/g' /etc/default/grub
69 grub2-mkconfig -o /boot/grub2/grub.cfg