diff options
author | Xin Ouyang <Xin.Ouyang@windriver.com> | 2013-01-04 18:26:47 +0800 |
---|---|---|
committer | Xin Ouyang <Xin.Ouyang@windriver.com> | 2013-01-05 13:14:00 +0800 |
commit | b493530bffebef2c2887228304cb5e738abb9d29 (patch) | |
tree | 675634ebca1544894a8e133592a67d951579bde9 | |
parent | 17335d322c10f2b741bdca5d49a02d557e634736 (diff) | |
download | meta-selinux-b493530bffebef2c2887228304cb5e738abb9d29.tar.gz |
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>
-rw-r--r-- | classes/enable-audit.bbclass | 5 | ||||
-rw-r--r-- | classes/enable-selinux.bbclass | 4 | ||||
-rw-r--r-- | classes/selinux.bbclass | 12 | ||||
-rw-r--r-- | classes/with-audit.bbclass | 5 | ||||
-rw-r--r-- | classes/with-selinux.bbclass | 4 |
5 files changed, 30 insertions, 0 deletions
diff --git a/classes/enable-audit.bbclass b/classes/enable-audit.bbclass new file mode 100644 index 0000000..5820a38 --- /dev/null +++ b/classes/enable-audit.bbclass | |||
@@ -0,0 +1,5 @@ | |||
1 | # There is still no audit DISTRO_FEATURE, so enable audit when selinux feature enabled. | ||
2 | inherit selinux | ||
3 | |||
4 | PACKAGECONFIG_append = " ${@target_selinux(d, 'audit')}" | ||
5 | PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," | ||
diff --git a/classes/enable-selinux.bbclass b/classes/enable-selinux.bbclass new file mode 100644 index 0000000..de2a124 --- /dev/null +++ b/classes/enable-selinux.bbclass | |||
@@ -0,0 +1,4 @@ | |||
1 | inherit selinux | ||
2 | |||
3 | PACKAGECONFIG_append = " ${@target_selinux(d)}" | ||
4 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux," | ||
diff --git a/classes/selinux.bbclass b/classes/selinux.bbclass new file mode 100644 index 0000000..87d4d59 --- /dev/null +++ b/classes/selinux.bbclass | |||
@@ -0,0 +1,12 @@ | |||
1 | def target_selinux(d, truevar = 'selinux', falsevar = ''): | ||
2 | if not base_contains("DISTRO_FEATURES", "selinux", True, False, d): | ||
3 | return falsevar | ||
4 | |||
5 | pn = d.getVar("PN", True) | ||
6 | type = pn.replace(d.getVar("BPN", True), "") | ||
7 | if type in ("-native", "-nativesdk", "-cross", "-crosssdk"): | ||
8 | return falsevar | ||
9 | |||
10 | return truevar | ||
11 | |||
12 | LIBSELINUX = "${@target_selinux(d, 'libselinux')}" | ||
diff --git a/classes/with-audit.bbclass b/classes/with-audit.bbclass new file mode 100644 index 0000000..0c15312 --- /dev/null +++ b/classes/with-audit.bbclass | |||
@@ -0,0 +1,5 @@ | |||
1 | # There is still no audit DISTRO_FEATURE, so enable audit when selinux feature enabled. | ||
2 | inherit selinux | ||
3 | |||
4 | PACKAGECONFIG_append = " ${@target_selinux(d, 'audit')}" | ||
5 | PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," | ||
diff --git a/classes/with-selinux.bbclass b/classes/with-selinux.bbclass new file mode 100644 index 0000000..7873d9b --- /dev/null +++ b/classes/with-selinux.bbclass | |||
@@ -0,0 +1,4 @@ | |||
1 | inherit selinux | ||
2 | |||
3 | PACKAGECONFIG_append = " ${@target_selinux(d)}" | ||
4 | PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux," | ||