stefan-langenmaier / brother-overlay

Portage overlay for Brother printer and scanner software
GNU General Public License v3.0
34 stars 42 forks source link

brother-dcp9055cdn-bin fails to install #34

Closed madImpulse closed 7 years ago

madImpulse commented 7 years ago

I don't know if this is a general issue or specific to this ebuild. When I emerge it, I get the following output:

>>> Install brother-dcp9055cdn-bin-1.1.1 into /var/tmp/portage/net-print/brother-dcp9055cdn-bin-1.1.1/image/ category net-print
 * ACCESS DENIED:  unlinkat:     /usr/share/cups/model/brdcp9055cdn.ppd
rm: cannot remove '/usr/share/cups/model/brdcp9055cdn.ppd': Permission denied
 * ACCESS DENIED:  open_wr:      /usr/share/cups/model/brdcp9055cdn.ppd
cp: cannot create regular file '/usr/share/cups/model/brdcp9055cdn.ppd': Permission denied
 * ACCESS DENIED:  fchmodat:     /usr/share/cups/model/brdcp9055cdn.ppd
chmod: changing permissions of '/usr/share/cups/model/brdcp9055cdn.ppd': Permission denied
 * ACCESS DENIED:  open_wr:      /usr/share/ppd/brdcp9055cdn.ppd
cp: cannot create regular file '/usr/share/ppd/brdcp9055cdn.ppd': Permission denied
 * ACCESS DENIED:  fchmodat:     /usr/share/ppd/brdcp9055cdn.ppd
chmod: changing permissions of '/usr/share/ppd/brdcp9055cdn.ppd': Permission denied
 * ACCESS DENIED:  fchmodat:     /usr/local/Brother/Printer/dcp9055cdn/inf/brdcp9055cdnrc
chmod: changing permissions of '/usr/local/Brother/Printer/dcp9055cdn/inf/brdcp9055cdnrc': Permission denied
 * ACCESS DENIED:  fchmodat:     /usr/local/Brother/Printer/dcp9055cdn/inf
chmod: changing permissions of '/usr/local/Brother/Printer/dcp9055cdn/inf': Permission denied
ln: failed to create symbolic link '/var/tmp/portage/net-print/brother-dcp9055cdn-bin-1.1.1/image//usr/libexec/cups/filter/brlpdwrapperdcp9055cdn': No such file or directory

I think the cupswrapper script is run, a new brother printer is added, but the installation is not complete. In the end I had to add a symlink to /usr/local/Brother/Printer/dcp9055cdn/lpd/filterdcp9055cdn from /usr/libexec/cups/filter/brlpdwrapperdcp9055cdn

see also my story here: https://forums.gentoo.org/viewtopic-p-8030842.html#8030842

I found suggestions to run emerge with FEATURES="-sandbox", but htat did not help.

stefan-langenmaier commented 7 years ago

Thanks for your report! Yes it looks like a sandbox violation. I will investigate why the ebuild is not working.

Btw, you need to use FEATURES="-usersandbox -sandbox" to deactivate the sandboxing completely, but the ebuild will still error out.

madImpulse commented 7 years ago

thanks for the hint, with -usersandbox I get less errors. I think now the remaining problem is that the source of the symlink is not correct:

* The specific snippet of code:
 *       ( ln -s "${D}/usr/lib64/cups/filter/brlpdwrapperdcp9055cdn" "${D}/usr/libexec/cups/filter/brlpdwrapperdcp9055cdn" ) || die

I had to use /usr/local/Brother/Printer/dcp9055cdn/lpd/filterdcp9055cdn. I don't remember, wether this folder was created by the ebuild or by me unpacking the rpm.

stefan-langenmaier commented 7 years ago

I pushed a new ebuild. Disabling the sandboxes should no longer be necessary.

Maybe you can leave some feedback if it's working or not as I don't have access to this model.

stefan-langenmaier commented 7 years ago

No feedback after a week. Closing.

madImpulse commented 7 years ago

Been away for a few days. Thanks a lot, the issue seems to be resolved. I emerged the -r1 version succesfully. I had the move or delete the existing /usr/local/Brother folder, but the it it was all good. test rpint succeeded. thanks a lot for the prompt support. Also it did not install a new printer when emerging the ebuild.

madImpulse commented 7 years ago

I think I was a little too quick. I checked on a second machine: it is still necessary to make the symlink in usr/libexec/cups/filter: ln -s /usr/local/Brother/Printer/dcp9055cdn/lpd/filterdcp9055cdn brlpdwrapperdcp9055cdn

stefan-langenmaier commented 7 years ago

I'm not sure that I understood the error correctly, but I changed the filter in the ebuild. Again, I would appreciate your feedback as I cannot test it.

madImpulse commented 7 years ago

I hope my approach is not too quick and dirty, but it works for me like this if I change the src_install in the ebuild:

src_install() {
    MODEL="dcp9055cdn"
    mkdir -p "${D}"usr/libexec/cups/filter || die
    mkdir -p "${D}"usr/share/cups/model/Brother || die
    cp -r usr "${D}" || die
    ( ln -s "${D}"usr/local/Brother/Printer/${MODEL}/lpd/filterdcp9055cdn "${D}"usr/libexec/cups/filter/brlpdwrapperdcp9055cdn ) || die

    ( ln -s "${D}"usr/local/Brother/Printer/${MODEL}/cupswrapper/${MODEL}.ppd "${D}"usr/share/cups/model/Brother/brother_${MODEL}_printer_en.ppd ) || die
}

To test I first deleted the directory /usr/local/Brother and the file /usr/libexec/cups/filter/brlpdwrapperdcp9055cdn

After emerging the modified ebuild. The printer still worked. It is not clear to me what the sed part is for in the original ebuild. If I'm lucky I manage to commit the modified ebuild...

madImpulse commented 7 years ago

there was a typo in the sed command. created pull request #38

stefan-langenmaier commented 7 years ago

Hi and thanks for the work, I'll try to look into till Wednesday. Sorry I'm quite busy at the moment.

madImpulse commented 7 years ago

Hi

thanks and no worries, I am not working on it every day as well...

regards Thomas

On Monday, 1 May 2017 16:45:01 CEST stefan-langenmaier wrote:

Hi and thanks for the work, I'll try to look into till Wednesday. Sorry I'm quite busy at the moment.

stefan-langenmaier commented 7 years ago

I merged your pull request, thanks again. For the next time, please don't make the changes specific to the fork in the pull request. This would override these files in mine if I simply merge it.

On May 1, 2017 6:22 PM, "madImpulse" notifications@github.com wrote:

Hi

thanks and no worries, I am not working on it every day as well...

regards Thomas

On Monday, 1 May 2017 16:45:01 CEST stefan-langenmaier wrote:

Hi and thanks for the work, I'll try to look into till Wednesday. Sorry I'm quite busy at the moment.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/stefan-langenmaier/brother-overlay/issues/34#issuecomment-298366126, or mute the thread https://github.com/notifications/unsubscribe-auth/AAxTdDp6KxfP3fsEIvh2szoOL66JCQGXks5r1gaygaJpZM4L-jcW .

madImpulse commented 7 years ago

thanks. Now it works and I switched back to this repository.