-
Notifications
You must be signed in to change notification settings - Fork 8
/
pbp-install-ap6256-firmware
executable file
·68 lines (57 loc) · 1.79 KB
/
pbp-install-ap6256-firmware
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
### Package: pbp-install-ap6256-firmware
### Version: v20200630.2300
### Author: Michael Gan "xmixahlx" [email protected]
### License: GPLv3
### Script Dependencies: linux
## PBPTOOLSDIR
if [ -z $PBPTOOLSDIR ]; then
PBPTOOLSDIR="`pwd`"
fi
## VARS
DATE=`date +%Y%m%d%H%M%S`
RESDIR=$PBPTOOLSDIR/resources
DEVDIR=$PBPTOOLSDIR/upstream
GITREPO=https://gitlab.manjaro.org/manjaro-arm/packages/community
GITTREE=ap6256-firmware
GITBRANCH=master
PKGDIR=$GITTREE\_$GITBRANCH
## OVERRIDE with GITCHECKOUT=master or other commit
if [ -z $GITCHECKOUT ];then
GITCHECKOUT=a30bf312b268eab42d38fab0cc3ed3177895ff5d
fi
echo "\n*** GITCHECKOUT selected is $GITCHECKOUT.\n"
## DEPS
# Provide INSTALLDEPS=debian to install dependencies.
if [ $INSTALLDEPS ]; then
if [ $INSTALLDEPS = debian ]; then
sudo apt-get -y install coreutils git
fi
fi
## PREP
set -e
mkdir -p $DEVDIR
cd $DEVDIR
## GIT
echo "\n*** GIT.\n"
[ -d $PKGDIR ] || git clone $GITREPO/$GITTREE.git --branch=$GITBRANCH $PKGDIR
cd $PKGDIR
git clean -f
git reset --hard HEAD
git pull origin $GITBRANCH
git checkout $GITCHECKOUT
## INSTALL
echo "\n*** INSTALLING.\n"
sudo mv -f /usr/lib/firmware/brcm /usr/lib/firmware/brcm-$DATE
sudo mkdir -p /usr/lib/firmware/brcm
sudo install -Dm644 "BCM4345C5.hcd" /usr/lib/firmware/brcm/
sudo install -Dm644 "nvram_ap6256.txt" /usr/lib/firmware/brcm/brcmfmac43456-sdio.txt
sudo install -Dm644 "fw_bcm43456c5_ag.bin" /usr/lib/firmware/brcm/brcmfmac43456-sdio.bin
sudo install -Dm644 "brcmfmac43456-sdio.clm_blob" /usr/lib/firmware/brcm/brcmfmac43456-sdio.clm_blob
sudo ln -s /usr/lib/firmware/brcm/brcmfmac43456-sdio.txt /usr/lib/firmware/brcm/brcmfmac43456-sdio.pine64,pinebook-pro.txt
## EXIT
echo "\n*** DONE."
exit
# ENJOY
# POST SCRIPT
# Manually delete /usr/lib/firmware/brcm-$DATE after confirmation of success.