From e69a94166337f984e099bbaefba834994f23014d Mon Sep 17 00:00:00 2001 From: amazingfate Date: Sun, 12 Jun 2016 11:28:12 +0800 Subject: [PATCH 1/9] add fix script for bcm4313 --- system/bcm4313/README.md | 34 +++++++++++++++++++++++++++ system/bcm4313/README.zh.md | 34 +++++++++++++++++++++++++++ system/bcm4313/fix | 47 +++++++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 system/bcm4313/README.md create mode 100644 system/bcm4313/README.zh.md create mode 100755 system/bcm4313/fix diff --git a/system/bcm4313/README.md b/system/bcm4313/README.md new file mode 100644 index 0000000..bcad317 --- /dev/null +++ b/system/bcm4313/README.md @@ -0,0 +1,34 @@ +# Check wrong kernel module blacklist for bcm4313 + +Check wrong kernel module blacklist for bcm4313 + +# How to check? + +check pci of bcm4313 + +``` +check () +{ + local pci_info="$(lspci -d "14e4:4727" 2>/dev/null)"; + if [ "${pci_info}" ]; then + return 1; + fi +} +``` + +# How to fix? + +1, blacklist kernel module b43 and wl +2, remove package bcmwl-kernel-source + +``` +fix () +{ + echo "fix bcm4313 --------------------------------"; + echo "blacklist b43" | sudo tee -a /etc/modprobe.d/bcm.conf; + echo "blacklist wl" | sudo tee -a /etc/modprobe.d/bcm.conf; + echo "brcmsmac" | sudo tee -a /etc/modules; + sudo apt-get remove -y bcmwl-kernel-source; + exit 0 +} +``` diff --git a/system/bcm4313/README.zh.md b/system/bcm4313/README.zh.md new file mode 100644 index 0000000..4c385d3 --- /dev/null +++ b/system/bcm4313/README.zh.md @@ -0,0 +1,34 @@ +# bcm4313网卡中内核模块被错误屏蔽 + +bcm4313网卡中内核模块被错误屏蔽 + +# 如何检查? + +通过pci检查是否有bcm4313网卡 + +``` +check () +{ + local pci_info="$(lspci -d "14e4:4727" 2>/dev/null)"; + if [ "${pci_info}" ]; then + return 1; + fi +} +``` + +# 如何修复? + +1, 屏蔽掉b43和wl模块 +2, 删除软件包bcmwl-kernel-source + +``` +fix () +{ + echo "fix bcm4313 --------------------------------"; + echo "blacklist b43" | sudo tee -a /etc/modprobe.d/bcm.conf; + echo "blacklist wl" | sudo tee -a /etc/modprobe.d/bcm.conf; + echo "brcmsmac" | sudo tee -a /etc/modules; + sudo apt-get remove -y bcmwl-kernel-source; + exit 0 +} +``` diff --git a/system/bcm4313/fix b/system/bcm4313/fix new file mode 100755 index 0000000..c22d6a4 --- /dev/null +++ b/system/bcm4313/fix @@ -0,0 +1,47 @@ +#!/bin/bash +source ../../functions + +META[AUTHOR]="Jianfeng Liu" +META[AUTO_CHECK]=false +META[AUTO_FIX]=false +META[VALIDATE_UNTIL]="2016-11-2" + +COMMENT description </dev/null)" + if [ "${pci_info}" ]; then + return 1 + fi +} + +COMMENT fix < Date: Sun, 12 Jun 2016 14:11:43 +0800 Subject: [PATCH 2/9] bcm4313:change directory --- system/{ => driver}/bcm4313/README.md | 0 system/{ => driver}/bcm4313/README.zh.md | 0 system/{ => driver}/bcm4313/fix | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename system/{ => driver}/bcm4313/README.md (100%) rename system/{ => driver}/bcm4313/README.zh.md (100%) rename system/{ => driver}/bcm4313/fix (100%) diff --git a/system/bcm4313/README.md b/system/driver/bcm4313/README.md similarity index 100% rename from system/bcm4313/README.md rename to system/driver/bcm4313/README.md diff --git a/system/bcm4313/README.zh.md b/system/driver/bcm4313/README.zh.md similarity index 100% rename from system/bcm4313/README.zh.md rename to system/driver/bcm4313/README.zh.md diff --git a/system/bcm4313/fix b/system/driver/bcm4313/fix similarity index 100% rename from system/bcm4313/fix rename to system/driver/bcm4313/fix From 010f8e36985d052e85602c7ee09193bf6d2f1758 Mon Sep 17 00:00:00 2001 From: amazingfate Date: Sun, 12 Jun 2016 14:30:00 +0800 Subject: [PATCH 3/9] fix when brcmsmac is not in use --- system/driver/bcm4313/fix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/driver/bcm4313/fix b/system/driver/bcm4313/fix index c22d6a4..7989469 100755 --- a/system/driver/bcm4313/fix +++ b/system/driver/bcm4313/fix @@ -22,7 +22,9 @@ function check() { local pci_info="$(lspci -d "14e4:4727" 2>/dev/null)" if [ "${pci_info}" ]; then - return 1 + if [ lsmod|grep brcmsmac ]; then + return 1 + fi fi } From 7f5c47744d74334da3a05047b911a7b0901765c5 Mon Sep 17 00:00:00 2001 From: amazingfate Date: Sun, 12 Jun 2016 14:38:37 +0800 Subject: [PATCH 4/9] change function directory --- system/driver/bcm4313/fix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/driver/bcm4313/fix b/system/driver/bcm4313/fix index 7989469..25b187d 100755 --- a/system/driver/bcm4313/fix +++ b/system/driver/bcm4313/fix @@ -1,5 +1,5 @@ #!/bin/bash -source ../../functions +source ../../../functions META[AUTHOR]="Jianfeng Liu" META[AUTO_CHECK]=false From ba204bd58a5a6da6bfe8dfc5c5d52bbb196fcb16 Mon Sep 17 00:00:00 2001 From: amazingfate Date: Sun, 12 Jun 2016 14:44:15 +0800 Subject: [PATCH 5/9] change if condition --- system/driver/bcm4313/fix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/driver/bcm4313/fix b/system/driver/bcm4313/fix index 25b187d..484f61a 100755 --- a/system/driver/bcm4313/fix +++ b/system/driver/bcm4313/fix @@ -22,7 +22,7 @@ function check() { local pci_info="$(lspci -d "14e4:4727" 2>/dev/null)" if [ "${pci_info}" ]; then - if [ lsmod|grep brcmsmac ]; then + if ! [ lsmod|grep brcmsmac ]; then return 1 fi fi From 2d84593ddc259ea54368a76c34f8ab903027708b Mon Sep 17 00:00:00 2001 From: amazingfate Date: Sun, 12 Jun 2016 15:26:42 +0800 Subject: [PATCH 6/9] change check condition --- system/driver/bcm4313/fix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/driver/bcm4313/fix b/system/driver/bcm4313/fix index 484f61a..8998927 100755 --- a/system/driver/bcm4313/fix +++ b/system/driver/bcm4313/fix @@ -22,7 +22,7 @@ function check() { local pci_info="$(lspci -d "14e4:4727" 2>/dev/null)" if [ "${pci_info}" ]; then - if ! [ lsmod|grep brcmsmac ]; then + if ! lsmod|grep brcmsmac ; then return 1 fi fi From ae58c047fe94b1652a32ccef2879aacc8c85d115 Mon Sep 17 00:00:00 2001 From: amazingfate Date: Sun, 12 Jun 2016 15:35:50 +0800 Subject: [PATCH 7/9] bcm4313: update documents --- system/driver/bcm4313/README.md | 4 +++- system/driver/bcm4313/README.zh.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/system/driver/bcm4313/README.md b/system/driver/bcm4313/README.md index bcad317..66caef4 100644 --- a/system/driver/bcm4313/README.md +++ b/system/driver/bcm4313/README.md @@ -11,7 +11,9 @@ check () { local pci_info="$(lspci -d "14e4:4727" 2>/dev/null)"; if [ "${pci_info}" ]; then - return 1; + if ! lsmod | grep brcmsmac; then + return 1; + fi; fi } ``` diff --git a/system/driver/bcm4313/README.zh.md b/system/driver/bcm4313/README.zh.md index 4c385d3..b84407f 100644 --- a/system/driver/bcm4313/README.zh.md +++ b/system/driver/bcm4313/README.zh.md @@ -11,7 +11,9 @@ check () { local pci_info="$(lspci -d "14e4:4727" 2>/dev/null)"; if [ "${pci_info}" ]; then - return 1; + if ! lsmod | grep brcmsmac; then + return 1; + fi; fi } ``` From 1a02d76c784ffc387e7b5bd9ca4ab0ed1456a381 Mon Sep 17 00:00:00 2001 From: amazingfate Date: Mon, 13 Jun 2016 09:42:55 +0800 Subject: [PATCH 8/9] update Readme --- system/driver/bcm4313/README.md | 4 +++- system/driver/bcm4313/README.zh.md | 4 +++- system/driver/bcm4313/fix | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/system/driver/bcm4313/README.md b/system/driver/bcm4313/README.md index 66caef4..2cdfdc1 100644 --- a/system/driver/bcm4313/README.md +++ b/system/driver/bcm4313/README.md @@ -4,7 +4,9 @@ Check wrong kernel module blacklist for bcm4313 # How to check? -check pci of bcm4313 +1, check pci of bcm4313 + +2, check whether brcmsmac is in use ``` check () diff --git a/system/driver/bcm4313/README.zh.md b/system/driver/bcm4313/README.zh.md index b84407f..5980bba 100644 --- a/system/driver/bcm4313/README.zh.md +++ b/system/driver/bcm4313/README.zh.md @@ -4,7 +4,9 @@ bcm4313网卡中内核模块被错误屏蔽 # 如何检查? -通过pci检查是否有bcm4313网卡 +1, 通过pci检查是否有bcm4313网卡 + +2, 检查brcmsmac模块是否在使用 ``` check () diff --git a/system/driver/bcm4313/fix b/system/driver/bcm4313/fix index 8998927..dc3987f 100755 --- a/system/driver/bcm4313/fix +++ b/system/driver/bcm4313/fix @@ -13,10 +13,14 @@ COMMENT zh description < Date: Mon, 13 Jun 2016 09:45:40 +0800 Subject: [PATCH 9/9] update Readme --- system/driver/bcm4313/README.md | 1 + system/driver/bcm4313/README.zh.md | 1 + system/driver/bcm4313/fix | 2 ++ 3 files changed, 4 insertions(+) diff --git a/system/driver/bcm4313/README.md b/system/driver/bcm4313/README.md index 2cdfdc1..b127bc5 100644 --- a/system/driver/bcm4313/README.md +++ b/system/driver/bcm4313/README.md @@ -23,6 +23,7 @@ check () # How to fix? 1, blacklist kernel module b43 and wl + 2, remove package bcmwl-kernel-source ``` diff --git a/system/driver/bcm4313/README.zh.md b/system/driver/bcm4313/README.zh.md index 5980bba..c922e1c 100644 --- a/system/driver/bcm4313/README.zh.md +++ b/system/driver/bcm4313/README.zh.md @@ -23,6 +23,7 @@ check () # 如何修复? 1, 屏蔽掉b43和wl模块 + 2, 删除软件包bcmwl-kernel-source ``` diff --git a/system/driver/bcm4313/fix b/system/driver/bcm4313/fix index dc3987f..0eabad4 100755 --- a/system/driver/bcm4313/fix +++ b/system/driver/bcm4313/fix @@ -34,10 +34,12 @@ function check() COMMENT fix <