Tiny Core Linux

Tiny Core Extensions => TCE News => TCE 2.x => Topic started by: Juanito on September 16, 2009, 08:25:13 AM

Title: cups
Post by: Juanito on September 16, 2009, 08:25:13 AM
cups.tczl posted

As something of a test, a start-up script has been added to start the cups daemon when the extension is loaded. This will only work if the following extensions are loaded in the following order:

expat2.tczl
dbus.tczl
libcups.tczl
cups.tczl

Note:
1. For versions of tc earlier than 2.4rc1, if the above extensions are placed in /tce, the dbus and cups daemons will not start on boot as the boot process loads the extensions in alphabetical order.
2. If the above extensions and cups.tczl.dep are placed in /tce/optional (or any other folder) and the appbrowser is used to load cups.tczl, then the dbus and cups daemons will start.

Note also:
The cups.tcel extension has not been modified.

Code: [Select]
Title:          cups.tczl
Description:    cups printing system
Version:        1.4.0
Author:         see list of sites below
Original-site:  see list of sites below
Copying-policy: see list of sites below
Size: 2.91MB
Extension_by:   juanito
Comments:       cups, the standards-based, open source printing system..
                ..developed by Apple Inc. for Mac OS X and other UNIX-like..
                ..operating systems
                ----------
                requires the expat2, dbus and libcups extensions
                if the expat2, dbus and libcups extensions are loaded in..
                that order, the cups daemon will automatically start.
                ----------
                howto:
                the root password needs to be set perform admin tasks with..
                ..the browser interface
                http://localhost:631 will start the browser interface
                To persist across boots, add the following to your backup:
                /etc/cups/printers.conf
                /etc/cups/cupsd.conf (only if you changed it)
                ----------
                This extension contains:
                cups-1.4.0 - GPLv2 - http://ftp.easysw.com/pub/cups/1.4.0/cups-1.4.0-source.tar.bz2
Change-log:     2008/09/06
                Updated menu item/icon
                Added smb backend for samba
                Added cups windows drivers in /usr/local/share/cups/drivers
                2009/01/30
                Modified foomatic filters for perl in /usr/local/bin
                2009/03/13
                upgraded to cups-1.4 and added start-up script
                compiled to use dynamic printer drivers
                removed foomatic-rip, split out libcups
Current:        2009/09/16
Title: Re: cups
Post by: perthie on September 21, 2009, 01:18:08 PM
How should this work in 2.4rc1? When I try to add a printer, the Add Printer dialog is duplicated on the web page and the top half is hung up with "Looking for Printers...".
Title: Re: cups
Post by: Juanito on September 21, 2009, 01:59:58 PM
What kind of printer are you using - usb, parallel, network connected?

I tested with two different hp usb printers via hplip and the printers were found automatically. If you go to the next screen, you can enter a uri manually.
Title: Re: cups
Post by: perthie on September 21, 2009, 02:30:49 PM
I have both a local USB printer and a networked printer. CUPS 1.4 can't detect either, while 1.3.8 detects and sets up both.  When I manually set up the networked printer and try a test page, it comes out blank. This is a clean install of TC 2.4rc1 with the extensions loading into RAM. I can see the dbus daemon running.

BTW, Ghostscript is not listed as a dependency.

I brought cups.1.3.8 over from TC 2.3.1 and it works fine.






Title: Re: cups
Post by: perthie on September 21, 2009, 02:52:43 PM
Correction: The network printer was detected. The hangup seems to be with finding USB devices.

Also, the folder /usr/local/lib/cups has been given tc:staff ownership.  CUPS 1.4 complains if the printer filters are not owned by root.

Title: Re: cups
Post by: Juanito on September 21, 2009, 11:34:49 PM
Correction: The network printer was detected. The hangup seems to be with finding USB devices.
Ah - that could be because I didn't put usb-utils as a dep. could you try again with usb-utils loaded? Does the network printer work now (perhaps with gs loaded)?

Quote
Also, the folder /usr/local/lib/cups has been given tc:staff ownership.  CUPS 1.4 complains if the printer filters are not owned by root.

I didn't change anything in terms of ownwership - note that user/group is set as tc/staff in the cups ./configure
Title: Re: cups
Post by: jpeters on September 22, 2009, 12:45:02 AM
Correction: The network printer was detected. The hangup seems to be with finding USB devices.
Ah - that could be because I didn't put usb-utils as a dep. could you try again with usb-utils loaded? Does the network printer work now (perhaps with gs loaded)?

Quote
Also, the folder /usr/local/lib/cups has been given tc:staff ownership.  CUPS 1.4 complains if the printer filters are not owned by root.

I didn't change anything in terms of ownwership - note that user/group is set as tc/staff in the cups ./configure

For cups.tczl it's root:staff
Title: Re: cups
Post by: Juanito on September 22, 2009, 12:52:24 AM
One other thing to note is that I have tested this latest version of cups with cups printer drivers as opposed to ppd files.

For this reason, the latest cups extension no longer contains foomatic-rip (although I have compiled, but not posted, the "C" version that depends on libgs) - I don't think this would affect the discovery of usb connected printers, but you might need to hunt down the cups driver for your printer.
Title: Re: cups
Post by: perthie on September 22, 2009, 07:55:00 AM
I would recommend that the new repo for TC 2.4 have two printer packages - the reliable CUPS 1.3.8 that supports a wide range of printers, and the experimental CUPS 1.4.

BTW, it is possible to compile HPLIP for CUPS 1.3.x with dynamic PPDs.

Title: Re: cups
Post by: Juanito on September 22, 2009, 09:17:28 AM
I would recommend that the new repo for TC 2.4 have two printer packages - the reliable CUPS 1.3.8 that supports a wide range of printers, and the experimental CUPS 1.4

I take it you didn't have any luck with cups-1.4 finding your usb printer?

We could do as you suggest for cups-1.3.8 once tc-2.4 is final - the tcel extension is still availble.

I just finished compiling cups-1.4.1, which apparently fixes a couple of usb bugs...
Title: Re: cups
Post by: Juanito on September 22, 2009, 09:43:30 AM
updated cups posted:
Code: [Select]
Title:          cups.tczl
Description:    cups printing system
Version:        1.4.1
Author:         see list of sites below
Original-site:  see list of sites below
Copying-policy: see list of sites below
Size: 2.91MB
Extension_by:   juanito
Comments:       cups, the standards-based, open source printing system..
                ..developed by Apple Inc. for Mac OS X and other UNIX-like..
                ..operating systems
                ----------
                requires the expat2, dbus and libcups extensions
                if the expat2, dbus and libcups extensions are loaded in..
                that order, the cups daemon will automatically start.
                ----------
                howto:
                the root password needs to be set perform admin tasks with..
                ..the browser interface
                http://localhost:631 will start the browser interface
                To persist across boots, add the following to your backup:
                /etc/cups/printers.conf
                /etc/cups/cupsd.conf (only if you changed it)
                ----------
                This extension contains:
                cups-1.4.1 - GPLv2 - http://ftp.easysw.com/pub/cups/1.4.1/cups-1.4.1-source.tar.bz2
Change-log:     2008/09/06
                Updated menu item/icon
                Added smb backend for samba
                Added cups windows drivers in /usr/local/share/cups/drivers
                2009/01/30
                Modified foomatic filters for perl in /usr/local/bin
                2009/03/13
                upgraded to cups-1.4 and added start-up script
                compiled to use dynamic printer drivers
                removed foomatic-rip, split out libcups
                2009/09/16
                updated 1.4 -> 1.4.1, moved /etc/cups -> /usr/local
Current:        2009/09/22
Title: Re: cups
Post by: Juanito on September 22, 2009, 10:01:56 AM
..and it seems there is still a problem with usb printers and cups-1.4.1.

I cannot test this as both of my printers use the "hp" backend, but several people have suggested "sudo rmmod usblp" before starting cups.
Title: Re: cups
Post by: Juanito on October 09, 2009, 06:49:34 AM
I updated the extension by adding back the smb backend symlink to samba that got lost from the previous extension.

I tested the latest extension in two ways:

1. Directly connected to an hp usb all-in-one printer using cups+hplip

the cups browser interface finds the printer automatically and prints without problems.

2. Remotely connected to the same all-in-one printer shared by cups over a local network.

the cups browser interface does not find the shared printer, but the following command added the shared printer, which printed without problems thereafter:
Code: [Select]
$ sudo lpadmin -p OfficeJetG85 -E -v ipp://192.168.1.100/printers/OfficeJetG85note that an error in cupsd.conf may be preventing the browser interface from seeing the shared printer.

As the cups usb backend cannot print to hp all-in-one printers, I cannot test it, so I'd appreciate feedback from users with usb printers.

To aid in trouble-shooting, here's what I get for a number of related commands:
Code: [Select]
$ lsmod | grep usb
usblp                   6556  0

$ lsusb
...
Bus 004 Device 003: ID 03f0:0211 Hewlett-Packard OfficeJet G85

$ ls -l /dev/bus/usb/*/*
...
crw-rw-r--    1 tc       staff    189, 385 Oct  9 13:18 /dev/bus/usb/004/003

$ /usr/local/lib/cups/backend/hp
direct hp:/usb/OfficeJet_G85?serial=SGG13E0C49VL "HP OfficeJet G85" "HP OfficeJet
G85 USB SGG13E0C49VL HPLIP" "MFG:Hewlett-Packa;MDL:OfficeJetG85;
CLS:PRINTER;DES:OfficeJet G85;SN:SGG13E0C49VL;"

$ sudo /usr/local/lib/cups/backend/usb [cups-1.4.1 usblp loaded or unloaded]
DEBUG: list_devices
DEBUG: usb_find_busses=5
DEBUG: usb_find_devices=12

$ sudo /usr/local/lib/cups/backend/usb [cups-1.3.8 usblp loaded]
direct usb://HP/OfficeJet%20G85?serial=SGG13E0C49VL "HP OfficeJet G85" "HP
OfficeJet G85 USB #1" "MFG:Hewlett-Packard;MDL:OfficeJetG85;
CMD:MLC,PCL,PML,SCL;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard OfficeJet G
Series;1284.3M:f7f,f7f;1284.4DL:4d,4e,1;SERN:SGG13E0C49VL;VSTATUS:$HB0$NC0ff,
DN,IDLE,CUT,K1,C0,SM,NR,KP000,CP029;AiO:0;DW-PCL;"

Code: [Select]
Title:          cups.tczl
Description:    cups printing system
Version:        1.4.1
Author:         see list of sites below
Original-site:  see list of sites below
Copying-policy: see list of sites below
Size: 2.91MB
Extension_by:   juanito
Comments:       cups, the standards-based, open source printing system..
                ..developed by Apple Inc. for Mac OS X and other UNIX-like..
                ..operating systems
                ----------
                requires the expat2, dbus and libcups extensions
                if the expat2, dbus and libcups extensions are loaded in..
                that order, the cups daemon will automatically start.
                ----------
                howto:
                the root password needs to be set perform admin tasks with..
                ..the browser interface
                http://localhost:631 will start the browser interface
                To persist across boots, add the following to your backup:
                /usr/local/etc/cups/ppd/HP_OfficeJet_G85.ppd [for example]
                /etc/cups/printers.conf
                /etc/cups/cupsd.conf (only if you changed it)
                ----------
                This extension contains:
                cups-1.4.1 - GPLv2 - http://ftp.easysw.com/pub/cups/1.4.1/cups-1.4.1-source.tar.bz2
Change-log:     2008/09/06
                Updated menu item/icon
                Added smb backend for samba
                Added cups windows drivers in /usr/local/share/cups/drivers
                2009/01/30
                Modified foomatic filters for perl in /usr/local/bin
                2009/03/13
                upgraded to cups-1.4 and added start-up script
                compiled to use dynamic printer drivers
                removed foomatic-rip, split out libcups
                2009/09/16
                updated 1.4 -> 1.4.1, moved /etc/cups -> /usr/local
                2009/09/22
                added samba backend symlink
Current:        2009/10/09
Title: Re: cups
Post by: perthie on October 09, 2009, 10:20:07 AM
Quote
As the cups usb backend cannot print to hp all-in-one printers, I cannot test it, so I'd appreciate feedback from users with usb printers.

I tried compiling CUPS 1.3.11, which I have done successfully in Puppy. But when I ran it in TC, I had the same problem as your CUPS 1.4 - USB printers are not detected.

When the Puppy team upgraded CUPS from 1.1x to 1.3x, there was an issue with udev rules. I tried to duplicate those rules in TC, without success.

When I check lsusb, my USB printer is listed, but CUPS cannot see it.  The device node /dev/usb/lp0 is present.  IIRC, it was necessary for the node to have "0666" permissions.

CUPS 1.3.8 DOES detect my printer.

Title: Re: cups
Post by: Juanito on October 09, 2009, 11:24:05 AM
did you compile with "--cups-user=tc --cups-group=staff"?

I just compiled cups-1.3.11 and the usb backend gave the same output as cups-1.3.8, which would tend to indicate that it would work.
Title: Re: cups
Post by: perthie on October 09, 2009, 12:30:33 PM
Quote
--with-cups-user=tc --with-cups-user=staff

That works! It's not a udev issue at all.

[Edit] I've tested CUPS 1.3.11 with a variety of printers, protocols and drivers. It looks good.

This package will auto-start and does not need a login.

Thanks for your help.
Title: Re: cups
Post by: Onyarian on October 13, 2009, 11:36:28 AM
I have download today the cups.tczl with appbrowser and there is an error in the md5sum

md5sum cups.tczl
fad93c21016af32cd140d8d7551264bd  cups.tczl

cups.tczl.md5.txt
c47db4636e0a68b874ef35f5b8c071fc  cups.tczl

Title: Re: cups
Post by: Juanito on October 13, 2009, 02:11:40 PM
Thanks - I uploaded it again (my home internet connection is terrible at the moment) and it checks out OK.
Title: Re: cups
Post by: jpeters on October 14, 2009, 05:38:58 AM
samba link works; needs that extra /cups start to get it going.   
Title: Re: cups
Post by: Juanito on October 14, 2009, 06:21:03 AM
needs that extra /cups start to get it going.   

Yeah, I still don't know what that's about  :(
Title: Re: cups
Post by: jls on October 26, 2009, 04:32:21 AM
when I open http://localhost:631 which user should I put when the browser asks me?

[^thehatsrule^: removed spam]
Title: Re: cups
Post by: jpeters on October 26, 2009, 04:35:56 AM
when I open http://localhost:631 which user should I put when the browser asks me?

[^thehatsrule^: removed spam]

root
Title: Re: cups
Post by: Juanito on October 26, 2009, 05:12:16 AM
There's also a post somewhere by perthie explaining how to modify cupsd.conf so that the username/password is not requested.
Title: Re: cups
Post by: perthie on October 26, 2009, 08:00:24 AM
The extension cups1311.tczl uses a cupsd.conf that does not require logins. It is based on the familiar CUPS 1.3 series.
Title: Re: cups
Post by: Juanito on November 02, 2009, 10:35:19 AM
balance of cups libs moved out of this extension to libcups and reposted as cups.tcz:
Code: [Select]
Title:          cups.tcz
Description:    cups printing system
Version:        1.4.1
Author:         see list of sites below
Original-site:  see list of sites below
Copying-policy: see list of sites below
Size: 2.79MB
Extension_by:   juanito
Comments:       cups, the standards-based, open source printing system..
                ..developed by Apple Inc. for Mac OS X and other UNIX-like..
                ..operating systems
                ----------
                requires the expat2, dbus and libcups extensions
                if the expat2, dbus and libcups extensions are loaded in..
                that order, the cups daemon will automatically start.
                ----------
                howto:
                the root password needs to be set perform admin tasks with..
                ..the browser interface
                http://localhost:631 will start the browser interface
                To persist across boots, add the following to your backup:
                /usr/local/etc/cups/ppd/HP_OfficeJet_G85.ppd [for example]
                /etc/cups/printers.conf
                /etc/cups/cupsd.conf (only if you changed it)
                ----------
                This extension contains:
                cups-1.4.1 - GPLv2 - http://ftp.easysw.com/pub/cups/1.4.1/cups-1.4.1-source.tar.bz2
                ----------
Change-log:     2008/09/06
                Updated menu item/icon
                Added smb backend for samba
                Added cups windows drivers in /usr/local/share/cups/drivers
                2009/01/30
                Modified foomatic filters for perl in /usr/local/bin
                2009/03/13
                upgraded to cups-1.4 and added start-up script
                compiled to use dynamic printer drivers
                removed foomatic-rip, split out libcups
                2009/09/16
                updated 1.4 -> 1.4.1, moved /etc/cups -> /usr/local
                2009/09/22
                added samba backend symlink
                2009/10/09
                moved all libs to libcups extension
Current:        2009/11/02
Title: Re: cups
Post by: Juanito on February 20, 2010, 10:52:02 PM
re-worked the cups init.d script and removed automatic start from the start-up script:
Code: [Select]
Title:          cups.tcz
Description:    cups printing system
Version:        1.4.1
Author:         see list of sites below
Original-site:  see list of sites below
Copying-policy: see list of sites below
Size: 3.2MB
Extension_by:   juanito
Comments:       cups, the standards-based, open source printing system..
                ..developed by Apple Inc. for Mac OS X and other UNIX-like..
                ..operating systems
                ----------
                requires the expat2, dbus and libcups extensions
                ----------
                howto:
                $ sudo /usr/local/etc/init.d/cups [start|stop|restart|status]
                the root password needs to be set perform admin tasks with..
                ..the browser interface
                http://localhost:631 will start the browser interface
                To persist across boots, add the following to your backup:
                /usr/local/etc/cups/ppd/HP_OfficeJet_G85.ppd [for example]
                /etc/cups/printers.conf
                /etc/cups/cupsd.conf (only if you changed it)
                ----------
                This extension contains:
                cups-1.4.1 - GPLv2 - http://ftp.easysw.com/pub/cups/1.4.1/cups-1.4.1-source.tar.bz2
                ----------
Change-log:     2008/09/06
                Updated menu item/icon
                Added smb backend for samba
                Added cups windows drivers in /usr/local/share/cups/drivers
                2009/01/30
                Modified foomatic filters for perl in /usr/local/bin
                2009/03/13
                upgraded to cups-1.4 and added start-up script
                compiled to use dynamic printer drivers
                removed foomatic-rip, split out libcups
                2009/09/16
                updated 1.4 -> 1.4.1, moved /etc/cups -> /usr/local
                2009/09/22
                added samba backend symlink
                2009/10/09
                moved all libs to libcups extension
                2009/11/02
                removed autostart from start-up script
Current:        2010/02/18
Title: Re: cups
Post by: curaga on May 05, 2010, 06:17:59 AM
Stumbled across this:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/420015

Looks like the cups 1.4 usb backend collides with the kernel's usblp module.