NSLU2-Linux
view · edit · print · history

As there is no cups (yet?) compiled for openslug, I installed the version from the unslung feed, which works quite well. You could also compile cups package with a working OE environment using the command "bb cups" and take the build packages in your deploy/ dir. See section "Build a package" here: http://www.nslu2-linux.org/wiki/Development/MasterMakefile

Necessary steps:

  1. Download and install packages from unslung-feed manually
  2. Install usb printer kernel module
  3. adapt cups init script
  4. configure cups

Here comes the detail:

1. Download necessary packages

Easiest way to do this is to follow the instructions on bootstrapping optware at http://www.nslu2-linux.org/wiki/Optware/Slugosbe. Alternatively, because there are some dependencies, you need to get the following packages from unslung (i.e. using wget):

  • cups
  • cups-doc
  • libjpeg
  • libpng
  • libstdc++
  • libtiff
  • zlib
  • libssl0.9.7 (if you need to generate certificates, install the openssl package instead)

If you installed openssl, you might need other packages like

  • openldap-libs
  • libdb
  • gdbm
  • cyrus-sasl-libs

After downloading, you can install do a

ipkg install *.ipk
in the folder where you saved the packages.

After you install, follow the directions from the HowTo.AddPrinter page to generate certificates. I had to run this from /opt/bin to get openssl to run.

2. Kernel printer module

This is available from the openslug feed:

ipkg install kernel-module-usblp

Note: it may be necessary to run depmod -a for modprobe to find usblp

3. Adapt init script

The cups init script can be found in /opt/doc/cups/S88cups. You just have to alter 2 lines:

Original:

if ( !(lsmod | grep "^printer" -q) ); then
insmod /opt/lib/modules/printer.o

Modified:

if ( !(lsmod | grep "^usblp" -q) ); then
modprobe usblp

also change the following line. (At least in Openslug 2.7)

Original: /bin/killall cupsd 2>/dev/null

Modified: /usr/bin/killall cupsd 2>/dev/null

Then place the init script next to the others in /etc/init.d and create symlinks in the /etc/rcX.d directory for each runlevel you want cups to run under. (Note: rc3.d is the normal run level) To create the symbolic link for runlevel 3: ln -s /etc/init.d/S88cups /etc/rc3.d/S88cups

4. Configuration

Normally, no additional configuration should be necessary, /dev/lp0 is by default configured as a raw printer named hp990c. For addition information see HowTo.AddPrinter.

Note: I had to setup cups to use parallel:/dev/usb/lp0 as default to print, as openslug 3.1 puts the usb devices in a folder. I also had to issue the command: chmod u+s /opt/sbin/cupsd as discussed in HowTo.AddPrinter.

N.B. You don't need to chmod cupsd if you are an openslug 3.10 beta user.

After printer insertion, the created device node could be owned by root:

  $ls /dev/usb/lp* -la
  crw-rw----    1 root     lp       180,   0 Nov 13 19:23 /dev/usb/lp0

If this is the case, it may be necessary to add

  chown lp:users /dev/usb/lp0

to a script to get the printer responding. [I have found this to be true of cups 1.3.3-1; I haven't needed to do this before - Caysho]

5. Allowing for disk spindown

Normally, cups prevents disks from spindown as it generates new root certificates every 5 minutes. With the following changes, disk spindown is possible again:

  • edit /opt/etc/cups/cupsd.conf and change all three logfile destinations towards a persistant ramdisk location (e.g. to /var/log/cups/...)
  • mv /opt/etc/cups/certs /var/run/ ; ln -s /var/run/certs /opt/etc/cups/certs

This assumes you had spindown working before ;-), i.e. by having persistant ram disks at least for /var/log and /var/run and your hd being mounted noatime.

6. Samba Share

If you want to share the printer over samba, follow the directions in the standard printing over Samba howto. Then Samba should automatically find your printer. You then have to simlink to the binaries in /opt/bin like follows:

ln -s /opt/bin/lp /bin/lp
ln -s /opt/bin/lpstat /bin/lpstat
ln -s /opt/bin/lpr /bin/lpr

Then you should be able to print over the share using your client driver.

view · edit · print · history · Last edited by Jeremy Jefferson.
Based on work by Caysho, Glen Harris, Jan Alonzo, ML, mathieu_xwave, Spook, pbgonlinehomede, bofh_omega, mbanditt, and Joschi.
Originally by Joschi.
Page last modified on January 16, 2008, at 01:17 AM