WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy  (Read 30682 times)

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #30 on: April 26, 2012, 02:57:53 AM »
I'm not  familiar with bash (should be ash on TC?)  -scripting, but if I read correctly, those SANE dirs are exported.

Hmm,  normally extension maintainer should comment. Is this distro-community-internal-discussion-stuff-related issue?.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #31 on: April 26, 2012, 11:59:12 AM »
Hi Yleisajattelija
Yes, TC uses ash since it is part of busybox, however, there is a bash extension you can install. If you plan on
compiling, be sure to install the  compiletc  extension.

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #32 on: April 27, 2012, 03:31:27 AM »
BusyBox is great and  ash is great, too.

I digged SANE histrory and seems that origin of that bash script is RedHat. I strogly agree that scripting should be just simple maintenance tasks, use C if complexity needed.

JasonW is obviously overloaded because of so many extensions maintenace, so I suppose SANE upadate takes some time.

I'm very slow coder, for me it will take months to rewrite that script (if it works at all).

Is there timetable for SANE update?



 

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #33 on: April 27, 2012, 11:41:48 AM »
Hi Yleisajattelija
As I said, you can install  bash.tcz. You should then be able to run the script.

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #34 on: April 30, 2012, 02:23:19 AM »
As I said, you can install  bash.tcz. You should then be able to run the script.

Sorry, I prefer ash, I will try to convert that "bashism" stuff to reasonable code. There was dicsussion thread for shell scripting versus AWK. Seems to me, that ash is correct tool for system maintenance, but it is not a parser tool.

As system like TC, tool chain is important thing. Minimizing tools is important, use simple tools and as few as possible. Obviously shell script language is needed but is AWK really needed or is better to just use C if arthmetic is concerned?


I prefer C, but there is some point to use AWK. No need for compiling most important. 
« Last Edit: April 30, 2012, 02:25:41 AM by Yleisajattelija »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #35 on: April 30, 2012, 03:06:28 AM »
Hi Yleisajattelija
While it makes sense to use ash for TC scripts since it is part of busybox, the same is not necessarily true of a
package you wish to compile. Rather than fight with the package, I'd recommend you install the bash extension.
It's only needed to build the package, not for the final extension. Awk is also a part of busybox and can be called
from a script.


Offline xyz-worx

  • Jr. Member
  • **
  • Posts: 69
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #36 on: April 30, 2012, 03:49:02 AM »
Hi Yleisajattelija,

if you don't like to install bash.tcz you can try to modify the building script(s).
I did compile several packages e. g. from git-repositories, where scripts normally have the
#/bin/bash  shebang

Changing these lines to
#/bin/sh
did work.

Maybe it is even enough to do this only in the 'configure' script.
Together with 'compiletc' - as Rich stated - the compilation should be possible.

regards
xyz-worx

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #37 on: April 30, 2012, 04:28:16 AM »
Hi Yleisajattelija,

if you don't like to install bash.tcz you can try to modify the building script(s).
I did compile several packages e. g. from git-repositories, where scripts normally have the
#/bin/bash  shebang

Changing these lines to
#/bin/sh
did work.

...which is an indication that they are wrongly declared in header in the first place.
Would be a good idea to report such uptime so it can get fixed.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #38 on: April 30, 2012, 05:22:00 AM »
The point is, bash is "evil code". I like to get rid of it. It it good example of "unix disease", unnecessary complexity is ruining everything.

Awk is indeend part of the basebox, so let it be default, if ash won't be solution.

a) busybox (not gnu-utils)
b) compiletc.tcz (not c++)
c) ash (not bash)
d) awk (not gawk) only lethal cases, when need to heavy string processing or/and arithmetic
e) nothing else .

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #39 on: December 16, 2012, 03:55:03 PM »
Sane backends source README file says (sorry for long listing):

Where can i find those "TC PPI-compatibility"  rules for sane libs and udev rule files?

---------------------------------------------
Read the file README and this file.

Install missing development packages with your prefered package manager:
  libusb-dev

Search the location where your system installed libsane.so.1.
  Each distribution uses different folders for the libraries.
 
  Here are some examples from 64 bit Ubuntu 10.04. For the installation process
  you need to replace /usr/lib with the folder detected on your system.
 
  $ sudo find / -name libsane.so.1
  /usr/lib/libsane.so.1

  /usr/lib is the folder we are looking for.
 
  Be careful on 64 bit systems, if you already installed 32 bit compatibility
    libraries, e.g. the package ia32-libs:

    $ sudo find / -name libsane.so.1
    /usr/lib/libsane.so.1
    /usr/lib32/libsane.so.1
   
    This response contains 2 folders: (1) /usr/lib32 is the location of the
    32 bit compatibility libraries. (2) /usr/lib is the folder we are looking
    for.
   
  Be careful, if you already compiled and installed new SANE backend:
   
    $ sudo find / -name libsane.so.1
    /usr/lib/libsane.so.1
    /usr/local/lib/libsane.so.1
    /home/user/src/sane-backends/backend/.libs/libsane.so.1

    This response contains 3 folders: (1) /usr/local/lib is the location of
    installed new SANE backend. (2) /home/user/src/sane-backends/backend/.libs
    is the location of compiled new SANE backend in the source tree.
    (3) /usr/lib is the folder we are looking for.
 
Decide where you want to install new libsane.
  You can set symbolic links to new libsane.
    I assume that new libsane version 1.0.23 will be installed to
    /usr/local/lib and your system installed libsane.so.1 to /usr/lib.

    $ cd /usr/lib
    $ sudo ln -sf /usr/local/lib/libsane.so.1.0.23 libsane.so.1
    $ sudo ln -sf /usr/local/lib/sane/libsane.la libsane.la
    $ cd -
Alternatively you can overwrite standard libsane.
    Then you need to do some extra configuration for latest SANE backend:
   
    $ ./configure --libdir="/usr/lib"
   
You also can replace the binaries, configuration, manuals, translations, etc.
  of your distribution. For more information please read:
 
  $ ./configure --help

Configure, make and install latest SANE backend.

  $ ./configure [with your options defined above]
  $ make && sudo make install

Use the scanner with normal user rights.
  This only works if udev is installed. Please note that historically not all
  of the distributions have used the same format for the udev rules file.
 
  Copy udev rules file:
 
  $ sudo cp tools/udev/libsane.rules /etc/udev/rules.d
 
  Reconnect your scanner to the USB bus to activate the new rules file.
 
  Your user must be a member of the group scanner. Please use the system tools
  to check, if this group exists, if needed create this group and join this
  group. After this you must logoff and login again.

Test your scanner.
  First you should check if new libsane is used.
 
    $ scanimage -V
    scanimage (sane-backends) 1.0.23git; backend version 1.0.23
 
    This example shows that backend and scanimage are version 1.0.23.
 
    $ /usr/bin/scanimage -V
    scanimage (sane-backends) 1.0.20; backend version 1.0.23
 
    This example shows that an old scanimage (1.0.20) uses the backend 1.0.23.
 
    If you want to use xsane, start xsane and check the used version with
    CTRL - i.
   
  Now you can test if your scanner is recognized with normal user rights.
 
    $ scanimage -L
   
    If your scanner isn't recognized here, try this:

      $ sudo scanimage -L
   
        If this works, your user doesn't have the rights to access the scanner.

      However, please check and redo the installation steps described above. 
      If this doesn't help, you can ask the mailing list 
      <sane-devel@lists.alioth.debian.org> for further support.
   
Have a lot of fun with the latest SANE backend.
-----------------------------------------------------------------------------------------------

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #40 on: December 16, 2012, 07:07:15 PM »
Reading whole posted README it is not evident what is unclear to you.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #41 on: December 17, 2012, 03:37:23 AM »
Sorry, unambiguous question.

Reason for that sane TinyCore installation is not working is probably TC unique file system.

On that README file sane staff says that too. For every distro, default directories have to match distros file structure.

That match have to do with udev.rules files, too.

If I have understood correctly, this "PPI compatible" means that package installation matches with TC unique file structure.

I got an answer at different chain, that TC uses kernel default udev.rules, I think that README says that udev.rules mast be modified for sane-backends.

There seems to be standard makefile for compile, but those udev.rules might need some hacking.

Actually, I not sure if that udev.rules are needed only if saned -daemon is installed, if so -> can be skipped.

For compile, correct TC file structure and udev.rules handling must be known.

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #42 on: December 17, 2012, 04:38:07 AM »
Sorry, still unambiguous question.

TC is linux is unix is coded with C -language.

That's good for me, even if I personally like most direct coding with hex editor, next to that is assembler and then C (Java is accepted occasionally, but C++ never).

One of the difficult/wonderful features with C is libraries. Commonly needed code is placed on linked C-library, and several applications can use same piece code.

Unfortunately, using libraries is not simple, for example BusyBox is "multiple call library" for some special reasons (there is problems for dynamic library loading in embedded environments).

Because several applications can use same library, there must be EXACT rules how libs are placed on directory tree.

On linux community, it is distro who decide where libs are, and debian/redhat are most common file structures.

udev.rules are mechanism for linux dynamic harware/driver/module handling. Problems are same and worse than with libs, because udev is dynamic in nature.

When scanner is connected with USB-cable, that makes udev event and triggers scanner driver modules loading to memory.

When page is scanned, that generates udev event, too. That event might need special udev.rules handling or not, depends on driver/module structure.

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #43 on: December 17, 2012, 05:37:21 AM »
Sorry, unambiguous again, let's make third try:

a) It is distro who makes rules how handle sane-bacend libs. Of course, I can make that decision and put libs somewhere but that will cause problems, because probably on next TC update I have to manually adjust those settings. Good practice is use TC specification, if there is some.
b) Only docs I have yet found are those few diagrams for TC system.
c) FHS -spesification is something, but I think it not sufficient to describe file structure needed for lib tree.
d) Especially that udev.rules might be nightmare, and udev development on linux is going to fork .-> changes will be in near future

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Samsung Unified Linux driver + CLX-3185 + TC CUPS-strategy
« Reply #44 on: December 17, 2012, 07:53:35 AM »
More explanations:

This lib issue is current concern with Samsung Unified Driver CUPS parts, because few files at /usr/lib/ directory must be updated (driver is not working without).

That directory seems to hold important C standard libraries and there is always risk of side effects when updating those libs.