Features/AutomaticPrintDriverInstallation

From FedoraProject

< Features(Difference between revisions)
Jump to: navigation, search
(Detailed Description)
(Detailed Description: pycups is renamed to python-cups)
 
(16 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
== Summary ==
 
== Summary ==
 
<!-- A sentence or two summarizing what this feature is and what it will do.  This information is used for the overall feature summary page for each release. -->
 
<!-- A sentence or two summarizing what this feature is and what it will do.  This information is used for the overall feature summary page for each release. -->
Packages like gutenprint-cups, hpijs, and pbm2l2030 should be installed on-demand when hardware requiring those drivers is detected.
+
Packages like gutenprint-cups, hpijs, and foomatic should be installed on-demand when hardware requiring those drivers is detected.
  
 
== Owner ==
 
== Owner ==
Line 15: Line 15:
  
 
* Targeted release: [[Releases/13 | Fedora 13]]  
 
* Targeted release: [[Releases/13 | Fedora 13]]  
* Last Updated: 2010-01-25
+
* Last Updated: 2010-02-17
* Percentage of completion: 80%
+
* Percentage of completion: 100%
  
 
== Detailed Description ==
 
== Detailed Description ==
Line 46: Line 46:
 
Yet another way for a driver to integrate with CUPS is for it to provide a [http://www.cups.org/documentation.php/doc-1.4/man-cups-driverd.html CUPS driver].  This is a program that generates PPD files on demand.  When CUPS runs the program with "list" as its argument, it must write out a list of all the PPDs it is prepared to generate.  In order for the manufacturers and models to be automatically tagged in the RPM package, this list must contain the appropriate Device ID strings.  The gutenprint-cups and foomatic packages have examples of this type of driver.
 
Yet another way for a driver to integrate with CUPS is for it to provide a [http://www.cups.org/documentation.php/doc-1.4/man-cups-driverd.html CUPS driver].  This is a program that generates PPD files on demand.  When CUPS runs the program with "list" as its argument, it must write out a list of all the PPDs it is prepared to generate.  In order for the manufacturers and models to be automatically tagged in the RPM package, this list must contain the appropriate Device ID strings.  The gutenprint-cups and foomatic packages have examples of this type of driver.
  
To ensure a printer driver's binary RPMs are given postscriptdriver() tags, add "BuildRequires: pycups" to the RPM spec file.
+
To ensure a printer driver's binary RPMs are given postscriptdriver() tags, add "BuildRequires: python-cups, cups" to the RPM spec file.
 +
 
 +
Dynamic drivers should ensure they can be executed from within the build root of their source package.  The DESTDIR environment variable will be set when run this way.  The gutenprint package has been patched to use DESTDIR to search for its XML files when the dynamic driver is run, for example.
  
 
== Benefit to Fedora ==
 
== Benefit to Fedora ==
Line 56: Line 58:
 
* All the printer drivers need to report IEEE 1284 Device IDs, including at least the MFG and MDL fields, for the majority of the printers they support.
 
* All the printer drivers need to report IEEE 1284 Device IDs, including at least the MFG and MDL fields, for the majority of the printers they support.
 
** HPLIP and gutenprint (DONE)
 
** HPLIP and gutenprint (DONE)
** Still needed for others such as pbm2l2030 and other small drivers like that
+
** Still needed for others such as pbm2l2030 and other small drivers like that -- but do any of them provide PPDs?
 
* PackageKit needs support for the new tag type (DONE)
 
* PackageKit needs support for the new tag type (DONE)
* RPM needs to be able to add the tags.  Patch ready.
+
* RPM needs to be able to add the tags (DONE)
* system-config-printer needs to be able to install packages for automatically-detected USB printers
+
* system-config-printer needs to be able to install packages for automatically-detected USB printers (DONE)
* system-config-printer needs to be able to install packages for printers when manually adding a queue
+
* system-config-printer needs to be able to install packages for printers when manually adding a queue (DONE)
 +
* gnome-packagekit needs new D-Bus API method (DONE)
 +
* kpackagekit needs same ([https://bugzilla.redhat.com/show_bug.cgi?id=576615 DONE])
 +
* kdeutils-printer-applet needs system service added ([https://bugzilla.redhat.com/show_bug.cgi?id=576660 DONE])
  
 
== How To Test ==
 
== How To Test ==
Line 109: Line 114:
 
== Dependencies ==
 
== Dependencies ==
 
<!-- What other packages (RPMs) depend on this package?  Are there changes outside the developers' control on which completion of this feature depends?  In other words, completion of another feature owned by someone else and might cause you to not be able to finish on time or that you would need to coordinate?  Other upstream projects like the kernel (if this is not a kernel feature)? -->
 
<!-- What other packages (RPMs) depend on this package?  Are there changes outside the developers' control on which completion of this feature depends?  In other words, completion of another feature owned by someone else and might cause you to not be able to finish on time or that you would need to coordinate?  Other upstream projects like the kernel (if this is not a kernel feature)? -->
* rpm ([https://bugzilla.redhat.com/show_bug.cgi?id=538101 bug #538101])
+
* '''DONE''': rpm ([https://bugzilla.redhat.com/show_bug.cgi?id=538101 bug #538101])
* gnome-packagekit ([https://bugzilla.redhat.com/show_bug.cgi?id=558450 bug #558450])
+
* '''DONE''': gnome-packagekit ([https://bugzilla.redhat.com/show_bug.cgi?id=558450 bug #558450])
  
 
== Contingency Plan ==
 
== Contingency Plan ==
Line 120: Line 125:
 
== Documentation ==
 
== Documentation ==
 
<!-- Is there upstream documentation on this feature, or notes you have written yourself?  Link to that material here so other interested developers can get involved. -->
 
<!-- Is there upstream documentation on this feature, or notes you have written yourself?  Link to that material here so other interested developers can get involved. -->
This is it.
+
In addition to this page, some other resources (below) may be helpful.
 +
 
 +
I gave a presentation about this at the [https://www.linuxfoundation.org/collaborate/workgroups/lf/openprinting-summit-san-francisco-2010 OpenPrinting Summit in April 2010].  Read the
 +
[https://www.linuxfoundation.org/sites/main/files/FedoraPrinterConfiguration.pdf slides (PDF)] while listening to the
 +
[http://www.openprinting.org/download/meetingnotes/op-summit-2010/OP-Summit-2010-day2-1-20100415.mp3 audio recording (MP3)] (note the audio is for the entire morning, 3h 7min; my presentation is only the first hour).
 +
 
 +
There is also [http://cups.org/newsgroups.php?s20797+gcups.general+v20816+T0 an email I sent] to the cups.general mailing list.  That link may or may not be stable; if it points to the wrong message look for Mon 24 May 2010, "Searching for a PPD in Driver list".
  
 
== Release Notes ==
 
== Release Notes ==

Latest revision as of 15:02, 26 November 2010

Contents

[edit] Automatic printer driver installation

[edit] Summary

Packages like gutenprint-cups, hpijs, and foomatic should be installed on-demand when hardware requiring those drivers is detected.

[edit] Owner

  • email: twaugh@redhat.com

[edit] Current status

  • Targeted release: Fedora 13
  • Last Updated: 2010-02-17
  • Percentage of completion: 100%

[edit] Detailed Description

All printers, whether connected by parallel port, USB, bluetooth or network, identify themselves using an IEEE 1284 Device ID string. This is a sequence of key:value pairs with, among others, fields for the manufacturer, the model, the command sets supported by the printer.

The idea behind this feature is to add RPM tags to printer driver packages to match up with the manufacturer and model fields used by printers to identify themselves. Once this is done system-config-printer can use PackageKit to install the driver required for a printer when it is connected, or when a queue is set up for it interactively.

The way these RPM tags can be added automatically to printer driver packages is by using a "provides" script. This will look for PPD files, read through them to find a "1284DeviceID" PPD attribute, and parse the IEEE 1284 Device ID string to extract the "MFG" and "MDL" fields. Here is an example of a snippet of a PPD that contains a 1284DeviceID attribute:

*%==== General Information Keywords ========================
*FormatVersion: "4.3"
*FileVersion: "1.03"
*LanguageEncoding: ISOLatin1
*LanguageVersion: English
*Manufacturer: "Brother"
*PCFileName: "BR5250_2.PPD"
*Product: "(Brother HL-5250DN series)"
*PSVersion: "(3010.106) 5"
*ShortNickName: "Brother HL-5250DN BR-Script3"
*ModelName: "Brother HL-5250DN BR-Script3"
*NickName: "Brother HL-5250DN BR-Script3"
*1284DeviceID: "MFG:Brother;MDL:HL-5250DN series;CMD:PJL,PCL,PCLXL,POSTSCRIPT;"

PPD files are the simplest way for a driver to make itself available through CUPS. Another way is to provide a driver information file, and similarly to PPD files these must include a 1284DeviceID attribute for each PPD they define in order for automatic printer driver installation to work. The hpcups driver from the hplip package is an example of this type.

Yet another way for a driver to integrate with CUPS is for it to provide a CUPS driver. This is a program that generates PPD files on demand. When CUPS runs the program with "list" as its argument, it must write out a list of all the PPDs it is prepared to generate. In order for the manufacturers and models to be automatically tagged in the RPM package, this list must contain the appropriate Device ID strings. The gutenprint-cups and foomatic packages have examples of this type of driver.

To ensure a printer driver's binary RPMs are given postscriptdriver() tags, add "BuildRequires: python-cups, cups" to the RPM spec file.

Dynamic drivers should ensure they can be executed from within the build root of their source package. The DESTDIR environment variable will be set when run this way. The gutenprint package has been patched to use DESTDIR to search for its XML files when the dynamic driver is run, for example.

[edit] Benefit to Fedora

Very often the wrong driver is used and bugs are reported about "the" driver not working, when the answer was to install another package. Of course it is also easy to be misled into thinking that there is no driver for a particular model simply because that model does not show in the CUPS model list (that list is built from the information provided by the installed drivers).

[edit] Scope

  • All the printer drivers need to report IEEE 1284 Device IDs, including at least the MFG and MDL fields, for the majority of the printers they support.
    • HPLIP and gutenprint (DONE)
    • Still needed for others such as pbm2l2030 and other small drivers like that -- but do any of them provide PPDs?
  • PackageKit needs support for the new tag type (DONE)
  • RPM needs to be able to add the tags (DONE)
  • system-config-printer needs to be able to install packages for automatically-detected USB printers (DONE)
  • system-config-printer needs to be able to install packages for printers when manually adding a queue (DONE)
  • gnome-packagekit needs new D-Bus API method (DONE)
  • kpackagekit needs same (DONE)
  • kdeutils-printer-applet needs system service added (DONE)

[edit] How To Test

[edit] Connecting a USB printer

Start with the relevant driver package for your printer *not* installed and the printer disconnected.

Connect the printer and power it on.

You may be asked for authentication to install packages.

You should be asked to print a test page.

You must be able to print to the printer.

[edit] Adding a queue manually

Start with the relevant driver package for your printer *not* installed.

Select System->Administration->Printing.

Select a network printer (can be 'Internet Printing Protocol' for another CUPS server).

You may be asked for authentication to install packages.

If a list of drivers is shown, the correct driver should already be selected in the list.

You should be asked to print a test page.

You must be able to print to the printer.

[edit] User Experience

Plugging in a printer just works, whenever this is possible. The LiveCD does not have to ship with printer drivers on it.

[edit] Dependencies

[edit] Contingency Plan

Revert to previous behaviour.

Add foomatic-db-ppds to comps.

[edit] Documentation

In addition to this page, some other resources (below) may be helpful.

I gave a presentation about this at the OpenPrinting Summit in April 2010. Read the slides (PDF) while listening to the audio recording (MP3) (note the audio is for the entire morning, 3h 7min; my presentation is only the first hour).

There is also an email I sent to the cups.general mailing list. That link may or may not be stable; if it points to the wrong message look for Mon 24 May 2010, "Searching for a PPD in Driver list".

[edit] Release Notes

Printer drivers are now installed automatically when a printer is connected.


[edit] Comments and Discussion