aboutsummaryrefslogtreecommitdiff
path: root/prebuilt/bin/fix-mac.sh
blob: b02c5444048f9ebaac660b92e09d8dc043020b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/system/bin/sh

PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
ORIG_NVS_BIN=/system/etc/firmware/ti-connectivity/wl1271-nvs_127x.bin
NVS_BIN=/system/etc/firmware/ti-connectivity/wl1271-nvs.bin

if [ ! -f "$NVS_BIN" ]; then
    mount -o remount,rw /system
    cp ${ORIG_NVS_BIN} ${NVS_BIN}
    calibrator set nvs_mac $NVS_BIN $(getprop ro.boot.wifimac | bbx sed 's/../&:/g;s/:$//')
    chmod 644 ${NVS_BIN}
    mount -o remount,ro /system
fi