From 24aaa91df1857780badaf5e2089619ce5ede5e09 Mon Sep 17 00:00:00 2001 From: Giovanni Grieco Date: Sun, 9 Dec 2018 10:57:56 +0100 Subject: [PATCH] First commit --- README.md | 31 +++++++++++++++++++++++++++++++ broadcom.service | 16 ++++++++++++++++ broadcomctl | 34 ++++++++++++++++++++++++++++++++++ install.sh | 12 ++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 README.md create mode 100644 broadcom.service create mode 100755 broadcomctl create mode 100644 install.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..1abc06f --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Broadcom BCM43602 workaround + +This is a quick and dirty trick to take control of this misbehaving network +card. + +Scripts are tested on Fedora 29. If you have any problems, please file an issue +here or via email at _corsaro [AT] fedoraproject [DOT] com_. + +Note that I did not want to package this workaround because it's, well, _dirty_. +It does not fix the problem, just makes things bearable. + +## Install +``` +# ./install.sh +``` + +## Control the service +``` +# systemctl start broadcom +# systemctl stop broadcom +# systemctl restart broadcom +``` + +## Uninstall +``` +# systemctl stop broadcom +# systemctl disable broadcom +# rm /usr/local/bin/broadcomctl +# rm /etc/systemd/system/broadcom.service +``` + diff --git a/broadcom.service b/broadcom.service new file mode 100644 index 0000000..82f7892 --- /dev/null +++ b/broadcom.service @@ -0,0 +1,16 @@ +[Unit] +Description=bring up Broadcom network connectivity + +# make sure we run it as late as possible +After=wpa-supplicant.service + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/broadcomctl start +ExecStop=/usr/local/bin/broadcomctl stop +ExecReload=/usr/local/bin/broadcomctl restart +RemainAfterExit=yes + +[Install] +WantedBy=graphical.target + diff --git a/broadcomctl b/broadcomctl new file mode 100755 index 0000000..37063a3 --- /dev/null +++ b/broadcomctl @@ -0,0 +1,34 @@ +#!/usr/bin/bash + +start_service() { + echo "Adding brcmfmac" + modprobe brcmfmac || exit -1 + sleep 3 + echo "Turning radio on" + nmcli radio wifi on || exit -2 +} + +stop_service() { + echo "Turning radio off" + nmcli radio wifi off || exit -1 + sleep 3 + echo "Removing brcmfmac" + modprobe -rf brcmfmac || exit -2 +} + +case $1 in + start) + start_service $1 + ;; + stop) + stop_service $1 + ;; + restart) + stop_service $1 + sleep 3 + start_service $1 + ;; +esac + +exit 0 + diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..f0684ee --- /dev/null +++ b/install.sh @@ -0,0 +1,12 @@ +#!/usr/bin/bash + +if [ "$EUID" -ne 0 ]; then + echo "Please give me the root power!" + exit 1 +fi + +cp broadcomctl /usr/local/bin/ +cp broadcom.service /etc/systemd/system/ + +systemctl daemon-reload +systemctl enable broadcom