Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

Commit 2c757f9

Browse files
ceiba1985sysopenci
authored andcommitted
Add a new SEPolicy macro of module_not_disable
Add a new SEPolicy macro of module_not_disable, use this to wrap the sepolicy rules needed to be compiled if some module is disabled. Tracked-On: OAM-127489 Signed-off-by: jizhenlo <zhenlong.z.ji@intel.com>
1 parent b3bf1a6 commit 2c757f9

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

rfkill/hal_bluetooth_vbt.te

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
allow hal_bluetooth_vbt rfkill_device:chr_file rw_file_perms;
1+
module_not_disable(`bluetooth', `
2+
allow hal_bluetooth_vbt rfkill_device:chr_file rw_file_perms;
3+
')

te_macros

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ define(`target_only', `ifelse(eval(index(board_sepolicy_target_product, $1) >= 0
2525
# WARNING: <modname> cannot contain a dash, use underscores.
2626
define(`module_only', `ifelse(module_$1, `true', $2)')
2727

28+
#####################################
29+
# module_not_disable(module_name, rules)
30+
# Only add rules if a module is not false.
31+
define(`module_not_disable', `ifelse(module_$1, `false', , $2)')
32+
2833
# ignore_adb_debug(domain)
2934
# Some hal interface expose a forwarded port over adb
3035
# for debugging, ignore these. If you need to access

0 commit comments

Comments
 (0)