Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: IMG on October 06, 2014, 02:36:22 PM

Title: CUPS extension?
Post by: IMG on October 06, 2014, 02:36:22 PM
Just installed piCore on my Raspberry Pi, I am looking for the CUPS package (and possibly hplip too), but they are not found using tce-ab.
I looked at the listing of tcz packages on the web, and they are not there for armv6 - did they fail to build, or is it a design choice? How can I get CUPS onto my Pi...?
Title: Re: CUPS extension?
Post by: bmarkus on October 06, 2014, 03:01:41 PM
Cups and hplip  were not high prioroty apps for RPi. I will make a try to build them. Og course you can build them yourself.
Title: Re: CUPS extension?
Post by: IMG on October 06, 2014, 03:23:11 PM
Thanks for the reply. Happy to have a crack at building them... is there a guide/howto somewhere?
Title: Re: CUPS extension?
Post by: Misalf on October 06, 2014, 03:35:27 PM
http://wiki.tinycorelinux.net/wiki:creating_extensions
Title: Re: CUPS extension?
Post by: angryjack on August 11, 2015, 04:38:23 AM
Hello,

i have a RPi2 and my favorite distro would be TC as it is quick, modular, very small and allows to run in memory instead of SD, that would be the ideal headless server. This server should act as a print data converter which is already running on a 2nd SD running Raspbian.

I would need the following extensions for piCore:

- Ghostscript (mostly part of CUPS package)
- Lighttpd incl. PHP + CGI

I did follow the link which explains howto create own TCZ extensions but for me it looks very complicated...  :P

Title: Re: CUPS extension?
Post by: kabera on August 11, 2015, 10:08:02 PM
I think you are the third person (including me) asking for CUPS ... in vain.

I tried to build it but it had countless dependencies errors and I gave up not knowing when to disable with a parameter to that purpose or when to satisfy the dependency.

bmarkus said he was going to build it but either he is too busy or he tried and failed...
Title: Re: CUPS extension?
Post by: bmarkus on August 12, 2015, 08:44:06 AM
CUPS added to rep, please try and report your findings. Please note there is no startup script, you must start daemon on your own at least in this first release.
Title: Re: CUPS extension?
Post by: angryjack on August 14, 2015, 03:27:42 AM
unfortunately installation does not work with piCore-6.1_v7-SSH image

Code: [Select]
tc@box:~$ tce-load -w -i cups.tcz
acl.tcz.dep OK
dbus.tcz.dep OK
Xorg-7.7-lib.tcz.dep OK
fontconfig.tcz.dep OK
freetype.tcz.dep OK
harfbuzz.tcz.dep OK
krb5.tcz.dep OK
libusb.tcz.dep OK
libudev.tcz.dep OK
Downloading: libudev.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
libudev.tcz          100% |*******************************| 32768   0:00:00 ETA
libudev.tcz: OK
Downloading: libusb.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
libusb.tcz           100% |*******************************| 40960   0:00:00 ETA
libusb.tcz: OK
Downloading: keyutils.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
keyutils.tcz         100% |*******************************| 28672   0:00:00 ETA
keyutils.tcz: OK
Downloading: krb5.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
wget: short write
krb5.tcz: FAILED
md5sum: WARNING: 1 of 1 computed checksums did NOT match
Error on krb5.tcz

I don't see a dependency with ghostscript so will it be installed with CUPS ?



Title: Re: CUPS extension?
Post by: bmarkus on August 14, 2015, 03:32:52 AM
ghostscript is not in the repo and it was not required by cups during build.

Short write means that there are no enough free space for download, partition is full.
Title: Re: CUPS extension?
Post by: angryjack on August 14, 2015, 08:09:32 AM
Thanks for reply bmarkus.

I did expand the filesystem and then the installation finished. So cups should be installed but i cannot find it. I followed the description in the Wiki (http://wiki.tinycorelinux.net/wiki:printer_setup_using_cups) but it does not work, cups seems not to be installed. "tce-load -i /mnt/hda1/tce/optional/cups.tcz" tells "/mnt/hda1/tce/optional/cups is already installed!" but there is no "cups" in /usr/local/etc/init.d which can be started and there is also no /etc/cups/cupsd.conf there, i would assume that it should be, or ?   

One addtional thing: I know it's off-topic but will you be able to add ghostscript also ?
Title: Re: CUPS extension?
Post by: bmarkus on August 14, 2015, 08:16:46 AM
As I told in the beginning, no start script provided, you must start it manually or create your own in this version.
Title: Re: CUPS extension?
Post by: angryjack on August 14, 2015, 09:24:40 AM
As you probably notice i'm fairly new to TC so excuse if i do ask some silly questions. 

Maybe i do misunderstand something in the boot process but if tce-load tells me after boot that CUPS is already installed i should find the cups deamon in "/usr/local/etc/init.d", right ? If so i should also be able to find the cupsd.conf in /etc/cups but there is no cups folder at all. After configuration of cupsd.conf the cups deamon can be started using "/usr/local/etc/init.d/cups start and then i should be able to access the webinterface on "<IP_ADRESS:631>

If i'm wrong please correct me, any help will be appreciated  :)
Title: Re: CUPS extension?
Post by: Misalf on August 14, 2015, 09:36:05 AM
/usr/local/etc/init.d/cups  would be just a script that starts / stops / restarts the daemon.

In 6.x x86, it looks like this:
Code: [Select]
#!/bin/sh

start() {
if [ ! -f /var/run/dbus/cups_flag ]; then
/usr/local/etc/init.d/dbus restart
touch /var/run/dbus/cups_flag
fi
if ! pidof cupsd >/dev/null; then
start-stop-daemon --start --exec /usr/local/sbin/cupsd 2>/dev/null
fi
}

stop() {
start-stop-daemon --stop --exec /usr/local/sbin/cupsd 2>/dev/null
sleep 2
}

status() {
if pidof cupsd >/dev/null; then
echo -e "\ncups is running.\n"
exit 0
else
echo -e "\ncups is not running.\n"
exit 1
fi
}

case $1 in
start) start
;;
stop) stop
;;
status) status
;;
restart) stop; start
;;
*) echo -e "\n$0 [start|stop|restart|status]\n"
;;
esac

Title: Re: CUPS extension?
Post by: kabera on August 16, 2015, 04:04:27 AM
start-stop-daemon --start --exec /usr/local/sbin/cupsd
reports no errors
but then
ps -e |grep cups
shows nothing running...
samething running directly the cupsd binary
Title: Re: CUPS extension?
Post by: bmarkus on August 16, 2015, 08:35:07 AM
I see where the problem is. Will fix it.
Title: Re: CUPS extension?
Post by: kabera on August 20, 2015, 03:50:02 PM
Thanks bmarkus, let us know when you have something to try!
I have a printer I would love to hook to a tinycore rasp to turn it into a network printer for the whole household
Title: Re: CUPS extension?
Post by: angryjack on September 01, 2015, 04:16:37 AM
Hello bmarkus,

do you have any progess with this issue ?  ;)
Title: Re: CUPS extension?
Post by: angryjack on September 12, 2015, 09:01:19 AM
Hi there,

seems to be that bmarkus is very busy. Anybody here to help gettin CUPS working?
Title: Re: CUPS extension?
Post by: angryjack on September 24, 2015, 08:01:18 AM
I don't give up  ;)

Please make it possible to find the time to get CUPS running on PiCore !
Title: Re: CUPS extension?
Post by: jncl on September 25, 2015, 08:10:39 PM
Hi,

  I've done some work to get cups working on a Pi B+ with 7.0alpha6 (4.1.7-piCore+). It should work on other Pi h/w and earlier versions of piCore. I've made some assumptions, namely that the cups extension to be used is v2.0.4 and that both the cups and cups-doc extensions are available for the version of piCore you are intending to run.

  I have tested this on the h/w & s/w mentioned above and I am able to access the Web Interface successfully. I haven't tried to add any printers etc so don't know if there is anything else required, but at least it's a start ;)

Code: [Select]
#!/bin/sh

# get x86 version of cups
cd $HOME
wget -c http://repo.tinycorelinux.net/6.x/x86/tcz/cups.tcz
# mount it for access
sudo mkdir -p /tmp/tcloop/cups_x86
sudo mount cups.tcz /tmp/tcloop/cups_x86 -t squashfs -o loop,ro,bs=4096

# copy config files
sudo mkdir -p /usr/local/etc/cups
sudo cp /tmp/tcloop/cups_x86/usr/local/etc/cups/cups-files.conf /usr/local/etc/cups/cups-files.conf
sudo cp /tmp/tcloop/cups_x86/usr/local/etc/cups/cupsd.conf.default /usr/local/etc/cups/cupsd.conf

# edit the cups-files.conf to correct directory names and uncomment variables
sudo sed -i "s#/var/#/usr/local&#g; s/#CacheDir/CacheDir/; s/#RequestRoot/RequestRoot/; s/#StateDir/StateDir/; s/#TempDir/TempDir/" /usr/local/etc/cups/cups-files.conf

# copy startup script
sudo cp /tmp/tcloop/cups_x86/usr/local/etc/init.d/cups /usr/local/etc/init.d/cups

# add startup script to /opt/bootlocal.sh
echo -e "\n/usr/local/etc/init.d/cups start\n" >> /opt/bootlocal.sh

# unmount x86 version and remove file
sudo umount -d /tmp/tcloop/cups_x86
rm -f cups.tcz

# install missing doc files
tce-load -wi cups-doc

# since v1.7.4 of cups symlinks aren't allowed
# so replace them with the actual files
for f in apple-touch-icon.png cups-printable.css cups.css index.html; do
[ -h /usr/local/share/doc/cups/$f ] && sudo rm -f /usr/local/share/doc/cups/$f
sudo cp /tmp/tcloop/cups-doc/usr/local/share/doc/cups/$f /usr/local/share/doc/cups/$f
done

# make sure these files are backed up
echo usr/local/etc/cups >> /opt/.filetool.lst
echo usr/local/etc/init.d/cups >> /opt/.filetool.lst
echo usr/local/share/doc/cups >> /opt/.filetool.lst

# backup all the changes
filetool.sh -b

Then follow these steps:
1. Copy the code into a file, /home/tc/cups_fix.sh, on the Raspberry Pi and ensure it's executable.
Code: [Select]
chmod +x /home/tc/cups_fix.shcups_fix.sh2. Run /home/tc/cups_fix.shcups_fix.sh and Reboot the Pi when it completes.
3. For headless access from another computer
Code: [Select]
ssh tc@<ip_address_of_pi_with_cups> -T -L 3631:localhost:631
4. Point your Browser to localhost:631, or localhost:3631 if headless, and the Web Interface will appear.

If you have any issues with the code, or these instructions, I'll try to help.

  Jon
Title: Re: CUPS extension?
Post by: boat-bum on October 10, 2015, 01:50:21 PM
JNCL (Jon) thank you so much for this script.  I did each step manually and it worked great. 

I wanted to do remote administration so I did the
>sudo cupsctl --remote-admin

One issue I have is that any attempt to add a printer, I get "Forbidden".  I edited the cupsd.conf and cups-files.conf to allow pretty much everything and still get the issue.  I tried a bunch of stuff, including file permissions and groups until I looked in the /usr/local/var/log/cups/error_log

E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address [v1.::]:631 - Address family not supported by protocol.
E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address /var/run/cups/cups.sock:0 - No such file or directory.
E [09/Oct/2015:18:33:39 +0000] [Client 8] Returning HTTP Forbidden for CUPS-Get-Devices (no URI) from localhost
E [09/Oct/2015:18:33:39 +0000] [CGI] CUPS-Get-Devices request failed with status 401: Forbidden

I changed my cupsd.conf to point to localhost:631 but get:
E [10/Oct/2015:17:24:20 +0000] Unable to open listen socket for address [v1.::1]:631 - Address already in use.
E [10/Oct/2015:17:24:20 +0000] Unable to open listen socket for address 127.0.0.1:631 - Address already in use.
E [10/Oct/2015:17:25:02 +0000] [Client 6] Returning HTTP Forbidden for CUPS-Get-Devices (no URI) from localhost
E [10/Oct/2015:17:25:02 +0000] [CGI] CUPS-Get-Devices request failed with status 401: Forbidden

IP address or machine name result in the same address already in use

0.0.0.0 results in Duplicate listen address "0.0.0.0" ignored.

Any pointers on how to result this issue would be greatly appreciated.

Thanks
Brent
Title: Re: CUPS extension?
Post by: Rich on October 10, 2015, 09:14:44 PM
Hi boat-bum
Quote
E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address [v1.::]:631 - Address family not supported by protocol.
Just a guess on my part, but that looks like an IP6 address it's complaining about. Maybe you need to install ipv6?
Title: Re: CUPS extension?
Post by: nitram on October 10, 2015, 11:21:21 PM
No idea but this is from the cups info file. Did you 'sudo passwd'?

                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
                $ sudo passwd
                http://localhost:631 will start the browser interface
                To persist across boots, add the following to your backup (remove leading "/"):
                /usr/local/etc/cups/ppd/HP_OfficeJet_G85.ppd [for example]
                /usr/local/etc/cups/printers.conf
                /usr/local/etc/cups/cupsd.conf (only if you changed it)
                /etc/shadow (if you want to save to root password
Title: Re: CUPS extension?
Post by: boat-bum on October 11, 2015, 11:44:03 PM
nitram - I didn't see that so that definitely got me further.  Thank you very much.  I saw in one of the other cupsd.conf that you weren't supposed to use a userid with a uid of 0.

I was not able to get it to recognize any network printers and now get:
 CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
Title: Re: CUPS extension?
Post by: nitram on October 12, 2015, 12:46:34 AM
// ...that definitely got me further.  Thank you very much.
No problem, sorry i can't help more. Have yet to set up a printer myself in TC, will learn from you :)

Forgot to mention from one of your posts above:
E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address [v1.::]:631 - Address family not supported by protocol.

Odd date, maybe confirm the output of 'date & cal' is OK.
Title: Re: CUPS extension?
Post by: Juanito on October 12, 2015, 02:32:27 AM
CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files

Quote
E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address [v1.::]:631 - Address family not supported by protocol.

You can ignore both of these messages (unless you use ipv6).

What make and model of printer do you have and how is it connected to your network?
Title: Re: CUPS extension?
Post by: Juanito on October 12, 2015, 03:13:56 AM
As a test, albeit using corepure64:
Code: [Select]
$ tce-load -i hplip [loads cups, ghostscript, libusb, net-snmp, dbus-python, libsane, libavahi, cups-filters and a few others]

$ sudo passwd [set root password]
$ sudo /usr/local/etc/init.d/cups start

then:
* open fifth browser, enter http://localhost:631/
* click "administration" [asks for username(root)/password]
* click "add printer" [shows "Discovered Network Printers: Officejet 6700 Premium e-All-in-One (HP Officejet 6700)"]
[Connection: socket://192.168.1.170:9100]
click "add" [proposes driver for model HP Officejet 6700, hpcups 3.13.11 (en)]
click "add"
click "Maintenance/"Print Test Page"

Entire contents of log:
Code: [Select]
$ cat /var/log/cups/error_log
E [12/Oct/2015:10:41:39 +0000] Unable to open listen socket for address [v1.::1]:631 - Address family not supported by protocol.
E [12/Oct/2015:10:43:46 +0000] [cups-deviced] PID 4887 (dnssd) stopped with status 1!
E [12/Oct/2015:10:43:47 +0000] [cups-deviced] PID 4877 (hpfax) stopped with status 1!
W [12/Oct/2015:10:47:20 +0000] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files

/usr/local/etc/cups/{cups-browserd.conf, cups-files.conf, cupsd.conf} are all unchanged defaults

I'm not sure if the Raspberry Pi cups was compiled with support for libavahi, with cups-filters or configured with "--with-cups-user=tc --with-cups-group=staff", all of which might make a difference?
Title: Re: CUPS extension?
Post by: boat-bum on October 12, 2015, 10:24:57 AM
nitram - yes some of the messages have the old date but others have the correct one.

Juanito - thank you for the info.  Since I am not using IPv6, it is nice to know I don't have to worry about those messages.

hplip was not found so I tried to load the packages individually.  libsane, libavahi, cups-filter were also not found so it looks like tiny core might have limitations.  That is a shame since piCore would make the perfect Airprint server.
Title: Re: CUPS extension?
Post by: Juanito on October 12, 2015, 10:56:49 AM
You'll only need hplip if you have an hp printer and only need libsane if you use hplip.

cups might need to be compiled against libavahi and require cups-filters for automatic network printer browsing to be enabled, but you should still be able to connect directly without them by entering an address of the form "socket://192.168.1.170:9100" or similar.
Title: Re: CUPS extension?
Post by: boat-bum on October 12, 2015, 11:25:16 AM
I have an HP Laserjet 4050 printer.  Corporate downsizing does have some benefits.

Doing Appsocket/JetDirect (socket://192.168.1.40:9100) with several different options for configuring the printer, but always get:
Unsupported format "application/vnd.cups-banner"

In error log:
E [12/Oct/2015:15:19:34 +0000] [Client 26] Returning IPP client-error-document-format-not-supported for Print-Job (ipp://localhost:631/printers/Brd) from localhost
Title: Re: CUPS extension?
Post by: Juanito on October 12, 2015, 12:40:03 PM
I suspect this error is due to missing ghostscript or, if ghostscript is present, it might have been compiled without cups support.

Failing that, cups-filters might be needed.
Title: Re: CUPS extension?
Post by: beerstein on December 11, 2015, 03:41:46 PM
hi there:
I installed cups ans dbus, but I can not find the cups server in /usr/local/etc/init.d/cups

How can I install a printer in piCore