HP LaserJet P1005 and foo2zjs
Posted: 2022-04-14 Filed under: desktop, system | Tags: arm2hpdl, foo2hbpl2, foo2hiperc, foo2hp, foo2lava, foo2oak, foo2qpdl, foo2slx, foo2xqx, foo2zjs, HP, LaserJet, P1005, print, printer Leave a commentRecently, I had to connect my old HP LaserJet P1005 printer to my CRUX 3.6.1 box. I’ve had it for over 10 years, and I remember that on Slackware, it did not work out of the box. Instead, I had to use the drivers provided by foo2zjs. So, I decided to install them again.
I looked around and it seemed that the old website (http://foo2zjs.rkkda.com/) was no longer available. As described in my LQ post linked above, what I did back then was remove the hplip
package, download foo2zjs
and install it, by simply running:
make getweb ./P1005 make install make install-hotplug
The highlighted line downloads firmware for my printer only. However, since the website is dead, so this will not work even if I had the sources. I searched some more and found foo2zjs hosted by koenkooi at GitHub. The tarball come with the firmware already present, so the getweb
step is not needed. Great! Installing the drivers like this should work on any Linux distro.
However, I wanted to make a port for CRUX, in order to package the drivers. One problem was that specifying DESTDIR=$PKG
did not work efficiently at the make install
step and did not work at all at the make install-hotplug
step. I took some inspiration from foo2zjs-nightly at AUR, but mainly by inspecting the Makefile
, I managed to make my own patch that inserts $(DESTDIR)
where needed.
My port applies the patch and leaves a few things from the default Makefile
to be run post-install. I needed to load usblp
module to make the printer work:
modprobe usblp
I put the above line in:
/etc/rc.modules
CUPS blacklists the module by default, so I had to modify cups.conf
accordingly:
/etc/modprobe.d/cups.conf
Edit (12 Jan 2023): The above no longer works on CRUX 3.7. I found a solution in Arch Linux’s forums. So, what I did was:
modprobe usblp
Wait for the device node to be created:
sleep 3
Upload the P1005.dl
driver to the created /dev/usb/lp0
device node:
cat /usr/share/foo2xqx/firmware/sihpP1005.dl > /dev/usb/lp0
Wait again for the driver to be uploaded:
sleep 3
You may or may not need to keep the usblp
module loaded at boot time. This will unload the usblp
kernel module:
rmmod usblp
Restart CUPS:
/etc/rc.d/cups restart
When the usage of this module becomes completely obsolete and deprecated I will have to find another solution. Maybe the drivers will no longer require it…