Skip to content

Commit 01b0330

Browse files
authored
[install.sh] Fix CPU cstates configuration. (sonic-net#7222)
The motivation of these changes is to fix (sonic-net#6051): - Why I did it To fix CPU cstates configuration - How I did it Updated code to be POSIX compatible - How to verify it root@sonic:/home/admin# sonic_installer install sonic-mellanox.bin Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
1 parent 9fa5a61 commit 01b0330

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

installer/x86_64/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,10 @@ trap_push "rm $grub_cfg || true"
562562
[ -r ./platform.conf ] && . ./platform.conf
563563
564564
# Check if the CPU vendor is 'Intel' and disable c-states if True
565-
CPUVENDOR=$(cat /proc/cpuinfo | grep -m 1 vendor_id | awk '{print $3}')
565+
CPUVENDOR="$(cat /proc/cpuinfo | grep -m 1 vendor_id | awk '{print $3}')"
566566
echo "Switch CPU vendor is: $CPUVENDOR"
567-
if [[ $(echo $CPUVENDOR | grep -i "Intel") ]] ; then
567+
if echo "$CPUVENDOR" | grep -i 'Intel' >/dev/null 2>&1; then
568+
echo "Switch CPU cstates are: disabled"
568569
CSTATES="intel_idle.max_cstate=0"
569570
else
570571
CSTATES=""

0 commit comments

Comments
 (0)