From Fedora Project Wiki
(All sections completed.)
(→‎Detailed Description: Fedora 21 note: build requires python3-cups)
 
(27 intermediate revisions by 3 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: 2009-11-06
* Last Updated: 2010-02-17
* Percentage of completion: 20%
* Percentage of completion: 100%


== Detailed Description ==
== Detailed Description ==
<!-- Expand on the summary, if appropriate.  A couple sentences suffices to explain the goal, but the more details you can provide the better. -->
<!-- Expand on the summary, if appropriate.  A couple sentences suffices to explain the goal, but the more details you can provide the better. -->
When a USB printer is connected, it should be possible to use PackageKit to install the driver required for that particular printerSimilarly for network printers when adding a queue for them.
All printers, whether connected by parallel port, USB, bluetooth or network, identify themselves using an IEEE 1284 Device ID stringThis is a sequence of key:value pairs with, among others, fields for the manufacturer, the model, the command sets supported by the printer.


This can be done in a similar way to fonts and multimedia codecsPrinter driver packages can be tagged with the printer's "MFG" and "MDL" fields from its IEEE 1284 Device ID (all printers have these).
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 themselvesOnce 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:
 
<pre>
*%==== 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;"
</pre>
 
PPD files are the simplest way for a driver to make itself available through CUPS.  Another way is to provide a [http://www.cups.org/documentation.php/doc-1.4/ppd-compiler.html 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 [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: python-cups, cups" to the RPM spec file.
 
{{admon/note|Fedora 21|Starting with Fedora 21, this should be "BuildRequires: python3-cups, cups"}}
 
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 32: Line 60:
* 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 85: Line 116:
== 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
* '''DONE''': rpm ([https://bugzilla.redhat.com/show_bug.cgi?id=538101 bug #538101])
* '''DONE''': gnome-packagekit ([https://bugzilla.redhat.com/show_bug.cgi?id=558450 bug #558450])


== Contingency Plan ==
== Contingency Plan ==
<!-- If you cannot complete your feature by the final development freeze, what is the backup plan?  This might be as simple as "None necessary, revert to previous release behaviour."  Or it might not.  If you feature is not completed in time we want to assure others that other parts of Fedora will not be in jeopardy.  -->
<!-- If you cannot complete your feature by the final development freeze, what is the backup plan?  This might be as simple as "None necessary, revert to previous release behaviour."  Or it might not.  If you feature is not completed in time we want to assure others that other parts of Fedora will not be in jeopardy.  -->
None necessary, revert to previous behaviour.
Revert to previous behaviour.
 
Add foomatic-db-ppds to comps.


== 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 ==
Line 104: Line 144:
* See [[Talk:Features/AutomaticPrintDriverInstallation]]  <!-- This adds a link to the "discussion" tab associated with your page.  This provides the ability to have ongoing comments or conversation without bogging down the main feature page -->
* See [[Talk:Features/AutomaticPrintDriverInstallation]]  <!-- This adds a link to the "discussion" tab associated with your page.  This provides the ability to have ongoing comments or conversation without bogging down the main feature page -->


 
[[Category:FeatureAcceptedF13]]
[[Category:FeatureReadyForWrangler]]
<!-- When your feature page is completed and ready for review -->
<!-- When your feature page is completed and ready for review -->
<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->
<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->

Latest revision as of 09:49, 13 October 2014

Automatic printer driver installation

Summary

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

Owner

  • email: twaugh@redhat.com

Current status

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

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.

Note.png
Fedora 21
Starting with Fedora 21, this should be "BuildRequires: python3-cups, cups"

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

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).

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)

How To Test

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.

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.

User Experience

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

Dependencies

Contingency Plan

Revert to previous behaviour.

Add foomatic-db-ppds to comps.

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".

Release Notes

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


Comments and Discussion