68fb35882ba3c3a1794b4067149358a0d0b7bd12
[AGL/meta-agl.git] / meta-app-framework / recipes-kernel / linux / linux-appfw.inc
1 FILESEXTRAPATHS:prepend := "${THISDIR}/linux:"
2
3 # Enable SMACK support without making it the default explicitly.
4 AGL_KCONFIG_FRAGMENTS += "smack.cfg"
5
6 # Enable SMACK as default LSM, can be overridden by changing this
7 # variable to e.g. "".
8 #
9 # NOTE:
10 # We use a different fragment for kernels older than 5.x that predate
11 # the switch to using CONFIG_LSM instead of CONFIG_DEFAULT_SECURITY.
12 # For simplicity, logic to handle the change being made in 5.1 instead
13 # of 5.0 has been omitted; in practice this should not be a problem
14 # since no current BSPs have been seen that use 5.0.x.  If a BSP
15 # kernel recipe does not set LINUX_VERSION, the kernel being 5.x or
16 # newer is assumed as the default behavior.
17 LINUX_VERSION_MAJOR = "${@(d.getVar('LINUX_VERSION') or "5.x").split('.')[0]}"
18 SMACK_DEFAULT_SUFFIX = "${@'' if int(d.getVar('LINUX_VERSION_MAJOR') or 0) >= 5 else '-old'}"
19 SMACK_DEFAULT_SECURITY ??= "smack-default-lsm${SMACK_DEFAULT_SUFFIX}.cfg"
20 AGL_KCONFIG_FRAGMENTS += "${SMACK_DEFAULT_SECURITY}"
21
22 # Enable audit support
23 AGL_KCONFIG_FRAGMENTS += "audit.cfg"