diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2016-06-21 00:56:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-06-21 00:56:34 +0000 |
commit | 2b6ca2416ccd39056974a20a9c94be2ee233d3f5 (patch) | |
tree | d22632eb3647d8bf3e1c743027c59937735aa0b8 | |
parent | 514e03e19275f308b8c36479f4249de0330ff70d (diff) | |
parent | 8694e9837b0f8c3e884f636358d965b8bc0bfd81 (diff) | |
download | fugu-2b6ca2416ccd39056974a20a9c94be2ee233d3f5.tar.gz |
Merge "Fugu: set mfg country code at boot for Wifi" into nyc-dev
-rw-r--r-- | device.mk | 4 | ||||
-rwxr-xr-x | init.fugu.countrycode.sh | 2 | ||||
-rw-r--r-- | init.fugu.rc | 2 | ||||
-rw-r--r-- | sepolicy/file_contexts | 2 | ||||
-rw-r--r-- | sepolicy/init-fugu-countrycode-sh.te | 13 | ||||
-rw-r--r-- | sepolicy/property.te | 1 | ||||
-rw-r--r-- | sepolicy/property_contexts | 3 | ||||
-rw-r--r-- | sepolicy/shell.te | 1 | ||||
-rw-r--r-- | sepolicy/system_server.te | 3 |
9 files changed, 30 insertions, 1 deletions
@@ -287,3 +287,7 @@ PRODUCT_COPY_FILES += \ device/asus/fugu/sep_policy.conf:system/etc/security/sep_policy.conf #PRODUCT_CHARACTERISTICS := tablet + +# Wifi country code +PRODUCT_COPY_FILES += \ + device/asus/fugu/init.fugu.countrycode.sh:system/bin/init.fugu.countrycode.sh diff --git a/init.fugu.countrycode.sh b/init.fugu.countrycode.sh new file mode 100755 index 0000000..a0fd9d8 --- /dev/null +++ b/init.fugu.countrycode.sh @@ -0,0 +1,2 @@ +#!/system/bin/sh +setprop ro.boot.wificountrycode `cat /factory/country` diff --git a/init.fugu.rc b/init.fugu.rc index fb80ef0..7429b13 100644 --- a/init.fugu.rc +++ b/init.fugu.rc @@ -76,6 +76,8 @@ on boot # Wifi setprop wifi.interface wlan0 + # Set correct country code + exec - root root system -- /system/bin/init.fugu.countrycode.sh on post-fs # Performance tweaks for interactive governor diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 6aad98b..51dcf70 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -32,3 +32,5 @@ /sys/kernel/debug/pvr/pid(/.*)? u:object_r:gpu_pid_stats_file:s0 /sys/kernel/debug/ion/heaps u:object_r:gpu_pid_stats_file:s0 + +/system/bin/init\.fugu\.countrycode\.sh u:object_r:init-fugu-countrycode-sh_exec:s0 diff --git a/sepolicy/init-fugu-countrycode-sh.te b/sepolicy/init-fugu-countrycode-sh.te new file mode 100644 index 0000000..fd4948a --- /dev/null +++ b/sepolicy/init-fugu-countrycode-sh.te @@ -0,0 +1,13 @@ +type init-fugu-countrycode-sh, domain; +type init-fugu-countrycode-sh_exec, exec_type, file_type; + +init_daemon_domain(init-fugu-countrycode-sh) + +allow init-fugu-countrycode-sh shell_exec:file rx_file_perms; + +# execute toybox/toolbox +allow init-fugu-countrycode-sh toolbox_exec:file rx_file_perms; + +set_prop(init-fugu-countrycode-sh, countrycode_prop) +allow init-fugu-countrycode-sh efs_file:file { open read }; +allow init-fugu-countrycode-sh efs_file:dir search; diff --git a/sepolicy/property.te b/sepolicy/property.te index 9900854..9c3fefe 100644 --- a/sepolicy/property.te +++ b/sepolicy/property.te @@ -1 +1,2 @@ type hdmi_prop, property_type; +type countrycode_prop, property_type; diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts index 4f4d81c..e01d936 100644 --- a/sepolicy/property_contexts +++ b/sepolicy/property_contexts @@ -1 +1,2 @@ -persist.hdmi. u:object_r:hdmi_prop:s0 +persist.hdmi. u:object_r:hdmi_prop:s0 +ro.boot.wificountrycode u:object_r:countrycode_prop:s0 diff --git a/sepolicy/shell.te b/sepolicy/shell.te index 62ae1bd..2800c68 100644 --- a/sepolicy/shell.te +++ b/sepolicy/shell.te @@ -2,3 +2,4 @@ allow shell efs_file:dir search; allow shell efs_file:file r_file_perms; allow shell bluetooth_efs_file:dir search; allow shell bluetooth_efs_file:file r_file_perms; +get_prop(shell, countrycode_prop) diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te index 4ecd0ae..03b58b9 100644 --- a/sepolicy/system_server.te +++ b/sepolicy/system_server.te @@ -8,3 +8,6 @@ allow system_server surfaceflinger:fifo_file rw_file_perms; # Allow system server to probe GPU memory statistics files (memtrack HAL) allow system_server gpu_pid_stats_file:dir r_dir_perms; allow system_server gpu_pid_stats_file:file r_file_perms; + +# Wifi country code +get_prop(system_server, countrycode_prop) |