From 7ab67b18c676e655ffe73d2cefff7dcd075553b2 Mon Sep 17 00:00:00 2001 From: Chirayu Desai Date: Sat, 20 Feb 2016 18:33:33 +0530 Subject: Build and use macaddrsetup Change-Id: I6f81296829673f66bcb27f444945b9bddd54929c This fixes random mac adress at boot --- rootdir/init.qcom.rc | 5 +++++ sepolicy/file.te | 6 +++++- sepolicy/file_contexts | 4 ++++ shinano.mk | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/rootdir/init.qcom.rc b/rootdir/init.qcom.rc index ebcab1f..14b3187 100644 --- a/rootdir/init.qcom.rc +++ b/rootdir/init.qcom.rc @@ -436,6 +436,11 @@ service qmuxd /system/bin/qmuxd user root group radio audio bluetooth gps nfc diag wakelock qcom_diag +# Wi-Fi and BT MAC addresses +service macaddrsetup /system/bin/macaddrsetup /sys/devices/platform/bcmdhd_wlan/macaddr + class late_start + user root + oneshot service netmgrd /system/bin/netmgrd class main diff --git a/sepolicy/file.te b/sepolicy/file.te index da08fbe..b6d4289 100644 --- a/sepolicy/file.te +++ b/sepolicy/file.te @@ -1,5 +1,4 @@ type sysfs_vibrator, fs_type, sysfs_type; - # TAD type secd_socket, file_type; type secd_data_file, file_type; @@ -10,3 +9,8 @@ type iddd_file, file_type, data_file_type; # BRCM BT FM type brcm_ldisc_sysfs, sysfs_type, fs_type; type brcm_uim_exec, exec_type, file_type; + +# macaddrsetup +type sysfs_wlanmac, fs_type, sysfs_type; + + diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 3c1a1d8..f4ce42c 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -49,3 +49,7 @@ #cam_socket /data/misc/camera(/.*) u:object_r:camera_data_file:s0 /dev/block/mmcblk0p1 u:object_r:tad_block_device:s0 + +# macaddrsetup +/sys/devices/platform/bcmdhd_wlan/macaddr u:object_r:sysfs_wlanmac:s0 + diff --git a/shinano.mk b/shinano.mk index 6cc82a8..a6a5612 100644 --- a/shinano.mk +++ b/shinano.mk @@ -107,6 +107,10 @@ PRODUCT_COPY_FILES += \ $(COMMON_PATH)/rootdir/system/usr/keylayout/mhl-rcp.kl:system/usr/keylayout/mhl-rcp.kl \ $(COMMON_PATH)/rootdir/system/usr/keylayout/msm8974-taiko-mtp-snd-card_Button_Jack.kl:system/usr/keylayout/msm8974-taiko-mtp-snd-card_Button_Jack.kl +# MAC address - BT and Wi-Fi +PRODUCT_PACKAGES += \ + macaddrsetup + # NFC PRODUCT_PACKAGES += \ NfcNci \ -- cgit v1.2.3