[debian-edu-commits] r78840 - trunk/src/hw-support-handler

pere at alioth.debian.org pere at alioth.debian.org
Tue Jan 22 20:34:03 UTC 2013


Author: pere
Date: 2013-01-22 20:34:03 +0000 (Tue, 22 Jan 2013)
New Revision: 78840

Removed:
   trunk/src/hw-support-handler/debian/
   trunk/src/hw-support-handler/discover-data2modaliases
   trunk/src/hw-support-handler/hw-support-handlerd
   trunk/src/hw-support-handler/hw-support-handlerd.desktop
   trunk/src/hw-support-handler/hw-support-lookup
   trunk/src/hw-support-handler/hwsupport/
   trunk/src/hw-support-handler/modalias-format.txt
   trunk/src/hw-support-handler/modaliases
Modified:
   trunk/src/hw-support-handler/README
Log:
Rename hw-support-handler project to isenkram, and move it to collab-maint and git.

Modified: trunk/src/hw-support-handler/README
===================================================================
--- trunk/src/hw-support-handler/README	2013-01-22 17:47:54 UTC (rev 78839)
+++ trunk/src/hw-support-handler/README	2013-01-22 20:34:03 UTC (rev 78840)
@@ -1,214 +1,7 @@
-Make it easier to get pluggable hardware working in Debian
-==========================================================
+This project is renamed to isenkram and moved to collab-maint git.
+Fetch the latest source using
 
-Imagine you just bought yourself ColorHug[1] or a LEGO Mindstorms
-NXT[2], and you plug it into your trusty old Debian computer to test
-it, but nothing happen.  There is no meny option to use it, and no
-feedback from the system on what is missing.  Despite the fact that
-the software to use these dongles are present in Debian and only a
-short 'apt-get install' away, there is no automatic way to let the
-user know about this.
+  git clone git://anonscm.debian.org/collab-maint/isenkram.git
 
- 1) <URL: http://www.hughski.com/ >
- 2) <URL: http://mindstorms.lego.com/en-us/default.aspx >
-
-Ubuntu got Jockey to handle these things, and Mandriva got Harddrake,
-but there is nothing in Debian to implement this yet.  But neither the
-Ubuntu nor Mandriva solution handle many hot-pluggable devices.  They
-mostly focus on video and wireless network cards, required to get the
-machine working, not the vast collection of fun and useful packages in
-Debian for the Arduino, the Mark And Spenser Rocket Launcer, the
-Yubikey or the Simtec entropyKey.  This is an area where Debian can do
-better. :)
-
-To rectify this, I propose to implement a system to let the user know
-what to install and make it easy to install it.  The idea is simple:
-
- 1) Listen for notifications when new hardware is plugged in (dbus,
-    kernel events, something?)  dbus events can be fetched when hal is
-    installed using 'dbus-montor --system' udev kernel events can be
-    fetched from the kernel using "/sbin/udevadm monitor --kernel
-    --environment"
-
- 2) For new hardware, look up which packages include drivers/support
-    software.
-
- 3a)Show dialog to the user proposing to install the packages.
- or
- 3b)Show desktop notification suggesting to install package.
-
- 4) Install requested packages.
-
-The machanism used to install packages can be PackageKit or something
-else.
-
-How many packages are hardware dependent?
------------------------------------------
-
-It is hard to guess.  One way to measure it is to see how many
-packages provide udev rules, as these probably affect hardware
-devices.  For example using apt-file in unstable 2013-01-12 give this
-result:
-
-  % apt-file search /lib/udev/rules.d|cut -d: -f1|sort -u|wc -l
-  136
-  %
-
-Another is to look at Ubuntu, and how many packages have a Modaliases
-entry in the Packages files.  For Ubuntu Quantal it is around 25
-packages.
-
-The discover based implementation
----------------------------------
-
-The discover package and data format support mapping PCI and USB
-devices to anything, and have been used in the past to map to XFree86
-package, kernel module and debian package.  The last feature is used
-here to figure out what package to install.  The discover-pkginstall
-script is used to figure out what package support the current hardware
-set.  To add a new mapping, an entry like this need to be added in the
-discover-data package.  For an USB device, this block would go into
-the usb-device.xml file:
-
-  <device vendor='1130' model='0202' model_name='Rocket Launcher'>
-    <data class='package'>
-      <data class='debian'>
-        <data class='name'>pymissile</data>
-      </data>
-      <data class='last-updated'>2013-01-09</data>
-      <data class='last-updated-by'>pere at hungry.com</data>
-    </data>
-  </device>
-
-This system have the advantage of working without any help from
-package maintainers or the FTP masters in Debian (which could help
-inject Modaliases headers to the Packages files if the packages
-themselves lack the information).  It is also easier to backport, as
-there is only one or two packages (discover-data and discover) that
-need to change.
-
-But it has a disadvange of being centrally controlled, and thus harder
-for most people in Debian to add mapping for new hardware.
-
-The Ubuntu modalias based implementation
-----------------------------------------
-
-The Ubuntu approach is to add a new header binary package Modaliases
-in debian/control, listing the PCI or USB device IDs (aka modalias)
-handled by a given package.  The design is based on how modprobe and
-the kernel work on Linux.  The entries look like this:
-
-  Modaliases: module(<bus>:<alias-specification>, <bus>:<alias-specification>)
-
-The bus:alias-specification is compared with the content of
-/sys/<bus>/bus/devices/*/modalias using file globbing rules, and the
-matching packages are proposed to the user.  Here is an example from
-Ubuntu Universe:
-
-  Package: virtualbox-guest-dkms
-  Modaliases: vboxguest(pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*)
-
-Users with machines including a device with the PCI vendor ID 08EE and
-model ID CAVE subvendor ID 0 and subdevice 0 will get a suggestion to
-install the virtualbox-guest-dkms package in Ubuntu.  The module part
-is either a kernel module name or a string useful to identify the
-driver.
-
-This mechanism allow us to match packages not only to USB or PCI IDs,
-but DMI and ACPI information.  My old Thinkpad have this entry in
-/sys/devices/virtual/dmi/id/modalias:
-
-  dmi:bvnIBM:bvr1UETB6WW(1.66):bd06/15/2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
-
-Thus the same mechanism can be used to match packages to specific
-laptop models as long as ACPI or DMI information can be used to
-identify them.  The complete list if relevant modalias entries for a
-given machine can be found using
-
-  cat $(find /sys -name modalias) | sort -u
-
-Kernel modules include modalias matching rules to report which
-hardware they support, and modprobe can be used to list the relevant
-modules.  Here is an example from my laptop
-
-  % /sbin/modprobe --show-depends  acpi:IBM0071:PNP0511:
-  insmod /lib/modules/2.6.32-5-686/kernel/lib/crc-ccitt.ko 
-  insmod /lib/modules/2.6.32-5-686/kernel/net/irda/irda.ko 
-  insmod /lib/modules/2.6.32-5-686/kernel/drivers/net/irda/nsc-ircc.ko 
-  %
-
-The lowlevel handling in Ubuntu is provided in
-ubuntu-drivers-common[3] and the GUI is implemented in jockey[4].
-
- 3) <URL: https://launchpad.net/ubuntu/+source/ubuntu-drivers-common >
- 4) <URL: https://launchpad.net/ubuntu/+source/jockey >
-
-The same mechanism should work for Debian too, and seem to be generic
-enough for any PCI and USB specific package.
-
-Information about the modalias values are available from
-<URL: https://wiki.archlinux.org/index.php/Modalias >
-and blueprints for the Ubuntu implementation can be found at
-<URL: https://blueprints.launchpad.net/ubuntu/+spec/hardware-desktop-n-package-field-modaliases >
-and
-<URL: https://blueprints.launchpad.net/ubuntu/+spec/desktop-q-third-party-driver-installation >.
-
-This system could be used directly by debian-installer to figure out
-what packages to install, as the Packages file is available for
-parsing there.  It will work for both deb and udeb packages.
-
-It will make the Packages file slightly larger.  Based on counts from
-Ubuntu Quantal (around 25 packages) and the current discover-data info
-(12 USB related packages, not sure about the PCI related packages), it
-will probably affect less than 100 packages in the Debian archive.
-
-The Madriva implementation
---------------------------
-
-I am told that Mandriva will suggest which packages to install when a
-printer is plugged in.  I am not quite sure how this is done, but I
-believe the Harddrake system is involved.
-
-
-Debian DEP-11 proposal
-----------------------
-
-Part of the DEP-11 proposal is a suggestion to add mappings from
-packages to USB and PCI devices in a new file in the Debian archive.
-The details are available from
-<URL: http://wiki.debian.org/AppStreamDebianProposal >.
-
-The current proposal seem to have too few features to beat the Ubuntu
-implementation.  The two fields for USB and PCI IDs will not be able
-to match an entire subclass of packages, nor a range of IDs without
-listing each ID.
-
-  https://launchpad.net/ubuntu/natty/+source/jockey/+changelog
-
-PackageKit API
---------------
-
-I belive there are two packages in Debian providing the PackageKit
-API.  One is packagekit, the other is aptdaemon.
-
-The PackageKit API provide a mechanism to look up a modalias and get a
-list of packages back.  It can also look up MIME types, fonts etc.
-DEP-11 is a proposal to provide the information required for this to
-work.
-
- http://wiki.debian.org/PackageKit/ItemNotFound
- http://gitorious.org/packagekit/packagekit/blobs/master/docs/provides-component-naming.txt
-
-Debtags proposal
-----------------
-
-It would be possible to use debtags to map USB/PCI ids to packages.  A
-tag like hardware::usb::1d6b:0001 for packages handling the USB device
-with vendor ID 1d6b and model ID 0001, and hardware::pci::8086:1077
-for packages handling the PCI device with vendor ID 8086 and model ID
-1077.  A proposal was sent to the debtags-devel mailing list[5] but did
-not receive any positive feedback.  This have is not as flexible as
-the Modaliases proposal and will fill the debtags database with
-information that perhaps do not belong there.
-
- 5) <URL: http://lists.alioth.debian.org/pipermail/debtags-devel/2013-January/002202.html >
+or visit
+<URL: http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git >.

Deleted: trunk/src/hw-support-handler/discover-data2modaliases
===================================================================
--- trunk/src/hw-support-handler/discover-data2modaliases	2013-01-22 17:47:54 UTC (rev 78839)
+++ trunk/src/hw-support-handler/discover-data2modaliases	2013-01-22 20:34:03 UTC (rev 78840)
@@ -1,66 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use XML::Simple;
-use Data::Dumper;
-
-my $basedir = $ARGV[0] || "/lib/discover";
-
-my %pkgmap;
-for my $bus ("pci", "usb") {
-    my $ref = XMLin("$basedir/$bus-device.xml");
-    for my $device (@{$ref->{'device'}}) {
-#        print Dumper($device);
-
-        if (exists $device->{'data'}) {
-            my $entries;
-            if ("ARRAY" eq ref $device->{'data'}) {
-                $entries = @{$device->{'data'}};
-            } else {
-                $entries = $device->{'data'};
-            }
-            for my $data ($entries) {
-                if ("HASH" eq ref $data && "package" eq $data->{'class'}) {
-#                    print Dumper($data);
-                    my $vendor = uc($device->{'vendor'});
-                    my $model = uc($device->{'model'});
-                    my @pkgentries;
-#                    print Dumper($data->{data}[0]->{'data'});
-                    if ("ARRAY" eq ref $data->{data}[0]->{'data'}) {
-                        @pkgentries = @{$data->{data}[0]->{'data'}};
-                    } else {
-                        @pkgentries = $data->{data}[0]->{'data'};
-                    }
-
-#                    print Dumper(@pkgentries);
-
-                    for my $pkgentry (@pkgentries) {
-                        my $pkglist = $pkgentry->{'content'};
-                        for my $pkg (split(/ /, $pkglist)) {
-                            my $modalias;
-                            if ("usb" eq $bus) {
-                                $modalias = "usb:v${vendor}p${model}d*";
-                            } elsif ("pci" eq $bus) {
-                                $modalias = "pci:v0000${vendor}d0000${model}sv*";
-                            } else {
-                            }
-                            if (exists $pkgmap{$pkg}) {
-                                push(@{$pkgmap{$pkg}}, $modalias);
-                            } else {
-                                $pkgmap{$pkg} = [$modalias];
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
-for my $pkg (sort keys %pkgmap) {
-    print "Package: $pkg\n";
-    print "Modaliases: $pkg(".join(", ", sort @{$pkgmap{$pkg}}), ")\n";
-    print "\n";
-}

Deleted: trunk/src/hw-support-handler/hw-support-handlerd
===================================================================
--- trunk/src/hw-support-handler/hw-support-handlerd	2013-01-22 17:47:54 UTC (rev 78839)
+++ trunk/src/hw-support-handler/hw-support-handlerd	2013-01-22 20:34:03 UTC (rev 78840)
@@ -1,237 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-"""
-Provides a graphical demo application for aptdaemon
-"""
-# Copyright (C) 2013 Petter Reinholdtsen <pere at hungry.com>
-# AptDaemon gtk client code based on gtk-demo, copyright (C) 2008-2009
-# Sebastian Heinlein <sevel at glatzor.de>
-#
-# Licensed under the GNU General Public License Version 2
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-__author__ = "Petter Reinholdtsen <pere at hungry.com>"
-
-import string
-#import pygtk
-import gtk
-import gobject
-import gudev
-import pynotify
-import subprocess
-import glob
-import fnmatch
-import hwsupport.lookup
-from aptdaemon.gtkwidgets import AptErrorDialog, \
-                                 AptConfirmDialog, \
-                                 AptProgressDialog
-import aptdaemon.errors
-
-hw_seen = {}
-pkg_suggested = {}
-
-class AptDaemonDemo:
-
-    """Provides a graphical test application."""
-
-    def _run_transaction(self, transaction):
-        dia = AptProgressDialog(transaction, parent=self.win)
-        dia.run(close_on_finished=True, show_error=True,
-                reply_handler=lambda: True,
-                error_handler=self._on_error)
-
-    def _simulate_trans(self, trans):
-        trans.simulate(reply_handler=lambda: self._confirm_deps(trans),
-                       error_handler=self._on_error)
-
-    def _confirm_deps(self, trans):
-        if [pkgs for pkgs in trans.dependencies if pkgs]:
-            dia = AptConfirmDialog(trans, parent=self.win)
-            res = dia.run()
-            dia.hide()
-            if res != gtk.RESPONSE_OK:
-                return
-        self._run_transaction(trans)
-
-    def _on_error(self, error):
-        try:
-            raise error
-        except aptdaemon.errors.NotAuthorizedError:
-            # Silently ignore auth failures
-            return
-        except aptdaemon.errors.TransactionFailed, error:
-            pass
-        except Exception, error:
-            error = aptdaemon.errors.TransactionFailed(ERROR_UNKNOWN,
-                                                       str(error))
-        dia = AptErrorDialog(error)
-        dia.run()
-        dia.hide()
-
-    def _on_upgrade_clicked(self, *args):
-        self.ac.upgrade_system(reply_handler=self._simulate_trans,
-                               error_handler=self._on_error)
-
-    def _on_update_clicked(self, *args):
-        self.ac.update_cache(reply_handler=self._run_transaction,
-                             error_handler=self._on_error)
-
-    def _on_install_clicked(self, *args):
-        self.ac.install_packages([self.package],
-                                 reply_handler=self._simulate_trans,
-                                 error_handler=self._on_error)
-
-    def _on_install_file_clicked(self, *args):
-        chooser = gtk.FileChooserDialog(parent=self.win,
-                                        action=gtk.FILE_CHOOSER_ACTION_OPEN,
-                                        buttons=(gtk.STOCK_CANCEL,
-                                                 gtk.RESPONSE_CANCEL,
-                                                 gtk.STOCK_OPEN,
-                                                 gtk.RESPONSE_OK))
-        chooser.set_local_only(True)
-        chooser.run()
-        chooser.hide()
-        path = chooser.get_filename()
-        self.ac.install_file(path, reply_handler=self._simulate_trans,
-                             error_handler=self._on_error)
-
-    def _on_remove_clicked(self, *args):
-        self.ac.remove_packages([self.package],
-                                reply_handler=self._simulate_trans,
-                                error_handler=self._on_error)
-
-    def __init__(self, package):
-        self.win = None
-        self.package = package
-        self.loop = gobject.MainLoop()
-        self.ac = aptdaemon.client.AptClient()
-
-    def run(self):
-        self.loop.run()
-
-
-# Keep refs needed for callback to work
-n = None
-npkgs = None
-
-def notify_pleaseinstall(notification=None, action=None, data=None):
-    pkgs = data
-    pkgsstr = string.join(pkgs, " ")
-#    print pkgs
-    print "info: button clicked, installing %s" % pkgsstr
-    demo = AptDaemonDemo(pkgs[0])
-    demo._on_install_clicked()
-
-def notify(bus, vendor, device, pkgs):
-    pkgstr = string.join(pkgs, " ")
-    text = "New %s device [%04x:%04x] supported by package(s) %s." \
-        % (bus, vendor, device, pkgstr)
-    title = "New %s device" % bus
-
-    print "info: " + text
-
-    # Initializite pynotify
-    if not pynotify.init("hw-support-handlerd"):
-        return False
-    global n
-    global npkgs
-    npkgs = pkgs
-    n = pynotify.Notification(title, text)
-    n.set_timeout(10000)
-    n.add_action("clicked",
-                 "Please install program(s)",
-                 notify_pleaseinstall, npkgs)
-    n.show()
-    return True
-
-def is_pkg_installed(packagename):
-    cmd = ["dpkg", "-l", packagename]
-    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-    retval = False
-    while True:
-        retcode = p.poll()
-        line = p.stdout.readline()
-        if 0 == line.find("ii "):
-            retval = True
-        if(retcode is not None):
-            break
-    return retval
-
-def devid2modalias(bus, vendor, device):
-    target = "%s:v%04xp%04xd*" % (bus, vendor, device)
-    modalias = None
-    for filename in glob.iglob("/sys/bus/%s/devices/*/modalias" % bus):
-        f = open(filename)
-        line = f.readline().strip()
-#        print line, target
-        if fnmatch.fnmatch(line, target):
-            modalias = line
-#            print filename
-        f.close()
-    return modalias
-
-def get_pkg_suggestions_aptmodaliases(modalias):
-    print "info: checking apt modaliases info"
-    return hwsupport.lookup.pkgs_handling_apt_modaliases([modalias])
-
-def get_pkg_suggestions_mymodaliases(modalias):
-    print "info: checking my modaliases file (from svn)"
-    return hwsupport.lookup.pkgs_handling_extra_modaliases([modalias])
-
-def get_pkg_suggestions(modalias):
-    pkgs = []
-#    discoverpkgs = get_pkg_suggestions_discover(bus, vendor, device)
-#    pkgs.extend(discoverpkgs)
-    aptpkgs = get_pkg_suggestions_aptmodaliases(modalias)
-    pkgs.extend(aptpkgs)
-    mypkgs = get_pkg_suggestions_mymodaliases(modalias)
-    pkgs.extend(mypkgs)
-    return pkgs
-
-def uevent_callback(client, action, device, user_data):
-    modalias = device.get_property("MODALIAS")
-    if ("add" == action and modalias is not None):
-        device_vendor = device.get_property("ID_VENDOR_ENC")
-        device_model = device.get_property("ID_MODEL_ENC")
-        print "uevent %s %s %s" % (device_vendor, device_model, modalias)
-        bus = device.get_subsystem()
-        if "usb" == bus:
-            print "info: discovered USB device %s %s" % (device_vendor,
-                                                         device_model)
-            if modalias not in hw_seen:
-                pkgs = get_pkg_suggestions(modalias)
-#                print "Suggestions: ", pkgs
-                newpkg = []
-                for pkg in pkgs:
-                    if pkg not in pkg_suggested and not is_pkg_installed(pkg):
-                        newpkg.append(pkg)
-                        pkg_suggested[pkg] = True
-                if 0 < len(newpkg):
-                    vendorid, deviceid, bcdevice = \
-                        device.get_property("PRODUCT").split("/")
-                    notify(bus, int(vendorid, 16), int(deviceid, 16), newpkg)
-                hw_seen[modalias] = True
-
-def main():
-    client = gudev.Client([])
-    client.connect("uevent", uevent_callback, None)
-
-    loop = gobject.MainLoop()
-    print "info: ready to accept hardware events"
-    loop.run()
-
-if __name__ == '__main__':
-    main()

Deleted: trunk/src/hw-support-handler/hw-support-handlerd.desktop
===================================================================
--- trunk/src/hw-support-handler/hw-support-handlerd.desktop	2013-01-22 17:47:54 UTC (rev 78839)
+++ trunk/src/hw-support-handler/hw-support-handlerd.desktop	2013-01-22 20:34:03 UTC (rev 78840)
@@ -1,6 +0,0 @@
-[Desktop Entry]
-Exec=hw-support-handlerd
-Type=Application
-Terminal=false
-Name=hw-support-handler
-GenericName=Suggest new packages when hardware devices are plugged in

Deleted: trunk/src/hw-support-handler/hw-support-lookup
===================================================================
--- trunk/src/hw-support-handler/hw-support-lookup	2013-01-22 17:47:54 UTC (rev 78839)
+++ trunk/src/hw-support-handler/hw-support-lookup	2013-01-22 20:34:03 UTC (rev 78840)
@@ -1,99 +0,0 @@
-#!/bin/sh
-#
-# Look up modalias in package-modalias mapping file(s), and report the
-# matching packages.
-#
-# If no argument is given, look up all modalias entries found in /sys.
-# If an argument is given, look up the modalias given on th command
-# line.
-
-set -e
-
-ubuntu_lists() {
-    ubmirror=http://ftp.uninett.no/ubuntu
-    suite=raring
-    arch=i386
-    for section in main restricted multiverse universe
-    do
-	GET $ubmirror/dists/$suite/$section/binary-$arch/Packages.bz2 | bunzip2
-    done
-}
-
-debian_lists() {
-    mirror=http://http.debian.net/debian
-    suite=sid
-    arch=i386
-    for section in main contrib non-free
-    do
-	GET $mirror/dists/$suite/$section/binary-$arch/Packages.bz2 | bunzip2
-    done
-    echo $scriptdir
-    if [ -r $scriptdir/modaliases ] ; then cat $scriptdir/modaliases; fi
-    if [ -r /usr/share/hw-support-handler/modaliases ] ; then
-	cat /usr/share/hw-support-handler/modaliases
-    fi
-    GET 'http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co'
-}
-
-trim_packages() {
-    grep -E '^Package: |^Modaliases: |^$' \
-    | tr "\n" "#" \
-    | sed "s/##/\n/g" \
-    | grep -E 'Modaliases: ' \
-    | tr "\n" "%" | sed "s/%/\n\n/g" \
-    | tr "#" "\n"
-}
-
-# To generate a list of packages
-#debian_lists | trim_packages
-#exit 0
-
-get_lists() {
-    #ubuntu_lists
-    debian_lists
-}
-
-# Make sure file names do not contain slash by mapping % -> %25 and / -> %2F
-escape() {
-    sed -e 's:%:%25:g' -e 's:/:%2F:g'
-}
-
-pkglookup() {
-    while read package modaliases ; do
-	for alias in $(echo $modaliases | tr ")" "\n" | cut -d"(" -f2 | sed "s/, /\n/g" | escape); do
-#	    echo "$package $alias" 1>&2
-	    if ls "$alias" >/dev/null 2>&1 ; then
-		echo $package
-	    fi
-	done
-    done | sort -u
-}
-
-scriptdir=$(cd $(dirname $0); pwd)
-
-dir=$(mktemp -d)
-cd $dir
-
-# First, find all relevant modalias entries for the current machine,
-# and create a file with the alias name.
-if [ "$1" ] ; then
-    touch "$*"
-else
-    for id in $(find /sys -name modalias -print0 | xargs -0 cat | egrep '^(usb|pci|acpi|dmi):' | sort -u | escape ); do
-	touch "$id"
-    done
-fi
-
-# Next, extract package name and modalias glob list, and look up
-# packages using shell globbing to match the current systems hardware.
-get_lists \
-    | grep -E '^Package: |^Modaliases: |^$' \
-    | tr "\n" "#" \
-    | sed "s/##/\n/g" \
-    | tr "#" " " \
-    | grep Modaliases: \
-    | sed -e 's/^Package: //' -e 's/ Modaliases: / /g' \
-    | pkglookup
-
-cd /
-rm -rf $dir

Deleted: trunk/src/hw-support-handler/modalias-format.txt
===================================================================
--- trunk/src/hw-support-handler/modalias-format.txt	2013-01-22 17:47:54 UTC (rev 78839)
+++ trunk/src/hw-support-handler/modalias-format.txt	2013-01-22 20:34:03 UTC (rev 78840)
@@ -1,208 +0,0 @@
-Modalias decoded
-================
-
-This document try to explain what the different types of modalias
-values stands for.  It is in part based on information from
-<URL: https://wiki.archlinux.org/index.php/Modalias >,
-<URL: http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device >,
-<URL: http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c > and
-<URL: http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&view=markup >.
-
-The modalias entries for a given Linux machine can be found using this
-shell script:
-
-  cat $(find /sys -name modalias) | sort -u
-
-The supported modalias globs for a given kernel module can be found
-using modinfo:
-
-  % /sbin/modinfo psmouse | grep alias:
-  alias:          serio:ty05pr*id*ex*
-  alias:          serio:ty01pr*id*ex*
-  %
-
-
-PCI subtype
------------
-
-A typical PCI entry can look like this.  This is an Intel Host Bridge
-memory controller:
-
-  pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
-
-This represent these values:
-
- v   00008086  (vendor)
- d   00002770  (device)
- sv  00001028  (subvendor)
- sd  000001AD  (subdevice)
- bc  06        (bus class)
- sc  00        (bus subclass)
- i   00        (interface)
-
-The vendor/device values are the same values outputted from 'lspci -n'
-as 8086:2770.  The bus class/subclass is also shown by lspci as 0600.
-The 0600 class is a host bridge.  Other useful bus values are 0300
-(VGA compatible card) and 0200 (Ethernet controller).
-
-Not sure how to figure out the interface value, nor what it means.
-
-USB subtype
------------
-
-Some typical USB entries can look like this.  This is an internal USB
-hub in a laptop:
-
-  usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
-
-Here is the values included in this alias:
-
- v    1D6B  (device vendor)
- p    0001  (device product)
- d    0206  (bcddevice)
- dc     09  (device class)
- dsc    00  (device subclass)
- dp     00  (device protocol)
- ic     09  (interface class)
- isc    00  (interface subclass)
- ip     00  (interface protocol)
-
-The 0900 device class/subclass means hub.  Some times the relevant
-class is in the interface class section.  For a simple USB web camera,
-these alias entries show up:
-
-  usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
-  usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
-  usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
-  usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
-
-Interface class 0E01 is video control, 0E02 is video streaming (aka
-camera), 0101 is audio control device and 0102 is audio streaming (aka
-microphone).  Thus this is a camera with microphone included.
-
-ACPI subtype
-------------
-
-The ACPI type is used for several non-PCI/USB stuff.  This is an IR
-receiver in a Thinkpad X40:
-
-  acpi:IBM0071:PNP0511:
-
-The values between the colons are IDs.
-
-DMI subtype
------------
-
-The DMI table contain lots of information about the computer case and
-model.  This is an entry for a IBM Thinkpad X40, fetched from
-/sys/devices/virtual/dmi/id/modalias:
-
-  dmi:bvnIBM:bvr1UETB6WW(1.66):bd06/15/2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
-
-The values present are
-
- bvn  IBM            (BIOS vendor)
- bvr  1UETB6WW(1.66) (BIOS version)
- bd   06/15/2005     (BIOS date)
- svn  IBM            (system vendor)
- pn   2371H4G        (product name)
- pvr  ThinkPadX40    (product version)
- rvn  IBM            (board vendor)
- rn   2371H4G        (board name)
- rvr  NotAvailable   (board version)
- cvn  IBM            (chassis vendor)
- ct   10             (chassis type)
- cvr  NotAvailable   (chassis version)
-
-The chassis type 10 is Notebook.  Other interesting values can be
-found in the dmidecode source:
-
-  3 Desktop
-  4 Low Profile Desktop
-  5 Pizza Box
-  6 Mini Tower
-  7 Tower
-  8 Portable
-  9 Laptop
- 10 Notebook
- 11 Hand Held
- 12 Docking Station
- 13 All In One
- 14 Sub Notebook
- 15 Space-saving
- 16 Lunch Box
- 17 Main Server Chassis
- 18 Expansion Chassis
- 19 Sub Chassis
- 20 Bus Expansion Chassis
- 21 Peripheral Chassis
- 22 RAID Chassis
- 23 Rack Mount Chassis
- 24 Sealed-case PC
- 25 Multi-system
- 26 CompactPCI
- 27 AdvancedTCA
- 28 Blade
- 29 Blade Enclosing
-
-The chassis type values are not always accurately set in the DMI
-table.  For example my home server is a tower, but the DMI modalias
-claim it is a desktop.
-
-SerIO subtype
--------------
-
-This type is used for PS/2 mouse plugs.  One example is from my test
-machine:
-
-  serio:ty01pr00id00ex00
-
-The values present are
-
-  ty  01  (type)
-  pr  00  (prototype)
-  id  00  (id)
-  ex  00  (extra)
-
-This type is supported by the psmouse driver.  I am not sure what the
-valid values are.
-
-Other subtypes
---------------
-
-There are heaps of other modalias subtypes according to file2alias.c.
-There is the rest of the list from that source: amba, ap, bcma, ccw,
-css, eisa, hid, i2c, ieee1394, input, ipack, isapnp, mdio, of, parisc,
-pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio, vmbus, x86cpu and
-zorro.  I did not spend time documenting all of these, as they do not
-seem relevant for my intended use with mapping hardware to packages
-when new stuff is inserted during run time.
-
-Looking up kernel modules using modalias values
------------------------------------------------
-
-To check which kernel modules provide support for a given modalias,
-one can use the following shell script:
-
-  for id in $(cat $(find /sys -name modalias)|sort -u); do \
-    echo "$id" ; \
-    /sbin/modprobe --show-depends "$id"|sed 's/^/  /' ; \
-  done
-
-The output can look like this (only the first few entries as the list
-is very long on my test machine):
-
-  acpi:ACPI0003:
-    insmod /lib/modules/2.6.32-5-686/kernel/drivers/acpi/ac.ko 
-  acpi:device:
-  FATAL: Module acpi:device: not found.
-  acpi:IBM0068:
-    insmod /lib/modules/2.6.32-5-686/kernel/drivers/char/nvram.ko 
-    insmod /lib/modules/2.6.32-5-686/kernel/drivers/leds/led-class.ko 
-    insmod /lib/modules/2.6.32-5-686/kernel/net/rfkill/rfkill.ko 
-    insmod /lib/modules/2.6.32-5-686/kernel/drivers/platform/x86/thinkpad_acpi.ko 
-  acpi:IBM0071:PNP0511:
-    insmod /lib/modules/2.6.32-5-686/kernel/lib/crc-ccitt.ko 
-    insmod /lib/modules/2.6.32-5-686/kernel/net/irda/irda.ko 
-    insmod /lib/modules/2.6.32-5-686/kernel/drivers/net/irda/nsc-ircc.ko 
-  [...]

Deleted: trunk/src/hw-support-handler/modaliases
===================================================================
--- trunk/src/hw-support-handler/modaliases	2013-01-22 17:47:54 UTC (rev 78839)
+++ trunk/src/hw-support-handler/modaliases	2013-01-22 20:34:03 UTC (rev 78840)
@@ -1,132 +0,0 @@
-Package: alsa-firmware-loaders
-Modaliases: alsa-firmware-loaders(usb:v1604p8000d*, usb:v1604p8001d*, usb:v1604p8004d*, usb:v1604p8005d*, usb:v1604p8006d*, usb:v1604p8007d*)
-
-Package: argyll
-Modaliases: argyll(usb:v04DBp005Bd*, usb:v0670p0001d*, usb:v0765pD020d*, usb:v0765pD092d*, usb:v0765pD094d*, usb:v085Cp0200d*, usb:v085Cp0300d*, usb:v0971p2000d*, usb:v0971p2001d*, usb:v0971p2003d*, usb:v0971p2005d*, usb:v0971p2007d*)
-
-Package: b43-fwcutter
-Modaliases: b43-fwcutter(pci:v000014E4d00004312sv*, pci:v000014E4d00004320sv*)
-
-Package: bluez-firmware
-Modaliases: bluez-firmware(usb:v0C10p0000d*)
-
-Package: cheese
-Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)
-
-Package: colorhug-client
-Modaliases: colorhug-client(usb:v04D8pF8DAd*)
-
-Package: ekeyd
-Modaliases: ekeyd(usb:v20DFp0001d*)
-
-Package: firmware-ipw2x00
-Modaliases: ipw2200(pci:v00008086d00004224sv*sd*bc*sc*i*, pci:v00008086d00004223sv*sd*bc*sc*i*, pci:v00008086d00004221sv*sd*bc*sc*i*, pci:v00008086d00004220sv*sd*bc*sc*i*, pci:v00008086d0000104Fsv*sd*bc*sc*i*, pci:v00008086d00001043sv00008086sd00002762bc*sc*i*, pci:v00008086d00001043sv00008086sd00002761bc*sc*i*, pci:v00008086d00001043sv00008086sd00002754bc*sc*i*, pci:v00008086d00001043sv00008086sd00002753bc*sc*i*, pci:v00008086d00001043sv00008086sd00002752bc*sc*i*, pci:v00008086d00001043sv00008086sd00002751bc*sc*i*, pci:v00008086d00001043sv00008086sd00002742bc*sc*i*, pci:v00008086d00001043sv0000103Csd00002741bc*sc*i*, pci:v00008086d00001043sv00008086sd00002741bc*sc*i*, pci:v00008086d00001043sv00008086sd00002732bc*sc*i*, pci:v00008086d00001043sv00008086sd00002731bc*sc*i*, pci:v00008086d00001043sv00008086sd00002722bc*sc*i*, pci:v00008086d00001043sv00008086sd00002721bc*sc*i*, pci:v00008086d00001043sv00008086sd00002712bc*sc*i*, pci:v00008086d00001043sv00008086sd00002711bc*sc*i*, pci:v00008086d00001043sv00008086sd00002702bc*sc*i*, pci:v00008086d00001043sv00008086sd00002701bc*sc*i*)
-
-Package: gphoto2
-Modaliases: gphoto2(usb:v04A9p30BFd*)
-
-Package: gpsbabel
-Modaliases: gpsbabel(usb:v091Ep0003d*)
-
-Package: gpsbabel-gui
-Modaliases: gpsbabel-gui(usb:v091Ep0003d*)
-
-Package: gpsman
-Modaliases: gpsman(usb:v091Ep0003d*)
-
-Package: gpstrans
-Modaliases: gpstrans(usb:v091Ep0003d*)
-
-Package: gtkpod
-Modaliases: gtkpod(usb:v05ACp1300d*)
-
-Package: hpijs-ppds
-Modaliases: hpijs-ppds(usb:v03F0p0004d*, usb:v03F0p0104d*, usb:v03F0p0111d*, usb:v03F0p0204d*, usb:v03F0p0304d*, usb:v03F0p0311d*, usb:v03F0p0404d*, usb:v03F0p0504d*, usb:v03F0p0604d*, usb:v03F0p0704d*, usb:v03F0p0712d*, usb:v03F0p0804d*, usb:v03F0p0904d*, usb:v03F0p1004d*, usb:v03F0p1104d*, usb:v03F0p1151d*, usb:v03F0p1204d*, usb:v03F0p1504d*, usb:v03F0p1604d*, usb:v03F0p1904d*, usb:v03F0p1C17d*, usb:v03F0p1E11d*, usb:v03F0p2004d*, usb:v03F0p2104d*, usb:v03F0p2304d*, usb:v03F0p2811d*, usb:v03F0p2D11d*, usb:v03F0p3102d*, usb:v03F0p3104d*, usb:v03F0p3304d*, usb:v03F0p3404d*, usb:v03F0p3504d*, usb:v03F0p3C02d*, usb:v03F0p3D11d*, usb:v03F0p3F11d*, usb:v03F0p5004d*, usb:v03F0p6004d*, usb:v03F0p6104d*, usb:v03F0p6204d*, usb:v03F0p6602d*, usb:v03F0p7004d*, usb:v03F0p7104d*, usb:v03F0p7204d*, usb:v03F0p7304d*, usb:v03F0pA004d*)
-
-Package: hplip
-Modaliases: hplip(usb:v03F0p0004d*, usb:v03F0p0104d*, usb:v03F0p0111d*, usb:v03F0p0204d*, usb:v03F0p0304d*, usb:v03F0p0311d*, usb:v03F0p0404d*, usb:v03F0p0504d*, usb:v03F0p0604d*, usb:v03F0p0704d*, usb:v03F0p0712d*, usb:v03F0p0804d*, usb:v03F0p0904d*, usb:v03F0p1004d*, usb:v03F0p1104d*, usb:v03F0p1151d*, usb:v03F0p1204d*, usb:v03F0p1504d*, usb:v03F0p1604d*, usb:v03F0p1904d*, usb:v03F0p1C17d*, usb:v03F0p1E11d*, usb:v03F0p2004d*, usb:v03F0p2104d*, usb:v03F0p2304d*, usb:v03F0p2811d*, usb:v03F0p2D11d*, usb:v03F0p3102d*, usb:v03F0p3104d*, usb:v03F0p3304d*, usb:v03F0p3404d*, usb:v03F0p3504d*, usb:v03F0p3C02d*, usb:v03F0p3D11d*, usb:v03F0p3F11d*, usb:v03F0p5004d*, usb:v03F0p6004d*, usb:v03F0p6104d*, usb:v03F0p6204d*, usb:v03F0p6602d*, usb:v03F0p7004d*, usb:v03F0p7104d*, usb:v03F0p7204d*, usb:v03F0p7304d*, usb:v03F0pA004d*)
-
-Package: ipw3945-source
-Modaliases: ipw3945-source(pci:v00008086d00004222sv*, pci:v00008086d00004227sv*, pci:v00008086d00004229sv*)
-
-Package: ipw3945d
-Modaliases: ipw3945d(pci:v00008086d00004229sv*)
-
-Package: mkgmap
-Modaliases: mkgmap(usb:v091Ep0003d*)
-
-Package: nbc
-Modaliases: nbc(usb:v0694p0002d*)
-
-Package: nut-hal-drivers
-Modaliases: nut-hal-drivers(usb:v0001p0000d*, usb:v03F0p1F01d*, usb:v03F0p1F02d*, usb:v03F0p1F06d*, usb:v03F0p1F0Ad*, usb:v0463p0001d*, usb:v0463pFFFFd*, usb:v047CpFFFFd*, usb:v050Dp0375d*, usb:v050Dp0551d*, usb:v050Dp0750d*, usb:v050Dp0751d*, usb:v050Dp0900d*, usb:v050Dp0910d*, usb:v050Dp0912d*, usb:v050Dp0980d*, usb:v050Dp1100d*, usb:v051Dp0002d*, usb:v0592p0002d*, usb:v05B8p0000d*, usb:v0665p5161d*, usb:v06DAp0002d*, usb:v06DAp0003d*, usb:v06DApFFFFd*, usb:v0764p0005d*, usb:v0764p0501d*, usb:v0764p0601d*, usb:v0925p1234d*, usb:v09AEp0001d*, usb:v09AEp1003d*, usb:v09AEp1007d*, usb:v09AEp1008d*, usb:v09AEp2005d*, usb:v09AEp2007d*, usb:v09AEp3012d*, usb:v09AEp3014d*, usb:v09AEp4001d*, usb:v09AEp4002d*, usb:v09AEp4003d*, usb:v0D9Fp00A2d*, usb:v0D9Fp00A3d*, usb:v0D9Fp00A4d*, usb:v0D9Fp00A5d*, usb:v0D9Fp00A6d*, usb:v0F03p0001d*, usb:v10AFp0001d*, usb:vFFFFp0000d*)
-
-Package: nqc
-Modaliases: nqc(usb:v0694p0001d*)
-
-Package: open-vm-toolbox
-Modaliases: open-vm-toolbox(dmi:*:svnVMWare*:*)
-
-Package: open-vm-tools
-Modaliases: open-vm-tools(dmi:*:svnVMWare*:*)
-
-Package: pcmciautils
-Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
-
-Package: pcscd
-Modaliases: pcscd(usb:v20A0p4107d*, usb:v0B97p7772d*)
-
-Package: pymissile
-Modaliases: pymissile(usb:v1130p0202d*)
-
-Package: python-nxt
-Modaliases: python-nxt(usb:v0694p0002d*)
-
-Package: qlandkartegt
-Modaliases: qlandkartegt(usb:v091Ep0003d*)
-
-Package: qlandkartegt-garmin
-Modaliases: qlandkartegt-garmin(usb:v091Ep0003d*)
-
-Package: rt2x00-source
-Modaliases: rt2x00-source(pci:v00001814d00000101sv*, pci:v00001814d00000201sv*, pci:v00001814d00000301sv*, pci:v00001814d00000302sv*, pci:v00001814d00000401sv*)
-
-Package: sispmctl
-Modaliases: sispmctl(usb:v04B4pFD10d*, usb:v04B4pFD11d*, usb:v04B4pFD12d*, usb:v04B4pFD13d*)
-
-Package: splix
-Modaliases: splix(usb:v04E8p323Ad*, usb:v04E8p323Bd*, usb:v04E8p323Dd*, usb:v04E8p3242d*, usb:v04E8p324Cd*, usb:v04E8p324Dd*, usb:v04E8p325Bd*, usb:v04E8p325Fd*, usb:v04E8p3260d*, usb:v04E8p3268d*, usb:v04E8p3276d*, usb:v04E8p341Bd*, usb:v04E8p3426d*)
-
-Package: t2n
-Modaliases: t2n(usb:v0694p0002d*)
-
-Package: thinkfinger-tools
-Modaliases: thinkfinger-tools(usb:v08FFp2580d*)
-
-Package: usbmuxd
-Modaliases: usbmuxd(usb:v05ACp129[0-9A]d*)
-
-Package: viking
-Modaliases: viking(usb:v091Ep0003d*)
-
-Package: virtualbox-ose-guest-x11
-Modaliases: virtualbox-ose-guest-x11(pci:v000080EEd0000BEEFsv*)
-
-Package: xawtv
-Modaliases: xawtv(pci:v*d*sv*sd*bc04sc00i*)
-
-Package: xserver-xorg-video-qxl
-Modaliases: xserver-xorg-video-qxl(pci:v00001B36d00000100sv*)
-
-Package: xserver-xorg-input-vmmouse
-Modaliases: xserver-xorg-input-vmmouse(dmi:*:svnVMWare*:*)
-
-Package: xserver-xorg-video-vmware
-Modaliases: xserver-xorg-video-vmware(dmi:*:svnVMWare*:*)
-
-Package: yubikey-personalization
-Modaliases: yubikey-personalization(usb:v1050p0010d*)
-
-Package: zd1211-firmware
-Modaliases: zd1211rw(usb:v083Ap4505d*)
-




More information about the debian-edu-commits mailing list