diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2016-06-21 01:02:16 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-06-21 01:02:16 +0000 |
commit | 189bbd0ddd08d0895f6582e86e3db7c37e580481 (patch) | |
tree | 97ca42d4d38203be9472f55996401498d0147ea4 | |
parent | 31562edccc319773099c3001fcc5e1067f0ca848 (diff) | |
parent | 2b6ca2416ccd39056974a20a9c94be2ee233d3f5 (diff) | |
download | fugu-189bbd0ddd08d0895f6582e86e3db7c37e580481.tar.gz |
Merge \"Fugu: set mfg country code at boot for Wifi\" into nyc-dev
am: 2b6ca2416c
Change-Id: Ia4ccec489e3426223f655bc4fc6711e572306b8c
-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) |