Blame SOURCES/reload_microcode

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