[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#748679: Add autoconfiguration script for live-config



Package: broadcom-sta-dkms
Version: 6.30.223.141-1
Severity: wishlist
Tags: patch

Hi

Currently broadcom-sta-dkms just blacklists the free drivers
unconditionally. This is OK on a normal system, but a problem for live
systems intended to be used on a wide range of hardware. There the
blacklisting should be based on the actual hardware configuration
present.

The attached patch adds a script for live-config to the
broadcom-sta-dkms package. This script uses a list of PCI IDs where the
broadcom-sta driver should be used. If any of these devices are present,
the blacklisting entries are uncommented, otherwise they are commented
out. The ID list in the patch is based on the list of supported devices
in the broadcom sta README file. I commented out one ID where the driver
did not work and the free driver works just fine.

I only implemented this for broadcom-sta-dkms, but not for
broadcom-sta-common. But AFAICS the same approach could be used there.
But I'don't use this package, so I could not test it.

I implemented the packaging changes in the way that seemd most aligned
with the current rules file. But if you prefer using more debhelper
magic and a *.dirs and *.install file would be possible too.

Gaudenz

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (800, 'testing'), (700, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_CH.utf8, LC_CTYPE=de_CH.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages broadcom-sta-dkms depends on:
ii  dkms  2.2.0.3-1.2

Versions of packages broadcom-sta-dkms recommends:
ii  wireless-tools  30~pre9-8

broadcom-sta-dkms suggests no packages.

-- no debconf information
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-19 16:35:15.983936860 +0200
@@ -0,0 +1,26 @@
+#!/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
+	sed -ie 's/^# *blacklist/blacklist/' ${BLACKLIST}
+else
+	# comment out all blacklist entries
+	sed -ie 's/^ *blacklist/# blacklist/' ${BLACKLIST}
+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-05-19 16:12:58.606625696 +0200
@@ -0,0 +1,18 @@
+14e44311
+14e44312
+14e44313
+14e44315
+14e44727
+# 14e44328 At least on a MacBook Air (MacBookAir2,1) this device is not supported by broadcom-sta
+14e44329
+14e4432a
+14e4432b
+14e4432c
+14e4432d
+14e44365
+14e44353
+14e44357
+14e44358
+14e44359
+14e44331
+14e443a0
diff -Nru broadcom-sta-6.30.223.141.orig/debian/changelog broadcom-sta-6.30.223.141/debian/changelog
--- broadcom-sta-6.30.223.141.orig/debian/changelog	2013-09-17 07:02:50.000000000 +0200
+++ broadcom-sta-6.30.223.141/debian/changelog	2014-05-19 16:38:36.077475863 +0200
@@ -1,3 +1,9 @@
+broadcom-sta (6.30.223.141-1+lernstick1~bpo70+1) lernstick; urgency=medium
+
+  * Add autoconfiguration script for live-config
+
+ -- Gaudenz Steinlin <gaudenz@debian.org>  Mon, 19 May 2014 16:23:42 +0200
+
 broadcom-sta (6.30.223.141-1) unstable; urgency=low
 
   * New upstream release (Yeah!) (Closes: #688823).
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-19 16:17:55.106909489 +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)

Reply to: