Home > Installation > Manual Install > Linux Distributions > LFS/BLFS

# Linux From Scratch

Note: This process has not been tested by the HPLIP Team and is not supported.

Installing hplip-1.7.1 on an LFS/BLFS system

This document describes the installation of hplip-1.7.1 on a Linux from Scratch (LFS)/Beyond Linux from Scratch (BLFS) setup.

Some system components of the LFS/BLFS build on which this experience is based are: gcc-4.0.3 ; glibc-2.3.6; udev-088; Linux-2.6.16.5; python-2.4.3; libusb-0.1.12; xfree86-4.5.0; gimp-2.2.10; cups-1.1.23; ESP_Ghostscript-8.15.1; sane-1.0.17; foomatic-3.1.0.

The procedure installs hplip in a directory different from /usr or /usr/local. If these standard locations are used, some of the configuration steps may be omitted.

It is assumed that:

1. All the system requirements for the building of hplip are met;
2. Hplip-1.7.1.tar.gz has been untarred into a directory we shall call "Build" and that the patch hplip-1.7.1-1.patch has been copied to this directory. The contents of Build should look like this: hplip-1.7.1/hplip-1.7.1-1.patch;

The various steps are described below.

First as an unprivileged user:

$ cd hplip-1.7.1

$ patch -Np1 -i ../hplip-1.7.1-1.patch

$ sed -i "s@daemon@pidofproc@g" hplip.sh

$ ./configure --prefix=/usr/local/Hplip-1.7.1 --disable-network-build --disable-pp-build

$ make

Explanations:

sed -i "s@daemon@pidofproc@g" hplip.sh is done to replace the 'daemon' function in hplip.sh with 'pidofproc'. Lfs does not use 'daemon' at all, but 'pidofproc' in stead.

--disable-network-build: if you do not have net-snmp installed.

--disable-pp-build: if your printers do not connect to the parallel
  port.

Next, as root:

# export HPLIP_DIR="/usr/local/Hplip-1.7.1"

# mkdir -p $HPLIP_DIR/bin

# make install

Explanations:

You need to do the 'mkdir' bit because hplip will not create the 'bin' directory and installation will fail as a result. If you install in /usr/local or /usr this would not be a problem.

Now you need to configure for hplip (still as root):

# chmod 0744 $HPLIP_DIR/share/hplip/hplip

# cd /etc/rc.d/init.d

# ln -s $HPLIP_DIR/share/hplip/hplip hplip

# cd ../rc0.d

# ln -s ../init.d/hplip K01hplip

# cd ../rc3.d

# ln -s ../init.d/hplip S24hplip

# cd ../rc5.d

# ln -s ../init.d/hplip S24hplip

# cd ../rc6.d

# ln -s ../init.d/hplip K01hplip

# cd /usr/bin

# ln -s $HPLIP_DIR/bin/hpijs hpijs

# cd ../lib/sane

# ln -s $HPLIP_DIR/lib/libsane-hpaio.* .

Find the path in /dev to the printer. This is done by ls /dev and looking for the usb/ directory, for example. Suppose the path is /dev/usb/lp0

Edit /etc/profile and add the line

export SANE_DEFAULT_DEVICE="hpaio:/dev/usb/lp0"

Then run the command:

# . /etc/profile

To /etc/ld.so.conf add the line

/usr/local/Hplip-1.7.1/lib

and run the command

# ldconfig

Finally:

# unset HPLIP_DIR

Explanations:

-- The 'hplip' binary as installed is not executable, hence the "chmod" step.

-- The lfs-setup has 'init.d' in a place different from what the installation procedure expects. We have to make a symlink in ' init.d' to where 'hplip' is.

-- The symlinks set up in the rc.{0,1,3,5,6} directories will activate the two hplip daemons at boot time and bring them down at shutdown time. It is important to note that these daemons must be activated before the 'cups' daemon and shut down after the 'cups' daemon. Thus the numbers 'xy' in the 'Sxy' links must preceed those for 'cups'. The 'xy' in 'Kxy' must be larger than those for cups. So have a good look at what goes on in the 'rc.n' directories.

-- It is important to have a link in /usr/bin to the 'hpijs' binary. Without this link 'cups' will get lost. That is one reason why installation of 'hplip' in /usr is recommended.

-- Sane will look for the 'libsane-hpaio' libraries in /usr/lib/sane. So we have to establish a link. Without these links scanning at least with 'xscanimage' will not work. The final dot in the command line should not be left out.

-- The environment variable SANE_DEFAULT_DEVICE will make 'xscanimage' work from wherever it is called. This really is a nice thing to do!

-- Having 'ldconfig' make the hplip libraries visible to the system may be of importance to software that leans on hplip.

If you set the variable SANE_DEFAULT_DEVICE do not give a command to xscanimage when you configure.

Hopefully this is of value to users of other Linux distributions as well.

Documentation provided by Niko Sauer

# Next

Continue to hp-setup

Page last updated: Fri Feb 23 09:20:16 2007; HPLIP Version: 1.7.4a