Hi

I have an update to the patch in this bug report:
- further refinement of the PCI-IDs list. Removed all entries that
  should be supported by a free driver.
- Improvement to the script to blacklist the wl driver if a free driver
  is choosen. Otherwise the kernel tries to load both modules.

Daniel Baumann <daniel.baum...@progress-technologies.net> writes:

> clone 748679 -1
> retitle -1 add broadcom-sta autodetection
> reassign -1 live-config
> retitle 748679 provide a pci-id list
> thanks
>
> On 05/19/2014 05:24 PM, Gaudenz Steinlin wrote:
>> The attached patch adds a script for live-config to the
>> broadcom-sta-dkms package.
>
> the proper way to do this is to keep the live-config parts in
> live-config, and have broadcom-sta-common only provide a PCI-ID list of
> their supported devices in /usr/share/broadcom-sta/broadcom-sta.ids.

I disagree with this. This only creates a tight coupling between the
broadcom-sta and live-config packages. Having both the id list and the
script in the same package makes maintenance easier as changes affecting
both don't need coordination across packages and maintainers. IMO the
live-config packages offers a simple interface to have such scripts in
other packages (ie calling scripts in /lib/live/config in alphabetical
order).

But as I'm not the maintainer of either of the involved packages I don't
personally care much about the choosen solution. If you both agree that
spliting this over two packages is preferable, I won't oppose.

>
> i'll commit the script doing this for broadcom-sta like we already do
> for nvidia/fgrlx in live-config, it will be automatically active as soon
> as something provides above PCI-ID list file.

If you already commited this, please update the script with the one in
the version of the patch attached to this mail.

Gaudenz

diff -Nru broadcom-sta-6.30.223.141.orig/debian/1160-broadcom-sta broadcom-sta-6.30.223.141/debian/1160-broadcom-sta
--- broadcom-sta-6.30.223.141.orig/debian/1160-broadcom-sta	1970-01-01 01:00:00.000000000 +0100
+++ broadcom-sta-6.30.223.141/debian/1160-broadcom-sta	2014-05-30 23:38:06.673988046 +0200
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -e
+
+BLACKLIST=/etc/modprobe.d/broadcom-sta-dkms.conf
+ID_LIST=/usr/share/broadcom-sta/broadcom-sta.ids
+
+# Checking if package is installed
+[ -e /var/lib/dpkg/info/broadcom-sta-dkms.list ] || exit 0
+
+# without lspci this won't work
+[ -x /usr/bin/lspci ] || exit 0
+
+echo -n " broadcom-sta-dkms"
+
+# search for devices of pci class "network controller" subclass "network controller"
+_DEVICE="$(lspci -mn | awk '$2 == "\"0280\"" { gsub ("\"",""); print $3$4 }' | uniq)"
+
+if grep -qis "^[[:space:]]*${_DEVICE}[[:space:]]*$" ${ID_LIST}
+then
+	# uncomment all blacklist entries, remove wl blacklist
+	sed -i -e 's/^ *# *blacklist/blacklist/' -e 's/^ *blacklist wl *$//' ${BLACKLIST}
+else
+	# comment out all blacklist entries, blacklist wl
+	sed -i -e 's/^ *blacklist/# blacklist/' -e 's/^ *# *blacklist wl *$/blacklist wl/' ${BLACKLIST}
+    
+	# add blacklist for wl if not present
+	if ! grep -q '^ *blacklist wl *' ${BLACKLIST}
+	then
+		echo "blacklist wl" >> ${BLACKLIST}
+	fi
+fi
diff -Nru broadcom-sta-6.30.223.141.orig/debian/broadcom-sta.ids broadcom-sta-6.30.223.141/debian/broadcom-sta.ids
--- broadcom-sta-6.30.223.141.orig/debian/broadcom-sta.ids	1970-01-01 01:00:00.000000000 +0100
+++ broadcom-sta-6.30.223.141/debian/broadcom-sta.ids	2014-06-02 14:10:42.904242667 +0200
@@ -0,0 +1,20 @@
+# commented out devices are supported by a free driver according to 
+# http://wireless.kernel.org/en/users/Drivers/b43#Supported_devices
+# 14e44311 supported by b43
+# 14e44312 supported by b43
+14e44313
+# 14e44315 supported by b43
+14e44727
+# 14e44328 At least on a MacBook Air (MacBookAir2,1) this device is not supported by broadcom-sta
+# 14e44329 supported by b43/brcmfmac
+14e4432a
+14e4432b
+# 14e4432c supported by b43
+14e4432d
+# 14e44331 supported by b43
+# 14e44353 supported by b43/brcm80211
+# 14e44357 supported by b43/brcm80211
+14e44358
+14e44359
+14e44365
+14e443a0
diff -Nru broadcom-sta-6.30.223.141.orig/debian/rules broadcom-sta-6.30.223.141/debian/rules
--- broadcom-sta-6.30.223.141.orig/debian/rules	2013-09-17 06:44:23.000000000 +0200
+++ broadcom-sta-6.30.223.141/debian/rules	2014-05-28 16:50:57.932416222 +0200
@@ -12,6 +12,9 @@
 dkms_package    := $(source_name)-dkms
 dkms_target     := usr/src/$(source_name)-$(version)
 
+live_config_dir := lib/live/config
+live_config_script := 1160-broadcom-sta
+ids_dir         := usr/share/broadcom-sta
 
 %:
 	dh $@ --with dkms
@@ -27,8 +30,11 @@
 	cp i386/lib/wlc_hybrid.o_shipped debian/tmp/lib/wlc_hybrid.o_i386
 	
 install-dkms: install-tmp
-	dh_installdirs -p $(dkms_package) $(dkms_target)
+	dh_installdirs -p $(dkms_package) $(dkms_target) $(live_config_dir)
 	dh_install -p $(dkms_package) debian/tmp/* $(dkms_target)/
+	dh_install -p $(dkms_package) debian/$(live_config_script) $(live_config_dir)/
+	chmod +x debian/$(dkms_package)/$(live_config_dir)/$(live_config_script)
+	dh_install -p $(dkms_package) debian/broadcom-sta.ids $(ids_dir)/
 
 install-source: install-tmp
 	dh_installdirs -p $(source_package) $(source_target)
-- 
Ever tried. Ever failed. No matter.
Try again. Fail again. Fail better.
~ Samuel Beckett ~

Reply via email to