From 2e23af5e28f1811fbfa0a7203c8939cf2ed0f31e Mon Sep 17 00:00:00 2001
From: Tomasz Wasilczyk <twasilczyk@google.com>
Date: Fri, 9 Nov 2018 13:09:24 -0800
Subject: [PATCH] Allow iw to be run at init phase.

This enables native wireless interface configuration at boot.

Bug: 36120314
Test: adb shell ifconfig -a | grep wlan
Change-Id: I797c0c8a8645d690d311f42cec3998b2f4cee77b
---
 private/file_contexts | 1 +
 private/iw.te         | 4 ++++
 2 files changed, 5 insertions(+)
 create mode 100644 private/iw.te

diff --git a/private/file_contexts b/private/file_contexts
index cde191c18..6d64c9b65 100644
--- a/private/file_contexts
+++ b/private/file_contexts
@@ -213,6 +213,7 @@
 /system/bin/incident   u:object_r:incident_exec:s0
 /system/bin/incidentd   u:object_r:incidentd_exec:s0
 /system/bin/incident_helper  u:object_r:incident_helper_exec:s0
+/system/bin/iw                   u:object_r:iw_exec:s0
 /system/bin/netutils-wrapper-1\.0    u:object_r:netutils_wrapper_exec:s0
 /system/bin/vold	u:object_r:vold_exec:s0
 /system/bin/netd	u:object_r:netd_exec:s0
diff --git a/private/iw.te b/private/iw.te
new file mode 100644
index 000000000..adc8c9632
--- /dev/null
+++ b/private/iw.te
@@ -0,0 +1,4 @@
+type iw, domain, coredomain;
+type iw_exec, system_file_type, exec_type, file_type;
+
+init_daemon_domain(iw)
-- 
GitLab