-
Notifications
You must be signed in to change notification settings - Fork 6
/
install.sh
63 lines (45 loc) · 1.87 KB
/
install.sh
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
#!/bin/bash
set -Eeuo pipefail
shopt -s inherit_errexit
cd "/home/pi/" # best way to ensure this is a Pi lol
mkdir -p "/home/pi/.picsi/bins/" && cd "$_"
KERNEL_VERSION=$(uname -r)
# Latest Raspi OS uses 64-bit kernel, but 32-bit userland
# So we install 32-bit binaries and edit /boot/config.txt
# to use 32-bit kernel. So many hacks.
if [ "$KERNEL_VERSION" = "6.1.21-v8+" ]; then
KERNEL_VERSION="6.1.21-v7l+"
echo "NOTE: editing /boot/config.txt to use 32-bit kernel."
# Force load 32-bit kernel. Requires reboot.
echo "arm_64bit=0" | sudo tee -a /boot/config.txt > /dev/null
fi
# Download and extract binaries
if ! wget "https://github.com/nexmonster/nexmon_csi_bin/raw/main/base/$KERNEL_VERSION.tar.xz"; then
echo "Pre-compiled binaries probably don't exist for your kernel's version: $KERNEL_VERSION."
echo "Please create a new Issue on Github and tell us which kernel you are using."
exit
fi
tar -xvJf "$KERNEL_VERSION.tar.xz" && cd "$KERNEL_VERSION"
# install nexutil
ln -s "$PWD/nexutil/nexutil" "/usr/local/bin/nexutil"
# install makecsiparams
ln -s "$PWD/makecsiparams/makecsiparams" "/usr/local/bin/mcp"
ln -s "$PWD/makecsiparams/makecsiparams" "/usr/local/bin/makecsiparams"
# install firmware and driver
cp "$PWD/patched/brcmfmac43455-sdio.bin" "/lib/firmware/brcm/brcmfmac43455-sdio.bin"
cp "$PWD/patched/brcmfmac.ko" "$(modinfo brcmfmac -n)"
depmod -a
# Unblock wifi
rfkill unblock all
# Set WiFi country and expand storage
raspi-config nonint do_wifi_country US || true
raspi-config nonint do_expand_rootfs || true
# Install tcpdump
apt update -y
apt install -y tcpdump
# disable wpa_supplicant
printf "denyinterfaces wlan0\\ninterface wlan0\\n\\tnohook wpa_supplicant\\n" >> /etc/dhcpcd.conf
killall "wpa_supplicant"
systemctl disable --now wpa_supplicant
apt remove -y wpasupplicant
echo "Done. Please reboot and see the Usage section for Nexmon_csi."