From f4755f22b0918cb559ec824aa748f09e5430f434 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 16 Mar 2020 18:33:09 +0100 Subject: [PATCH] common: Allow kernel to load firmware from /vendor/firmware Change-Id: I4ec18a2857d1cc3a63aaf4e94904005a0c5fbc41 --- common/vendor/file.te | 3 +++ common/vendor/file_contexts | 2 ++ common/vendor/kernel.te | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 common/vendor/kernel.te diff --git a/common/vendor/file.te b/common/vendor/file.te index a1c4b23..8983ac0 100644 --- a/common/vendor/file.te +++ b/common/vendor/file.te @@ -9,3 +9,6 @@ type sysfs_wifi, sysfs_type, r_fs_type, fs_type; type sysfs_backlight_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_wifi_writable, sysfs_type, rw_fs_type, fs_type; + +### VENDOR +type vendor_firmware_file, file_type, vendor_file_type; diff --git a/common/vendor/file_contexts b/common/vendor/file_contexts index b9df724..aa29f77 100644 --- a/common/vendor/file_contexts +++ b/common/vendor/file_contexts @@ -10,3 +10,5 @@ /(vendor|system/vendor)/bin/hw/android\.hardware\.vibrator@[0-9].[0-9]-service\.samsung-haptic u:object_r:hal_vibrator_default_exec:s0 /(vendor|system/vendor)/bin/hw/vendor\.samsung_slsi\.hardware\.configstore@[0-9]\.[0-9]-service u:object_r:hal_vendor_configstore_default_exec:s0 /(vendor|system/vendor)/bin/hw/vendor\.samsung_slsi\.hardware\.ExynosHWCServiceTW@[0-9]\.[0-9]-service u:object_r:hal_vendor_hwcservice_default_exec:s0 + +/(vendor|system/vendor)/firmware(/.*)? u:object_r:vendor_firmware_file:s0 diff --git a/common/vendor/kernel.te b/common/vendor/kernel.te new file mode 100644 index 0000000..b016aad --- /dev/null +++ b/common/vendor/kernel.te @@ -0,0 +1,5 @@ +# kernel.te + +# /vendor/firmware/ +allow kernel vendor_firmware_file:dir r_dir_perms; +allow kernel vendor_firmware_file:file r_file_perms; -- 2.20.1