Merge pull request #48 from speed47/opensuse

fix(opensuse): add specific location for ibrs_enabled file
This commit is contained in:
Stéphane Lesimple 2018-01-10 18:41:30 +01:00 committed by GitHub
commit b913dacc1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -601,17 +601,21 @@ check_variant2()
_info_nol "* Kernel support for IBRS: " _info_nol "* Kernel support for IBRS: "
if [ "$opt_live" = 1 ]; then if [ "$opt_live" = 1 ]; then
mount_debugfs mount_debugfs
if [ -e /sys/kernel/debug/ibrs_enabled ]; then for ibrs_file in \
# if the file is there, we have IBRS compiled-in /sys/kernel/debug/ibrs_enabled \
pstatus green YES /sys/kernel/debug/x86/ibrs_enabled \
ibrs_supported=1 /proc/sys/kernel/ibrs_enabled; do
ibrs_enabled=$(cat /sys/kernel/debug/ibrs_enabled 2>/dev/null) if [ -e "$ibrs_file" ]; then
elif [ -e /sys/kernel/debug/x86/ibrs_enabled ]; then # if the file is there, we have IBRS compiled-in
# RedHat uses a different path (see https://access.redhat.com/articles/3311301) # /sys/kernel/debug/ibrs_enabled: vanilla
pstatus green YES # /sys/kernel/debug/x86/ibrs_enabled: RedHat (see https://access.redhat.com/articles/3311301)
ibrs_supported=1 # /proc/sys/kernel/ibrs_enabled: OpenSUSE tumbleweed
ibrs_enabled=$(cat /sys/kernel/debug/x86/ibrs_enabled 2>/dev/null) pstatus green YES
fi ibrs_supported=1
ibrs_enabled=$(cat "$ibrs_file" 2>/dev/null)
break
fi
done
fi fi
if [ "$ibrs_supported" != 1 -a -n "$opt_map" ]; then if [ "$ibrs_supported" != 1 -a -n "$opt_map" ]; then
if grep -q spec_ctrl "$opt_map"; then if grep -q spec_ctrl "$opt_map"; then