Do not execute checks if we already found that PTI is enabled

This commit is contained in:
Alkorin 2018-01-08 15:31:59 +01:00
parent f8ca11e56a
commit 26564206db
1 changed files with 2 additions and 2 deletions

View File

@ -260,7 +260,7 @@ elif [ -e /boot/config-$(uname -r) ]; then
kpti_support=1
fi
fi
if [ -e /boot/System.map-$(uname -r) ]; then
if [ "$kpti_support" = 0 -a -e /boot/System.map-$(uname -r) ]; then
# it's not an elif: some backports don't have the PTI config but still include the patch
# so we try to find an exported symbol that is part of the PTI patch in System.map
kpti_can_tell=1
@ -268,7 +268,7 @@ if [ -e /boot/System.map-$(uname -r) ]; then
kpti_support=1
fi
fi
if [ -n "$vmlinux" ]; then
if [ "$kpti_support" = 0 -a -n "$vmlinux" ]; then
# same as above but in case we don't have System.map and only vmlinux, look for the
# nopti option that is part of the patch (kernel command line option)
kpti_can_tell=1