How to make Brother Linux CUPS/lpd drivers work under FreeBSD
June 16th, 2015
Having been recently in the market for a replacement multi-function device, I
wanted to 'step up' and get a color laser printer having totally gotten sick of
the problems that inkjet printers continually pose.
I ended up chosing a Brother MFC9330-CDW for the functionality, price point,
and also for the fact that they supported open source by providing support
for Linux in the form of PPD files for CUPS.
Much to my dismay however, that rather than simply providing a PPD file that
could plugin with as little effort as possible into an existing CUPS
installation, their "drivers" and the "install script" for those drivers were
very "Linux-centric." They assumed that "/opt" would be available, and all
the scripts assumed the default "linux paths" when installing things. The
following things were done by me to shoehorn this into a FreeBSD 9.2
machine. When I did this, I did not have the patience or motivation to
"productize" this procedure and make it into a "port" for the various brother
models. Folks with more time on their hands than me, feel free. I just wanted
to get this out onto the interwebs so that when somebody else running FreeBSD
wanted to buy a Brother printer, they might have a chart to work by.
The general idea here is after I looked through the two .rpm package files and
understood where scripts/filters were looking for constituent files, I simply
needed to copy them to a different place (other than "/opt") and adjust all the
scripts to find what they need.
- You will need to make sure you have Linux binary emulation turned on in
rc.conf as well as the correct userland ports installed. The lpd/CUPS filters
come with two different binary programs. Only one is released by Brother in
source code form. Happily since we can run linux binaries (and these are
certainly not complex binaries to run), we just go with it.
- Fetch the appropriate .rpm's from Brother's site. My model was the
I have not tested this procecdure on any other devices--just the
CDW--but I'm betting it would work on all of the different models as their
drivers appear to be structured very similarly across families.
- I chose to simply install their stuff in
"/usr/local/opt" instead of
"/usr/local/share" or other standarized places. It made editing their Shell
- mkdir /usr/local/opt. cd to /usr/local/opt and unpack the two .rpm files, using rpm2cpio (google how to unpack an "rpm"
file if you haven't ever done this before).
This will leave you with 3 directories of stuff in
/usr/local/opt/brother/Printers/mfc9330cdw (where mfc9330cdw is replaced by
whatever printer you're trying to make work under FreeBSD). You will have
"cupswrapper", "inf", and "lpd".
- Inside the "lpd" directory, you must edit the file "filtermfc9330cdw"
(again, change the name appropriately for your model). Change every "/opt" to
"/usr/local/opt". You should make sure you have "pdf2ps" and "a2ps" installed
at this point too.
- This was the most confusing part: The "cupswrapper" script that Brother
provides is sort of an "install" script. It copies over the PPD file, starts
and stops CUPS appropriately, etc. Another thing it does is to install a
"filter" that CUPS calls directly per the PPD file specification. Inside the
"cupswrapper" script is
a here document
which gets installed. What I did was to take the text of this document,
define variables as needed, and query-replace escape characters away from $ and
` marks. I have
the example of the
I actually use. This file is
"/usr/local/libexec/cups/filter/brother_lpdwrapper_mfc9330cdw". Of course
make sure permissions are executable and inside the script make sure any
"/opt" are changed to
- Even though the PPD file is installed in the "cupswrapper" directory under
/usr/local/opt/... it needs to be copied to
"/usr/local/share/cups/model/Brother" (a directory you will have
- Make sure you have "psnup" installed. I had to change the path location
from /usr/bin to /usr/local/bin for this utility.
- At that point you can restart CUPS and try to add another printer as Admin.
- One thing I had to do was to configure my DHCP / local named(1) to give the
printer a fixed address that resolved to a known name. I then had to change
the "Node" name of the printer (do this through the LCD or Web
interface of the printer itself). They default to some weird "BRN<mac address>" thing and
because that was not resolvable name on my network things didn't spool right
after my first attempt at adding the printer. I configured my printer's
"Node" to "brother" and made its IP address resolve to the same name on my
LAN and everything started working!
Hopefully this will help "somebody" who runs FreeBSD and wants to purchase a
Brother printer be more confident that they CAN shoehorn the Brother-provided
scripts/drivers into your FreeBSD installation!
Brother, if you're listening please make the install of these things less