File tree 1 file changed +55
-0
lines changed
1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ function pt_error()
4
+ {
5
+ echo -e " \033[1;31mERROR: $* \033[0m"
6
+ }
7
+
8
+ function pt_warn()
9
+ {
10
+ echo -e " \033[1;31mWARN: $* \033[0m"
11
+ }
12
+
13
+ function pt_info()
14
+ {
15
+ echo -e " \033[1;32mINFO: $* \033[0m"
16
+ }
17
+
18
+ function pt_ok()
19
+ {
20
+ echo -e " \033[1;33mOK: $* \033[0m"
21
+ }
22
+
23
+ if [ $UID -ne 0 ]
24
+ then
25
+ pt_error " Please run as root."
26
+ exit
27
+ fi
28
+ set -e
29
+ pt_info " Updating Wifi, please wait..."
30
+ dest=" /lib/firmware/ap6212/"
31
+ bt_fw=" /lib/firmware/ap6212/fw_bcm43438a1.bin"
32
+ if [ ! -f " $bt_fw " ]
33
+ then
34
+ pt_warn " Downloading fw wifi file..."
35
+ wget -q -O ${bt_fw} https://github.com/BPI-SINOVOIP/BPI_WiFi_Firmware/raw/master/ap6212/fw_bcm43438a1.bin
36
+ fi
37
+ bt_hcd=" /lib/firmware/ap6212/bcm43438a1.hcd"
38
+ if [ ! -f " $bt_hcd " ]
39
+ then
40
+ pt_warn " Donwloading hcd wifi file..."
41
+ wget -q -O ${bt_hcd} https://github.com/BPI-SINOVOIP/BPI_WiFi_Firmware/raw/master/ap6212/bcm43438a1.hcd
42
+ fi
43
+
44
+ pt_info " Updating Wifi services..."
45
+ sed -i -e ' s/bcm43438a0/bcm43438a1/g' /usr/local/bin/bpi-bt-patch
46
+ sync
47
+ sed -i -e ' s/bcm43438a0/bcm43438a1/g' /usr/local/bin/bpi-bt-on
48
+ sync
49
+ if [ ! -f " $bt_hcd " ]
50
+ then
51
+ pt_error " Could not download files, you have to do this manually!"
52
+ else
53
+ pt_ok " Wifi is now updated for the A1 chip!"
54
+ pt_ok " Now you should reboot, type: sudo reboot"
55
+ fi
You can’t perform that action at this time.
0 commit comments