Iscan and Slackware 14.2

From Studiosg
Jump to navigationJump to search

Welcome to Simone Giustetti's wiki pages.


Languages: English - Italiano


Iscan and Slackware 14.2

Image Scan is an image scanning software for Epson scanners available for the Linux operating system. Actively developed and supported for many years, recently the software was apparently discontinued by Epson which inherited it from Avasys years ago. A series of features available through this very same web site describe how to build working Iscan packages for a variety of releases of Slackware an excellent and long-lived Linux distribution. The release cycle of the latest Slackware release, 14.2, took over two years to complete. The development branch obviously introduced a lot of new features and updates both among the included packages and the system configuration. Some of the new functionality caused issues with the Image Scan build procedure. I had been working to update the build scripts since the development branch entered beta status, but other activities always seemed to take precedence. I got so late that the 1st of July 2016 Slackware 14.2 was officially released. I realized I had delayed the update for way too long thus deciding to make up for the lost time by writing the piece you are reading right now.

The procedure explained below sums up all of the many suggestions and advice I received from people struggling to build Iscan for Slackware-current in the past months asking for advice while providing their own tips, patches and support. A big thank you to 55020, Fabio Castelli from Arch Linux, Rob Van Nues and many more.

The Build Procedure in Short

Building Image Scan packages for Slackware is a straightforward process. Some of my previous papers provided detailed instructions for specific architectures. The summary included below follows some easy guidelines:

  • The detailed procedure can be used for any architecture with little or no modifications.
  • Working packages were built and tested for i486, amd64 and arm platforms.
  • Tests were run using an Epson v200 scanner. I cannot provide feedback for other devices as I do not own any other.
  • The graphical interface for the arm platform is missing as the official MakeFiles do not build it. Moreover the is no guarantee that the i486 and amd64 provided firmware will work for arm devices, actually the contrary is more likely.

Iscan is made of 3 distinct packages:

  • Iscan consists of the actual scanning software and its GUI.
  • Iscan-data includes files to configure udev and to produce rules suited for both USB or SCSI scanners.
  • Iscan-plugins includes proprietary drivers and firmware required by some Epson scanners. The firmware is required to connect scanners to sane: the scanner device subsystem used in both Linux and Unix.

Installing the first two components is mandatory while the third one is optional as some devices do not require any firmware or driver to work under Linux. The first two packages work with every supported device. Iscan-plugin only works for a single device therefore the build script should be configured accordingly. Finally it is worth mentioning that the order in which packages are installed is significant as some directories and links are created and udev rules are produced during the installation which are needed for the system to correctly recognize your hardware. The correct installation order is:

  1. Isca-data
  2. Iscan
  3. Iscan-plugin

The Used Version

Iscan development has undergone a gradual slowdown over the years until coming to a complete stop with release 2.30.1, described in a feature dated May 2015. The Epson Italian web page does not even mention Image Scan while both the English download page and manual refer to release 2.30.1. Surfing the web I could find mention of Utsushi which, if I got it right, should replace version 3 of Image Scan. I could not find any proof of my supposition therefore, as a owner of a perfectly working scanner, I'll rant against Epson and its choice to remove Linux support til further notice.

Obtaining the Iscan source code presents somewhat of a problem. Different versions of the code are available on-line:

Links to the archives used to build packages are provided below:

Release 2.30.1 of Image Scan will be used later in this article.


Software Build

Download the source code and build it in order to obtain working packages for Linux. You'll find the procedure to be straightforward and fast. Slackware recurs to shell scripts identified by the *.SlackBuild extension to build packages. SlackBuilds are standard shell scripts performing in the correct order all of the tasks needed to obtain binary files, documentation, icons and graphics from the source code and pack everything in a single compressed, easy to manage archive. Iscan requires for three such SlackBuild scripts. A copy of each script can be downloaded from the following links:

Building Iscan-data

The first package you must install is iscan-data, which includes some configuration files and scripts providing udev support. Download the archive containing the build environment into the /tmp directory recurring to the wget command:

  user@system:~$ cd /tmp
  user@system:/tmp$ wget http://www.giustetti.net/resource/slackbuild/iscan-2.30.1_14.2/iscan-data.tar.gz

Open a root shell and decompress the archive issuing the following commands:

  root@system:/root# cd /tmp
  root@system:/tmp# tar -zxf iscan-data.tar.gz

Directory "iscan-data" will be created containing a list of files similar to the following one:

  root@system:/tmp# cd iscan-data
  root@system:/tmp/iscan-data# ls -la
  total 40
  drwxr-x--- 2 root root 4096 May  6  2015 .
  drwxr-x--- 5 root root 4096 May 23  2015 ..
  -rw-r----- 1 root root  373 Nov 26  2010 README
  -rw-r----- 1 root root  324 May 19  2015 doinst.sh
  -rwxr----- 1 root root 8536 May 20  2015 iscan-data.SlackBuild
  -rw-r----- 1 root root  550 May  6  2015 iscan-data.info
  -rw-r----- 1 root root  817 May  6  2015 slack-desc
  -rw-r----- 1 root root  284 May  6  2015 usb_id.patch

File iscan.info will provide you with a download link for the source code and a checksum, parameter MD5SUM, useful to check the downloaded archive integrity.

Download the source code archive into directory /tmp/iscan-data and check its consistency:

  root@system:/tmp/iscan-data# md5sum iscan-data_1.36.0-1.tar.gz 
  787c0734f7f35335c2f74ae21e3b4a11  iscan-data_1.36.0-1.tar.gz

Should the checksum output differ from the one found inside the iscan-data.info file, the downloaded archive is probably corrupted. Download it again possibly from a different source.

Let's suppose the check concluded successfully and proceed updating iscan-data.Slackbuild file. Some variables at the top of the script need proper value assignment. Open the file with your text editor of choice and update the VERSION parameter to match the downloaded software release number. The variables should be initialized as follows:

   PRGNAM="iscan-data"
   VERSION=${VERSION:-"1.36.0-1"}
   VERSION_SHORT=`echo ${VERSION} | awk -F\- '{ print $1 }'`
   BUILD=${BUILD:-2}

The target architecture for the build process will be set by the script during its execution. Once the package version matches your needs, save your updates and exit your text editor. It is now possible to start software compilation issuing commands:

  root@system:/tmp/iscan-data# chmod a+rx iscan-data.SlackBuild
  root@dsystem:/tmp/iscan-data# ./iscan-data.SlackBuild

The former command assigns execution permissions to the build script while the latter executes the script itself. The script will then take all actions needed to create a working package and to save it into directory /tmp. Run the following commands to install the package:

  root@system:/tmp/iscan-data# cd /tmp
  root@system:/tmp# installpkg iscan-data-1.36.0-i486-1_sg.txz for AMD / Intel 32 bit cpus.

or

  root@system:/tmp# installpkg iscan-data-1.36.0-x86_64-1_sg.txz for AMD / Intel 64 bit cpus.

and again

  root@system:/tmp# installpkg iscan-data-1.36.0-arm-1_sg.txz for Arm cpus.

Root privileges are of course needed to install the packages.

Building Iscan

The very same procedure is useful to build a working Image Scan 2.30.1 package. Download the archive containing the build environment into directory /tmp:

  user@system:~$ cd /tmp
  user@system:/tmp$ wget http://www.giustetti.net/resource/slackbuild/iscan-2.30.1_14.2/iscan.tar.gz

Open a root shell and decompress the archive issuing the following commands:

  root@system:/root# cd /tmp
  root@system:/tmp# tar -zxf iscan.tar.gz

A new directory named "iscan" will be created containing:

  root@system:/tmp# cd iscan
  root@system:/tmp/iscan# ls -la
  total 52
  drwxr-xr-x 2 root root   4096 Jul 21 00:24 .
  drwxr-xr-x 5 root root   4096 Jul 21 00:24 ..
  -rw-r----- 1 root root    868 Jul 10  2010 README
  -rw-r----- 1 root root    112 May 19  2015 doinst.sh
  -rwxr----- 1 root root  12382 Jun 25 00:26 iscan.SlackBuild
  -rw-r----- 1 root root    185 May  3  2009 iscan.desktop
  -rw-r----- 1 root root    419 May  6  2015 iscan.info
  -rw-r----- 1 root root    340 Dec 16  2012 iscan_png.patch
  -rw-r----- 1 root root   1602 Jun 24 22:47 iscan_pngstream.patch
  -rw-r----- 1 root root    774 May  6  2015 slack-desc

The directory contains two patches. The first patch iscan_png.patch is needed to build a package targeted for Slackware 14.1, while the more recent iscan_pngstream.patch solves some compatibility issues with the png library included in Slackware 14.2. The script will choose one or the other checking against the installed png library version. A big thank you goes to Fabio Castelli of Archlinux for the second patch.

Again a link to download the source for the software and the corresponding checksum value can be found inside file with extension *.info: iscan.info.

Download the source code archive into directory /tmp/iscan and check its consistency:

  root@system:/tmp/iscan# md5sum iscan_2.30.1-1.tar.gz
  2ba2043973f149d5a2d0468bf76d0030  iscan_2.30.1-1.tar.gz

Update the variables at the top of script iscan.SlackBuild. Variable values should be initialized to match the following ones:

   BUILD=${BUILD:-2}
   JOB_COUNT=${JOB_COUNT:-" -j4 "}
   PRGNAM="iscan"
   VERSION=${VERSION:-"2.30.1-1"}
   VERSION_SHORT=`echo ${VERSION} | awk -F\- '{ print $1 }'`

As for the previous build the targeted architecture will be set by the script itself during its execution.

After the configuration, a package can be built and installed running commands:

  root@system:/tmp/iscan# chmod a+rx iscan.SlackBuild
  root@system:/tmp/iscan# ./iscan.SlackBuild
  root@system:/tmp/iscan# cd /tmp
  root@system:/tmp# installpkg iscan-2.30.1-i486-2_sg.txz for AMD / Intel 32 bit cpus.

or

  root@system:/tmp# installpkg iscan-2.30.1-x86_64-2_sg.txz for AMD / Intel 64 bit cpus.

and again

  root@system:/tmp# installpkg iscan-2.30.1-arm-2_sg.txz for Arm cpus.

Plug-in Rpm Archive Conversion

The third and final Iscan component consists of the binary plug-in which connects the computer to the attached scanner. Not all of Epson scanners require a binary plug-in: some work natively in Linux while other like the v200 or the v330 cannot do without.

Plug-ins are provided by Epson in binary form only packaged in rpm format used by Red Hat and its derived distributions that requires converting. A different plug-in is needed for each scanner and for each architecture. Packages provided for scanner Epson "Perfection v200 Photo" are: iscan-plugin-gt-f670-2.1.0-3.c2.i386.rpm and iscan-plugin-gt-f670-2.1.0-3.c2.x86_64.rpm respectively for 32 and 64 bit machines.

Download the archive containing the conversion scripts into directory /tmp and decompress it:

  user@system:~$ cd /tmp
  user@system:/tmp$ wget http://www.giustetti.net/resource/slackbuild/iscan-2.30.1_14.2/iscan-plugin.tar.gz

Open a root shell and decompress the archive issuing the following commands:

  root@system:/root# cd /tmp
  root@system:/tmp# tar -zxf iscan-plugin.tar.gz

The newly created iscan-plugin directory should contain:

  root@system:/tmp# cd iscan-plugin
  root@system:/tmp/iscan-plugin# ls -la
  total 36
  drwxr-xr-x 2 root root 4096 Jul 22 20:33 ./
  drwxr-xr-x 5 root root 4096 Dec 20  2013 ../
  -rw-r----- 1 root root 1710 May  6  2015 README
  -rw-r----- 1 root root  237 Jun 24 22:35 doinst.sh
  -rwxr----- 1 root root 9128 May 23  2015 iscan-plugin.SlackBuild*
  -rw-r----- 1 root root 2582 Dec 20  2013 iscan-plugin.info
  -rw-r----- 1 root root  819 Jul 11  2010 slack-desc

As usual a download link for the source code and a checksum value are available inside the file bearing extension *.info.

What follows are the download, consistency check, conversion and install operations for both 32 and 64 bit plug-in package versions. Steps for a 32 bit machine are:

  root@system:/tmp/iscan-plugin# md5sum iscan-plugin-gt-f670-2.1.2-1.i386.rpm 
  f53dec00730d3d28051edd1fb869de22  iscan-plugin-gt-f670-2.1.2-1.i386.rpm

Values for the iscan-plugin.SlackBuild script variables are:

   ARCH=${ARCH:-"i386"}
   BUILD=${BUILD:-2}
   PRGNAM="iscan-plugin"
   PKGNAM=${PRGNAM}
   # Select one among gt-f670, gt-f700, gt-f720, gt-1500, gt-s80, gt-s600, gt-x750
   # gt-x770 or perfection-v330
   PLUGIN="gt-f670"
   RPM_VERSION="1"  # This is the build number used by Epson Fedora Rpm
   TAG=${TAG:-"_sg"}
   VERSION="2.1.2"

Set the proper values and execute the usual commands:

  root@system:/tmp/iscan-plugin# chmod a+rx iscan-plugin.SlackBuild
  root@system:/tmp/iscan-plugin# ./iscan-plugin.SlackBuild
  root@system:/tmp/iscan-plugin# cd /tmp
  root@system:/tmp# installpkg iscan-plugin-gt-f670-2.1.2-i386-1_sg.txz

For 64 bit machines:

  root@system:/tmp/iscan-plugin# md5sum iscan-plugin-gt-f670-2.1.2-1.x86_64.rpm
  8bb27b1f56823d1ec896d4ae7e3ba8f6  iscan-plugin-gt-f670-2.1.2-1.x86_64.rpm

Values for the iscan-plugin.SlackBuild script variables are:

   ARCH=${ARCH:-"x86_64"}
   BUILD=${BUILD:-2}
   PRGNAM="iscan-plugin"
   PKGNAM=${PRGNAM}
   # Select one among gt-f670, gt-f700, gt-f720, gt-1500, gt-s80, gt-s600, gt-x750
   # gt-x770 or perfection-v330
   PLUGIN="gt-f670"
   RPM_VERSION="1"  # This is the build number used by Epson Fedora Rpm
   TAG=${TAG:-"_sg"}
   VERSION="2.1.2"

Set the proper values and run the following commands in sequence:

  root@system:/tmp/iscan-plugin# chmod a+rx iscan-plugin.SlackBuild
  root@system:/tmp/iscan-plugin# ./iscan-plugin.SlackBuild
  root@system:/tmp/iscan-plugin# cd /tmp
  root@system:/tmp# installpkg iscan-plugin-gt-f670-2.1.2-x86_64-1_sg.txz

there is no package targeted to the arm architecture. Owners of arm devices can not connect and use their scanner in spite of the operating system used.

Building Iscan in a Chroot Environment

SlackBuilds scripts can run in a chroot environment and produce working packages. An obvious advantage consisting of the ability to compile packages aimed to 32 bit Slackware in a custom configured multilib environment. Some little tweaks are obviously required for the task. When running a SlackBuild script in a 32 bit chroot environment it is mandatory to pass the target architecture to the script otherwise it will automatically set the host environment one. The syntax to run scripts is: export MARCH="i486"; ./<script_name>. Consequently commands should be updated in:

export MARCH="i486"; ./iscan-data.SlackBuild
export MARCH="i486"; ./iscan.SlackBuild

Both configuration and install procedure require no modification.


Configuring the System

If the three packages were installed following the order described above: isca-data, iscan, iscan-plugin, no further configuration should be needed. Udev subsystem rules plus file /var/lib/iscan/interpreter are enough for the computer to recognize the attached scanner and to load the proper firmware.

If any issue should arise, rules file /etc/udev/rules.d/60-iscan.rules can be manually created running:

  /usr/lib/iscan-data/make-policy-file --force --mode udev --out-file /etc/udev/rules.d/60-iscan.rules

Wile file /var/lib/iscan/interpreter can be edited with a text editor of choice adding a line for each scanner needed library and commenting out the other ones.

If nothing seems to solve the issue, reinstalling packages in the correct order should do the trick.

Iscan and Sane / Xsane

Sane is an acronym for Scanner Access Now Easy and is the scanner back-end used in Linux and other Unixes. Epson scanners can be used with Sane setting the interpreter in file /etc/sane.d/dll.conf. You'll need to add to the list a line containing the name epkowa for the Perfection v200 photo device. Some other models cold require updates to file /etc/sane.d/epkowa.conf. The update is optional for the majority of devices, but when a connected device is not detected correctly by the system setting the scanner type: scsi or usb and, for usb scanners, its identifier could solve the problem. The identifier uses a formatted string:

  usb <USB vendor ID> <USB product ID>

To obtain both identifiers run command lsusb when the scanner is running and connected to the computer. Epson vendor ID is the string 0x04b8. The row for scanner Epson Perfection 1650 for example is:

  usb 0x04b8 0x0110

Iscan and Gimp

Image Scan can be configured as a Gimp plug-in. Gimp is the best known image manipulation program running on Linux. The Gimp integration will allow you to run Iscan from within the program and to import images from the scanner without the need to open an acquisition program. The configuration is rather easy and consists of creating some links to the right executable files. For Gimp release 2.x, the latest available stable release shipping with Slackware 14.2 is 2.8.16, open a root shell and execute the following command:

  root@system:/root# ln -s /usr/bin/iscan `gimptool-2.0 --gimpplugindir`/plug-ins/

For older release 1.2 run instead command:

  root@system:/root# ln -s /usr/bin/iscan `gimptool --gimpplugindir`/plug-ins/


Examples

Below you can find some reproductions of a couple of drawings scanned with Image Scan running on a 64 bit Slackware Linux.


Conclusions

The present paper detailed the installation procedure of a recent Image Scan release for Slackware 14.2. The instructions and provided scripts can be updated to work for i486, amd64 or arm based platforms with only minor modifications.

The links to the Image Scan 2.30.1 and Image Scan Data 1.36.0 Slackware packages follow. The packages are distributed in the hope they could be helpful:

Plug-ins are not distributed with an open source license and thus should be downloaded from the Epson web site.


For any feedback, questions, errors and such, please e-mail me at studiosg [at] giustetti [dot] net


External links





Languages: English - Italiano