maurerr / Entware-backports

Entware-backports
GNU General Public License v2.0
8 stars 2 forks source link

CUPS printing stack #1

Closed davygravy closed 5 years ago

davygravy commented 5 years ago

Hi maurer,

Working with ryzhovau I helped to find and fix a few problems with the CUPS Printing stack as it currently exists in Entware (underneath OpenWRT). Reference : https://github.com/Entware/Entware/issues/270

I'm not sure if they made their way down to you yet...

  1. ghostscript was missing a device for CUPS : https://github.com/Entware/rtndev/commit/c89550308444cc7820beaafa05a4b99d824d807a

  2. cups-filters was missing some components for full support of USB printers and interaction with CUPS webif: https://github.com/Entware/rtndev/commit/abe03767f3557e951ca2f9c13c074fd199e6707

  3. fonts were missing but needed by cups-filters: https://github.com/Entware/rtndev/commit/bdc3fd15d8157d8604b0daf83f1671764c928035 https://github.com/Entware/rtndev/commit/3b1b7ea7126b0883cc9ca77d6f05c811085503a6

  4. I believe that somewhere there is a commit to also reinstate dejavu-fonts-ttf https://github.com/openwrt/packages/blob/master/fonts/dejavu-fonts-ttf/Makefile

Hopefully this will make CUPS printing work out-of-the-box in Entware-backports as it now does in Entware.

Of course, if you build these in the package feed, I'll be happy to test them.

maurerr commented 5 years ago

Hi Dave,

it's fixed in https://github.com/maurerr/rtndev/commit/adef79a32cfe08d408084bc1fb9ddd7f8b591ecb Please check my repo for the updated packages http://maurerr.github.io/packages/

davygravy commented 5 years ago

Hola maurerr,

Working on this now, seeing dep problem on two items... different in nature (list and comments below):

 * satisfy_dependencies_for: Cannot satisfy the following dependencies for cups-filters:
 *  dejavu-fonts-ttf-DejaVuSans *   dejavu-fonts-ttf-DejaVuSansMono * 
 * opkg_install_cmd: Cannot install package cups-filters.
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for hplip-full:
 *  libv4l * 
 * opkg_install_cmd: Cannot install package hplip-full.

A. dejavu-fonts-ttf-DejaVuSans : It may be that a link is broken (see issue #2 that I'm posting), filename incorrect or file doesn't exist (there). I built it locally and installed it as dejavu-fonts-ttf-DejaVuSans_2.37-1_mipselsf.ipk , which made cups-filters happy again.

B. libv4l : IIRC, hplip deps on sane deps on libv4l . I'm actually running the toolchain right now so maybe I can build this package locally, or at least see why it did not build or end up in the feed. I downloaded it from the old NG feed and installed it with --force-checksum and that yielded a:

* opkg_download: Failed to download http://pkg.entware-backports.tk/packages/sane-libs_1.0.27-2_mipselsf.ipk, wget returned 3.
 * opkg_install_pkg: Failed to download sane-libs. Perhaps you need to run 'opkg update'?

Eventually I got them all installed by downloading them to /opt/tmp/ and then opkg install locally...

cups-filters_1.22.1-4_mipselsf.ipk                   libcups_2.2.10-1_mipselsf.ipk
cups_2.2.10-1_mipselsf.ipk                           libv4l_0.8.6-2_mipselsf.ipk
dejavu-fonts-ttf-DejaVuSansMono_2.37-1_mipselsf.ipk  sane-backends_1.0.27-2_mipselsf.ipk
dejavu-fonts-ttf-DejaVuSans_2.37-1_mipselsf.ipk      sane-frontends_1.0.27-2_mipselsf.ipk
ghostscript_9.26-2_mipselsf.ipk                      sane-libs_1.0.27-2_mipselsf.ipk
hplip-full_3.18.12-1a_mipselsf.ipk

I'll try to build the libv4l package.

Also during this I saw a permissions problem regarding sane-backends:

root@ShareMaxN300:/opt/tmp# /opt/etc/init.d/rc.unslung start
/opt/etc/init.d/S01sane-backends: line 7: can't create /etc/services: Read-only file system

This may be a configuration problem (hopefully not hardcoded!) that can be fixed in /opt/etc/hplip or some such place... I'm not sure if this is already fixed upstream.

davygravy commented 5 years ago

Mistaken on something here... the libv4l -did- in fact help, but still hplip complains:

* opkg_download: Failed to download http://pkg.entware-backports.tk/packages/python-logging_2.7.15-5_mipselsf.ipk, wget returned 3.
 * opkg_install_pkg: Failed to download python-logging. Perhaps you need to run 'opkg update'?
 * opkg_install_cmd: Cannot install package hplip-full.

Will try to force install this as I need the driver ... for my USB HP printer...

davygravy commented 5 years ago

Progressing, all the packages install. It looks like perhaps poppler/libpoppler might need an update or need to be rerolled...

D [02/May/2019:16:36:44 -0500] [Job 2] /opt/lib/cups/filter/pdftopdf: can\'t load library \'libpoppler.so.85\'
D [02/May/2019:16:36:44 -0500] [Job 2] /opt/lib/cups/filter/gstoraster: can\'t load library \'libpoppler.so.85\'

I patched it in situ with a symlink to libpoppler.so.83 which made things OK again.

So, it works... tested with the CUPS webif Print Testpage button and also via command line with echo test | lp.

To me it just looks like

================= PS/Afterthought: I think the sane-backends error is bogus, since the Entware build of hplip is non-networked (in configure: --disable-network-build ). /opt/etc/init.d/S01sane-backends says:

#!/bin/sh

PATH=/sbin:/bin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin

if !( grep -q ^saned.*6566 /etc/services ); then
        echo "saned             6566/tcp        # SANE network scanner daemon" >> /etc/services
fi
maurerr commented 5 years ago

just noticed you're using my main repo http://pkg.entware-backports.tk/packages/ (not yet updated) please test for now with http://maurerr.github.io/packages/

davygravy commented 5 years ago

Good morning maurerr,

Actually, I only used the main repo to load on the underlying packages. (IIRC)

The printer stack was all downloaded from the backup… although I had to insert ‘packages’ into the URL to download them yesterday [ Looks like the links/URLs are fixed now …]

At a glance … right now it looks like the only thing missing is the libv4l …

At the moment I’m away from my equipment but will try the backup feed when I return home this afternoon.

Regards,

Dave

On May 3, 2019, at 1:40 AM, maurerr notifications@github.com wrote:

just noticed you're using my main repo http://pkg.entware-backports.tk/packages/ http://pkg.entware-backports.tk/packages/ (not yet updated) please test for now with http://maurerr.github.io/packages/ http://maurerr.github.io/packages/ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maurerr/Entware-backports/issues/1#issuecomment-488966038, or mute the thread https://github.com/notifications/unsubscribe-auth/AANA3ZRJFYLHCUFAA7HCBY3PTPM57ANCNFSM4HJH4S4A.

maurerr commented 5 years ago

Hi Dave,

(it's afternoon for me here :) - Romania) You're right, libv4l is missing in my repo. Its compilation is hitting again issues with the ancient kernel. I hope i'll find some time this weekend to fix this and add a patch.

Cheers, M

maurerr commented 5 years ago

so I've managed to compile libv4l and uploaded it in https://maurerr.github.io/packages/ Can you please test it ? (no patch committed for now as that requires more time)

... L.E. - i've also managed to commit the patch https://github.com/maurerr/entware-packages/commit/f5bb6e30ee0094b15225c5b85e92c90f9c82ee85

thanks

davygravy commented 5 years ago

Hi maurerr,

Thanks so much for doing this! It looks to me like the libv4l problem is solved. Nicely done!

I was careful this time to use only the opkg install script from ent-ng, then changed to your Entware-backports feed, then did opkg update && opkg upgrade using your feed.

Does the https://maurerr.github.io/packages/ site need an updated Packages.gz file?

I downloaded only these using wget-ssl --no-check-certificate from your https://maurerr.github.io/packages/ :

root@ShareMaxN300:/opt/tmp# ls -lna
drwxr-xr-x    2 0        0             4096 May  5 11:01 .
drwxr-xr-x   11 0        0             4096 Mar 26 15:33 ..
-rw-r--r--    1 0        0           876363 May  3 08:12 cups-filters_1.22.1-4_mipselsf.ipk
-rw-r--r--    1 0        0          8102552 May  3 08:12 cups_2.2.10-1_mipselsf.ipk
-rw-r--r--    1 0        0           201238 May  3 08:12 dejavu-fonts-ttf-DejaVuSansMono_2.37-1_mipselsf.ipk
-rw-r--r--    1 0        0           372651 May  3 08:12 dejavu-fonts-ttf-DejaVuSans_2.37-1_mipselsf.ipk
-rw-r--r--    1 0        0         12013125 May  3 08:12 ghostscript_9.26-2_mipselsf.ipk
-rw-r--r--    1 0        0         17965081 May  3 08:12 hplip-full_3.18.12-1a_mipselsf.ipk
-rw-r--r--    1 0        0           236217 May  3 08:12 libcups_2.2.10-1_mipselsf.ipk
-rw-r--r--    1 0        0            63301 May  3 08:12 libidn_1.35-1_mipselsf.ipk
-rw-r--r--    1 0        0          1060342 May  3 08:12 libpoppler_0.74.0-1_mipselsf.ipk
-rw-r--r--    1 0        0           119524 May  3 08:12 libv4l_1.16.3-1_mipselsf.ipk
-rw-r--r--    1 0        0           674836 May  3 08:12 qpdf_8.4.0-1_mipselsf.ipk
-rw-r--r--    1 0        0            39834 May  3 08:12 sane-backends_1.0.27-2_mipselsf.ipk
-rw-r--r--    1 0        0          4496168 May  3 08:12 sane-libs_1.0.27-2_mipselsf.ipk
-rw-r--r--    1 0        0           731323 May  3 08:12 v4l-utils_1.16.3-1_mipselsf.ipk

and installed them using opkg install --force-checksum

In particular the your new libpoppler_0.74.0-1_mipselsf.ipk (vs the 0.72 that's on your regular feed) fixed the other problem - no error messages and Ghostscript did correctly render as expected.

The only 2 oddities I saw were some items regarding hplip-full and sane-backends. A. It appears that hplip-full and sane-backends are both trying to install the same conf file:

Installing sane-backends (1.0.27-2) to root...
Collected errors:
 * check_data_file_clashes: Package sane-backends wants to install file /opt/etc/sane.d/dll.conf
    But that file is already provided by package  * hplip-full
 * opkg_install_cmd: Cannot install package sane-backends.

I had to use an additional --force-overwrite to get it to install.

B. /opt/etc/init.d/S01sane-backends perhaps needs a path change (prepend with /opt) at the beginning of the path for the services:

#!/bin/sh

PATH=/sbin:/bin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin

if !( grep -q ^saned.*6566 /etc/services ); then
        echo "saned             6566/tcp        # SANE network scanner daemon" >> /opt/etc/services
fi

This change at least quiets the script so that it doesn't throw an error.

Maybe this addresses part of it regarding one of these things... maybe not... ... https://github.com/Entware/entware-packages/commit/3c72d4f66261c93a5eb755707f6f6234d018999e

================================================================

Once you have everything in the feed available by opkg install I will do a final check to make sure that it all installs, starts and functions as expected.

maurerr commented 5 years ago

Hi Dave,

How do you see the fix for A) issue? for B) i've pushed a fix here https://github.com/maurerr/entware-packages/commit/97f74205b4c3dc7a4907860ace9c98399b505561

Regards, M

davygravy commented 5 years ago

Hi Maurer,

I will examine the following:

  1. the files on my ARMV7 Entware router and compare some things… I can’t remember seeing such an error when I installed the same suite of packages there…

  2. The build directory for Entware and Entware-ng on my build machine… and see if what is in the ipkg-install dirs…

  3. Comparison of the Makefiles between Entware*s

My hunch is that sane-backends should install /opt/etc/sane.d/dll.conf, rather than hplip-full installing it.

It could also have something to do with the Makefile where it tests to see whether or not it is a scan_build : (lines 102-104 in this patch commit for crosscompilation)... https://github.com/Entware/entware-ng-oldpackages-ports/blob/master/hplip/patches/020-cross-compile.patch

This will take a day or two since I have family returning and some commitments but hopefully by 8 May.

Thanks,

Dave

On May 6, 2019, at 3:25 AM, maurerr notifications@github.com wrote:

Hi Dave,

How do you see the fix for A) issue? for B) i've pushed a fix here maurerr/entware-packages@97f7420 https://github.com/maurerr/entware-packages/commit/97f74205b4c3dc7a4907860ace9c98399b505561 Regards, M

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maurerr/Entware-backports/issues/1#issuecomment-489544829, or mute the thread https://github.com/notifications/unsubscribe-auth/AANA3ZXV22Q3Q2HJKEXHJR3PT7TPHANCNFSM4HJH4S4A.

davygravy commented 5 years ago

Had a few moments to look at some files in the build_dir from Entware (Alexander & zyxmon) for ARMV7 and -their- mipselsf-k3.4 .

Both architectures show hplip-full/opt/etc/sane.d/dll.conf with contents hpaio

Looking at sane-backends I see both archs with sane-backends/opt/etc/sane.d/dll.conf and an exhaustive list of scanners to be enabled by network.

Entware's Makefile for hplip (feeds/packages/util/hplip) shows:

CONFIGURE_ARGS += \
    --disable-gui-build \
    --disable-network-build \
    --disable-fax-build \
    --disable-pp-build \
    --enable-hpijs-install \
    --enable-cups-ppd-install \
    --disable-doc-build

... disable-network-build prominently displayed... so I'm not sure what the intent is, perhaps just an oversight.

Since I understand that your intent is to keep Entware-backports closely aligned with Entware, I will bring it up with Alexander. ... and get back to you ASAP.

davygravy commented 5 years ago

My bad... I humbly apologize. I don't know how I misread it or whatever.

sane-libs is a dependency of hplip-full, but sane-backends is not part of the printer-stack anyway (only for networking printers). Since they come from upstream, that is where I will send the bug report: I'll note it to @ryzhovau and @zyxmon .

So... Please disregard the sub-issues A and B from May 5, 2019 above. They are not part of the printing stack and need to be sorted out upstream, IMHO. ;)

It may mean that either no one else has ever filed a bug report with OpenWRT... or no one else is using sane-backends.

Networked scanners are a neat idea, especially when coupled with WiFi. I just never used it that way.

@maurerr , you can close this if all the commits are taken care of. :)

maurerr commented 5 years ago

packages are updated also on the main repo http://pkg.entware-backports.tk/packages/

Thanks

davygravy commented 5 years ago

All packages seem to be present in the feed, and all of them that I tested for printing did seem to work correctly! Yeah!!! Thanks @maurerr !