mirror of
git://git.yoctoproject.org/meta-selinux
synced 2026-01-01 13:58:04 +00:00
layer: add selinux/audit bbclasses
Add bbclasses only for target packages to enable selinux support, not native/nativesdk/cross/crosssdk pacakges. Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
This commit is contained in:
parent
8a9b6df2b5
commit
3b2a6313c4
5
classes/enable-audit.bbclass
Normal file
5
classes/enable-audit.bbclass
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# There is still no audit DISTRO_FEATURE, so enable audit when selinux feature enabled.
|
||||
inherit selinux
|
||||
|
||||
PACKAGECONFIG_append = " ${@target_selinux(d, 'audit')}"
|
||||
PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
|
||||
4
classes/enable-selinux.bbclass
Normal file
4
classes/enable-selinux.bbclass
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
inherit selinux
|
||||
|
||||
PACKAGECONFIG_append = " ${@target_selinux(d)}"
|
||||
PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
|
||||
12
classes/selinux.bbclass
Normal file
12
classes/selinux.bbclass
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
def target_selinux(d, truevar = 'selinux', falsevar = ''):
|
||||
if not base_contains("DISTRO_FEATURES", "selinux", True, False, d):
|
||||
return falsevar
|
||||
|
||||
pn = d.getVar("PN", True)
|
||||
type = pn.replace(d.getVar("BPN", True), "")
|
||||
if type in ("-native", "-nativesdk", "-cross", "-crosssdk"):
|
||||
return falsevar
|
||||
|
||||
return truevar
|
||||
|
||||
LIBSELINUX = "${@target_selinux(d, 'libselinux')}"
|
||||
5
classes/with-audit.bbclass
Normal file
5
classes/with-audit.bbclass
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# There is still no audit DISTRO_FEATURE, so enable audit when selinux feature enabled.
|
||||
inherit selinux
|
||||
|
||||
PACKAGECONFIG_append = " ${@target_selinux(d, 'audit')}"
|
||||
PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
|
||||
4
classes/with-selinux.bbclass
Normal file
4
classes/with-selinux.bbclass
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
inherit selinux
|
||||
|
||||
PACKAGECONFIG_append = " ${@target_selinux(d)}"
|
||||
PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
|
||||
Loading…
Reference in New Issue
Block a user