udev-ish replacement for hal-cups-utils?

Martin Pitt martin.pitt at ubuntu.com
Thu Jun 4 08:09:39 PDT 2009


Hello hal-cups-utils authors,

Hal is in the process of being deprecated, since it has become a large
monolithic unmaintainable mess, and also duplicates a lot of
functionality which are nowadays provided by udev and the kernel
itself. Please see David Zeuthen's [1] and Kay Siever's [2] summaries
of plans. 

One of the desktop components which relies on hal is hal-cups-utils.
Has there been any discussion already how to replace this with
something that uses udev?

I had a quick look, and replacing the detection bits in
/usr/lib/cups/backend/hal should be quite simple. It just needs the
device ID, Manufacturer, Model, and command set:

| $ /usr/lib/cups/backend/hal
| direct hal:///org/freedesktop/Hal/devices/usb_device_4e8_3268_3921BAFY504774K__if0_printer_noserial "Samsung ML-1610" "Samsung ML-1610" "MFG:Samsung;MDL:ML-1610;CLS:PRINTER;"
 
Getting this from the kernel and udev should be quite painless (the device ID
should have everything needed): 

| # get all devices which have a printer device ID
| $ udevadm trigger --dry-run --verbose --attr-match=ieee1284_id
| /sys/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
| 
| $ udevadm info --attribute-walk --path /sys/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
|   looking at device '/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0':
|     KERNEL=="2-3:1.0"
|     SUBSYSTEM=="usb"
|     DRIVER=="usblp"
|     ATTR{bInterfaceNumber}=="00"
|     ATTR{bAlternateSetting}==" 0"
|     ATTR{bNumEndpoints}=="02"
|     ATTR{bInterfaceClass}=="07"
|     ATTR{bInterfaceSubClass}=="01"
|     ATTR{bInterfaceProtocol}=="02"
|     ATTR{modalias}=="usb:v04E8p3268d0100dc00dsc00dp00ic07isc01ip02"
|     ATTR{supports_autosuspend}=="1"
|     ATTR{ieee1284_id}=="MFG:Samsung;CMD:GDI;MDL:ML-1610;CLS:PRINTER;MODE:GDI;STATUS:IDLE;"
| 
|   looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2/2-3':
|     KERNELS=="2-3"
|     SUBSYSTEMS=="usb"
|     DRIVERS=="usb"
|     ATTRS{configuration}==""
|     ATTRS{bNumInterfaces}==" 1"
|     ATTRS{bConfigurationValue}=="1"
|     ATTRS{bmAttributes}=="c0"
|     ATTRS{bMaxPower}=="  2mA"
|     ATTRS{urbnum}=="18"
|     ATTRS{idVendor}=="04e8"
|     ATTRS{idProduct}=="3268"
|     ATTRS{bcdDevice}=="0100"
|     ATTRS{bDeviceClass}=="00"
|     ATTRS{bDeviceSubClass}=="00"
|     ATTRS{bDeviceProtocol}=="00"
|     ATTRS{bNumConfigurations}=="1"
|     ATTRS{bMaxPacketSize0}=="16"
|     ATTRS{speed}=="12"
|     ATTRS{busnum}=="2"
|     ATTRS{devnum}=="3"
|     ATTRS{version}==" 1.10"
|     ATTRS{maxchild}=="0"
|     ATTRS{quirks}=="0x0"
|     ATTRS{authorized}=="1"
|     ATTRS{manufacturer}=="Samsung Electronics Co., Ltd."
|     ATTRS{product}=="Samsung ML-1610 Series"
|     ATTRS{serial}=="3921BAFY504774K."
| 
|   [ just uninteresting stuff for USB hub, etc. ]

For testing, it's probably easiest to cobble together udevadm and
grep, before using libudev for the final implementation.

Please let me know about any questions! I'm also happy to give a hand
with this.

Thank you!

Martin

[1] http://lists.freedesktop.org/archives/hal/2008-May/011560.html
[2] http://lists.freedesktop.org/archives/devkit-devel/2009-April/000140.html

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/devkit-devel/attachments/20090604/b147a40f/attachment.pgp 


More information about the devkit-devel mailing list