From 6df37ecfba588b61bf873ffe933034fb6da5368c Mon Sep 17 00:00:00 2001 From: Davide Garberi Date: Wed, 15 May 2019 23:15:09 +0200 Subject: msm8996-common: Remove wcg_mac_tool * Turns out we don't actually need to use this as /proc/mac_wifi and mac_bt can turn into normal mac address values just with hex dumping * Remove bt_mac_prop as we can just set the mac path in vendor_prop.mk Change-Id: I23665cdd5d39d5e090694cff5a63f55ecb9ea334 --- proprietary-files.txt | 3 --- rootdir/bin/init.bt.sh | 8 +++++--- rootdir/bin/init.wlan.sh | 4 ++-- rootdir/etc/init.qcom.rc | 8 -------- sepolicy/file_contexts | 1 - sepolicy/hal_bluetooth_qti.te | 2 -- sepolicy/property.te | 2 -- sepolicy/property_contexts | 19 ------------------- sepolicy/qti_init_shell.te | 2 -- sepolicy/shell.te | 1 - sepolicy/system_app.te | 1 - sepolicy/wcg_mac.te | 10 ---------- vendor_prop.mk | 3 ++- 13 files changed, 9 insertions(+), 55 deletions(-) delete mode 100644 sepolicy/shell.te delete mode 100644 sepolicy/wcg_mac.te diff --git a/proprietary-files.txt b/proprietary-files.txt index f620698..02cd70a 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -694,9 +694,6 @@ vendor/etc/init/vendor.qti.hardware.tui_comm@1.0-service-qti.rc|2cfc563d7e157937 vendor/lib/vendor.qti.hardware.tui_comm@1.0.so|df42c8c69f67adeecd682a3035bf8d2b5834cd25 vendor/lib64/vendor.qti.hardware.tui_comm@1.0.so|5a794cd2180fc27d7a03d990e852f6600daf4b7f -# wcg_mac_tool --sbin/wcg_mac_tool:vendor/bin/wcg_mac_tool|390a5a2425fab861c753743b1df3808acb1ee7d6 - # Widevine DRM - from daisy 9/PKQ1.180917.001/V10.0.7.0.PDLMIXM vendor/bin/hw/android.hardware.drm@1.1-service.widevine|9743c4ecd0fb8773795bcbfbb406f25616c04129 vendor/etc/init/android.hardware.drm@1.1-service.widevine.rc|458dd241f5f8536eccb57f012b3eba0061736e8e diff --git a/rootdir/bin/init.bt.sh b/rootdir/bin/init.bt.sh index 63ea643..ad4b03e 100644 --- a/rootdir/bin/init.bt.sh +++ b/rootdir/bin/init.bt.sh @@ -17,9 +17,11 @@ # # Set the proper hardware based BT mac address +bt_mac=$(xxd -p /proc/mac_bt | tr '[:lower:]' '[:upper:]' | sed 's/.\{2\}/&:/g' | sed 's/.$//'); bt_mac_path="/data/vendor/bluetooth/bdaddr" -bt_mac=$(getprop sys.bt.address); -if [[ ! -f $bt_mac_path ]] || [[ $(echo $bt_mac) != $(cat /data/vendor/bluetooth/bdaddr) ]]; then +if [[ ! -f $bt_mac_path ]] || [[ $(echo $bt_mac) != $(cat $bt_mac_path) ]]; then echo $bt_mac > $bt_mac_path + chmod 0644 $bt_mac_path + chown bluetooth $bt_mac_path + chgrp bluetooth $bt_mac_path fi; -setprop ro.vendor.bt.bdaddr_path $bt_mac_path diff --git a/rootdir/bin/init.wlan.sh b/rootdir/bin/init.wlan.sh index 36c0430..6036a75 100644 --- a/rootdir/bin/init.wlan.sh +++ b/rootdir/bin/init.wlan.sh @@ -17,8 +17,8 @@ # # Set the proper hardware based wlan mac -if [[ ! -f /persist/wlan_mac.bin ]] || [[ $(cat /persist/wlan_mac.bin | grep Intf0MacAddress | sed 's/Intf0MacAddress=//') != $(getprop sys.wifimac | sed 's/://g') ]]; then - wifi_mac=$(getprop sys.wifimac | sed 's/://g'); +wifi_mac=$(xxd -p /proc/mac_wifi | tr '[:lower:]' '[:upper:]'); +if [[ ! -f /persist/wlan_mac.bin ]] || [[ $(cat /persist/wlan_mac.bin | grep Intf0MacAddress | sed 's/Intf0MacAddress=//') != $(echo $wifi_mac) ]]; then echo "Intf0MacAddress=$wifi_mac END" > /persist/wlan_mac.bin fi; diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index b197f87..b21bb77 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -573,13 +573,6 @@ service vendor.ppd /vendor/bin/mm-pp-dpps disabled writepid /dev/cpuset/system-background/tasks -service wcg_mac_tool /vendor/bin/wcg_mac_tool - class late_start - group root - user root - disabled - oneshot - service wlan-sh /vendor/bin/init.wlan.sh class late_start user root @@ -595,7 +588,6 @@ service bt-sh /vendor/bin/init.bt.sh oneshot on property:sys.boot_completed=1 - start wcg_mac_tool start wlan-sh start bt-sh diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index d8e2011..6b76d4e 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -1,7 +1,6 @@ # Binaries /(vendor|system/vendor)/bin/init.bt.sh u:object_r:qti_init_shell_exec:s0 /(vendor|system/vendor)/bin/init.wlan.sh u:object_r:qti_init_shell_exec:s0 -/(vendor|system/vendor)/bin/wcg_mac_tool u:object_r:wcg_mac_exec:s0 # Bluetooth /sys/devices/vendor/vendor:bt_qca6174/extldo u:object_r:sysfs_bluetooth_writable:s0 diff --git a/sepolicy/hal_bluetooth_qti.te b/sepolicy/hal_bluetooth_qti.te index ebed0fb..429585f 100644 --- a/sepolicy/hal_bluetooth_qti.te +++ b/sepolicy/hal_bluetooth_qti.te @@ -1,3 +1 @@ allow hal_bluetooth_qti sysfs_bluetooth_writable:file rw_file_perms; - -get_prop(hal_bluetooth_qti, bt_mac_prop) diff --git a/sepolicy/property.te b/sepolicy/property.te index e77394a..9520846 100644 --- a/sepolicy/property.te +++ b/sepolicy/property.te @@ -1,3 +1 @@ -type wcg_prop, property_type; type oem_unlock_prop, property_type; -type bt_mac_prop, property_type; diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts index ed4d762..a472b82 100644 --- a/sepolicy/property_contexts +++ b/sepolicy/property_contexts @@ -1,6 +1,3 @@ -# Bluetooth -ro.vendor.bt.bdaddr_path u:object_r:bt_mac_prop:s0 - # Camera persist.camera. u:object_r:camera_prop:s0 @@ -9,19 +6,3 @@ ro.oem_unlock_supported u:object_r:oem_unlock_prop:s0 # Qseecomd sys.listeners.registered u:object_r:vendor_tee_listener_prop:s0 - -# WCG -sys.wifimac u:object_r:wcg_prop:s0 -sys.bt.address u:object_r:wcg_prop:s0 -persist.bt.max.hs.connections u:object_r:wcg_prop:s0 -gsm.sn1 u:object_r:wcg_prop:s0 -sys.customsn.showcode u:object_r:wcg_prop:s0 -cdma.meid u:object_r:wcg_prop:s0 -gsm.imei1 u:object_r:wcg_prop:s0 -gsm.imei2 u:object_r:wcg_prop:s0 -persist.cdma.meid u:object_r:wcg_prop:s0 -persist.gsm.imei1 u:object_r:wcg_prop:s0 -persist.gsm.imei2 u:object_r:wcg_prop:s0 -gsm.hwid u:object_r:wcg_prop:s0 -gsm.station u:object_r:wcg_prop:s0 -persist.gsm.qlogd.on u:object_r:wcg_prop:s0 diff --git a/sepolicy/qti_init_shell.te b/sepolicy/qti_init_shell.te index 1331cc4..dbdc893 100644 --- a/sepolicy/qti_init_shell.te +++ b/sepolicy/qti_init_shell.te @@ -12,6 +12,4 @@ allow qti_init_shell vendor_bt_data_file:file { create getattr open read write } # Allow qti_init_shell to read cmdline allow qti_init_shell proc_cmdline:file { getattr open read }; -get_prop(qti_init_shell, wcg_prop) set_prop(qti_init_shell, oem_unlock_prop) -set_prop(qti_init_shell, bt_mac_prop) diff --git a/sepolicy/shell.te b/sepolicy/shell.te deleted file mode 100644 index df6b670..0000000 --- a/sepolicy/shell.te +++ /dev/null @@ -1 +0,0 @@ -get_prop(shell, wcg_prop) diff --git a/sepolicy/system_app.te b/sepolicy/system_app.te index 0fbc30e..1158907 100644 --- a/sepolicy/system_app.te +++ b/sepolicy/system_app.te @@ -4,4 +4,3 @@ allow system_app shell_prop:property_service set; binder_call(system_app, wificond); get_prop(system_app, oem_unlock_prop); -get_prop(system_app, bt_mac_prop); diff --git a/sepolicy/wcg_mac.te b/sepolicy/wcg_mac.te deleted file mode 100644 index 2e8ec94..0000000 --- a/sepolicy/wcg_mac.te +++ /dev/null @@ -1,10 +0,0 @@ -type wcg_mac, domain; -type wcg_mac_exec, exec_type, vendor_file_type, file_type; - -# Allow for transition from init domain to wcg_mac -init_daemon_domain(wcg_mac) - -# Allow wcg_mac to set sys.wifimac -set_prop(wcg_mac, wcg_prop) - -allow wcg_mac proc:file { open read }; diff --git a/vendor_prop.mk b/vendor_prop.mk index 9e7c282..cf1f711 100644 --- a/vendor_prop.mk +++ b/vendor_prop.mk @@ -45,7 +45,8 @@ PRODUCT_PROPERTY_OVERRIDES += \ ro.btconfig.if=uart \ ro.btconfig.vendor=qcom \ ro.btconfig.chip=QCA6164 \ - ro.btconfig.dev=/dev/ttyHS0 + ro.btconfig.dev=/dev/ttyHS0 \ + ro.vendor.bt.bdaddr_path=/data/vendor/bluetooth/bdaddr # Camera PRODUCT_PROPERTY_OVERRIDES += \ -- cgit v1.2.3