Adding a printer......Help!

Hi there!

I am trying to install a very simple and very common mono laser printer to my new Endless OS installation.

The printer is a Samsung M2016W (xpress) connected with a USB cable - I have tried to install in the follwing ways:

  1. The Add Printer application under the settings menu - the printer is detected and identified as a M2020 Series

  2. Using CUPS admin (using the webpage http://localhost:631) - Again the printer is detected as a M2020n Series

In both cases a driver is not found or the model is not selectable from the list.

I have successfully installed this printer on Ubuntu, Linux Mint, Fedora and ARCH using the second method above and / or running the installation script supplied with the very good Samsung Linux drivers.

I have tried this method on Endless OS (script run under SUDO) and it appears to install but this does not work at all on this OS.

I have also tried adding the PPD file (Samsung_M2020_Series.ppd) copied from my working Linux Mint installation.

This does not work either - checking within CUPS it suggests that the file ā€œ/usr/lib/cups/filter/rastertosplā€ is not available. Upon checking, this appears to be correct. On the Mint system this is a symbolic link to the actual file which is located in ā€œ/opt/smfp-common/printer/binā€

I cannot copy the file into the location OR creat a symbolic link to any location due to the file system being locked down.

Is there any way I can get this printer working on this OS before I remove it please?

Many thanks!

thetechiemon

Something that would help us a lot to understand the problem would be this:

  1. Open the application called ā€˜Terminalā€™
  2. In this application run the command:

eos-diagnostics

  1. The above command will create a file with the information of your system (example: eos-diagnostic-160614_111731_UTC + 0100.txt); Send us this file so we can analyze and see a possible solution

Should I attach the file here as a reply or send it via email?

Attach the file here

Cool, itā€™s attached.

I have tried a number of different ā€˜modelsā€™ of Samsung printer on the off-chance that one may work - you can see this in the file.

I can see that test jobs are being submitted to the server / queue but nothing is printed. I donā€™t see any errors Iimmediately but you guys may spot something I missed!

Thanks in advance!

eos-diagnostic-180705_220144_UTC 0100.txt (480.5 KB)

Hi @thetechiemon,

Youā€™re right on that itā€™s not possible on Endless OS to write anything under /usr/ due to the system partition being read-only, which unfortunately makes installing extra things -like certain printer drivers- a bit complicated.

However, in this particular case, I think there might be something you can do: besides copying all the related files needed by the printer under /opt/smfp-common, try editing the PPD file youā€™re using before using it to install the printer, so that it will look for the non-standard & Samsung-specific rastertospl binary directly in /opt/smfp-common/printer/bin/rastertopsl, instead of having it rely on an existing symlink at /usr/lib/cups/filter/rastertospl.

To be clear, Iā€™d try something like this:

  1. First of all, uninstall the printer if you still have it installed now
  2. Copy the /opt/smfp-common directory (and any other printer-related directory under /opt, if any) from your Mint installation, into your Endless machine, under the same path under /opt (you need to do this as root, but, /opt is writable).
  3. Copy the Samsung_M2020_Series.ppd aside somewhere and edit it, so that the line *cupsFilter: "application/vnd.cups-raster 0 rastertospl" becomes *cupsFilter: "application/vnd.cups-raster 0 /opt/smfp-common/printer/bin/rastertospl" instead (or whatever is the right path to that file), and save it as Samsung_M2020_Series_Endless.ppd.
    • Alternatively, you can do this from the command line running this command:
    sed 's/rastertospl/\/opt\/smfp-common\/printer\/bin\/rastertospl/g' Samsung_M2020_Series.ppd > Samsung_M2020_Series_Endless.ppd
    
  4. Now use that Samsung_M2020_Series_Endless.ppd to install the printer.

If things go right, and thereā€™s no more weirdness related to that driver (e.g. other binaries or files not referenced from the PPD file expected to live under /usr), this might actually work.

Hope this helps, good luck!
Mario

Thanks Mario, Iā€™ll give this a go this afternoon!

I was attempting to do something similar but creating my own symlink to the file(s) but I had no joy with thatā€¦

1 question, should I need to re-install the Samsung Linux driver using the installtion script they provided or should I use the Endless Add Printer app, adding in the PPD file via the button?

Iā€™m guessing doing this via the CUPS admin webpage acheives the same goal?

Thanks again!

I have no idea of how the installation script works, but my understanding is that it will likely fail at some point when trying to write under /usr (it creates a symlink, right), and if that happens itā€™s probable that whatever came next in the installation wonā€™t be performed, leaving it half way.

What I would do is to look at that script and, if itā€™s not too complicated, either remove the lines touching the /usr file system and execute it that way, or simply try to understand what it does and do it manually. I wouldnā€™t bet my life on it, but I wouldnā€™t be surprised if all it does is to copy files under /opt/smfp-common and, create those symlinks and then install the printer using CUPSā€™ commandline toolsā€¦ in which case you can achieve the same effect (1) copying /opt/smfp-common over from your Mint installation, (2) modifying the PPD file as I described before and then manually installing that modified PPD file from the Endless Add Printer App, via the button you mentioned.

Alternatively, you can also add it from CUPS web interface at http://localhost:631, but using the desktop app is probably easier.

OK,

So this is what I did:

Copied the /opt folder and subfolders from my Mint machine to a USB stick
Copied the Samsung_M2020_Series.ppd file to the stick - edited the file to reflect the new location of the rastertospl file

Copied these files to the EOS /opt folder (this was previously empty) using the following to preserve any rights:

john@endless:/opt$ sudo cp -r -p ā€˜/path_on_usbā€™ ./

for both of the folders I have (samsung and smfp_common)

I have put the PPD file along with the others in there:

/opt/samsung/printer/share/ppd/Samsung_M2020_Series_Endless.ppd

I tried to maintain the rights to the rastertospl file with my copy command but CUPS appears to be objecting to it saying is is insecure.
However, it would also appear that although it tries to start the filter via the scheduler it simply stops.

This is an extract below:

Jul 06 15:20:59 endless cupsd[366]: M2020-Series: File ā€œ/opt/smfp-common/printer/bin/rastertosplā€ has insecure permissions (0100644/uid=1001/gid=1001).
Jul 06 15:20:59 endless cupsd[366]: Unable to start filter ā€œ/opt/smfp-common/printer/bin/rastertosplā€ - Success.
Jul 06 15:20:59 endless cupsd[366]: Stopping job because the scheduler could not execute a filter.

Iā€™m going to do some trawling around on the basis of this info unless you can suggest anything else in the meantime!

Thanks and regards!

Yes you need to preserve permissions, something that probably the USB stick has thrown away (especially if itā€™s on something like FAT or NTFS). What I would do is to create a tarball with the contents of your mint machine, put that tarball in the USB and then extract it directly on the target machine.

Something like the following should do it:

# On your mint machine (use sudo to make sure everything gets copied):
sudo tar czvf /PATH/TO/USB/DRIVE/samsung-printer-driver.tgz /opt/samsung /opt/smfp_common

# On your Endless machine, remove previous directories first, then extract
sudo rm -rf /opt/samsung
sudo rm -rf /opt/smfp_common
sudo tar xzvf /PATH/TO/USB/DRIVE/samsung-printer-driver.tgz -C /opt/

Hopefully that will get you one step closer!

Sure thing - Iā€™m usually quite mindful of maintaining the rights.

It would appear that the Samsung driver script creates a symlink in:

/usr/share/cups/model/uld-samsung to /opt/samsung/printer/share/ppd

which is where the PPD files are stored.

There is another symlink to the rastertospl file:

/usr/lib/cups/filter/rastertospl to /opt/smfp-common/printer/bin/rastertospl

One thing I did notice was that the rastertospl file is maked as executable in Mint - the one on EOS was not.

I rectified this and restarted CUPS.

This made no difference and the eos-diagnotics output showed the same issue with being unable to start the filterā€¦

Iā€™ll have a go now with your suggestion Mario - itā€™s been a while since I had to dig this deep into Linux - and that was a printing problem on Corel Linux, when that was a thing!

It would appear that the Samsung driver script creates a symlink in:
/usr/share/cups/model/uld-samsung to /opt/samsung/printer/share/ppd
which is where the PPD files are stored.

Yeah, thatā€™s very commonly done by printer drivers installed in /opt to leverage the fact that CUPS recursively looks for PPDs under /usr/share/cups/model (and any subdirectories), but itā€™s only relevant so that CUPSā€™ internal database (see output of lpinfo -m) know that the PPD files are there, so that they can be automatically discovered and picked when plugging the printer.

Since youā€™re manually installing a modified version of the PPD file, that symlink should be irrelevant once the printer is installed.

There is another symlink to the rastertospl file:
/usr/lib/cups/filter/rastertospl to /opt/smfp-common/printer/bin/rastertospl

This symlink is not needed either now that youā€™re modifying the PPD file.

One thing I did notice was that the rastertospl file is maked as executable in Mint - the one on EOS was not.
I rectified this and restarted CUPS.

Yes, CUPS filters are binary files that process an input and provide an output, and as such they need to be executable.

This made no difference and the eos-diagnotics output showed the same issue with being unable to start the filterā€¦
Iā€™ll have a go now with your suggestion Mario - itā€™s been a while since I had to dig this deep into Linux - and that was a printing problem on Corel Linux, when that was a thing!

Hopefully that will help. Another thing I spotted in your log is this, btw:

Jul 06 15:20:59 endless cupsd[366]: M2020-Series: File ā€œ/opt/smfp-common/printer/bin/rastertosplā€ has insecure permissions (0100644/uid=1001/gid=1001).

That indicates the file is not executable (as you mentioned) but also that the ownership belongs to your main user so perhaps thatā€™s another reason why this is failing? Iā€™d suggest checking what the owner of those files are in your Mint installation (probably root) and making sure that whatever gets installed in your Endless machine belongs to the same user and group (although if you use tar that should be preserved already).

Hope this helps!
Mario

Hi Mario,

Great news - printing is working fine now!

I had a real face-palm moment when I re-checked the diagnostic output - I was indeed the ā€˜ownerā€™ of the files and folders and not ā€˜rootā€™ as it shouldā€™ve been - that is likely to be what the issue was from the start - USB drives and rights / privs are a no-no from now on and Iā€™ll make sure I tar ANYTHING like this again in the future!

As I said, the last time I had any issues with any Linux distro was with Corel Linux, way back when, and that was a printing issue too - Linux has come a long way since then!

I shall pass on my thanks to you from both myself and my 9 year old daughter - she has been going nuts since she saw EOS installed on this re-cycled laptop - I guess Iā€™ll never get a look-in now!

Many Tnaks again Mario - your help/ guidance is really appreciated!

1 Like

No problem, happy to help and even happier to see you solved your issue.

Enjoy the weekend!
Mario

Thanks again Mario - hope you have a great weekend too!

All the best

John