Blame SOURCES/reload_microcode

539655
#! /bin/bash -efu
539655
539655
# Trigger microcode reload with additional check for BDW-EP that can have
539655
# microcode reloaded only in case kernel has specific patches.
539655
#
539655
# SPDX-License-Identifier: CC0-1.0
539655
539655
CHECK_CAVEATS=/usr/libexec/microcode_ctl/check_caveats
4eb1a6
IGNORE_HYPERVISOR="/etc/microcode_ctl/ignore-hypervisor-flag"
539655
trigger=1
539655
4eb1a6
[ -e "$IGNORE_HYPERVISOR" ] || {
4eb1a6
	if grep -q '^flags[[:space:]]*:.* hypervisor\( .*\)\?$' /proc/cpuinfo
4eb1a6
	then
4eb1a6
		exit 0
4eb1a6
	fi
4eb1a6
}
4eb1a6
539655
"$CHECK_CAVEATS" -m > /dev/null || trigger=0
539655
539655
[ 0 -eq "$trigger" ] || echo 2>/dev/null 1 > /sys/devices/system/cpu/microcode/reload || true