14

04/11

Brother MFC-5490CN with FreeBSD

07:29 by skaven. Filed under: Hardware,How-to

Some time ago I bought a Brother MFC-5490CN printer knowing that Brother provides Linux drivers for this device. Since I’m using mostly FreeBSD systems I spent some time to get that printer running on my systems. Finally I did it. Here’s how I did this:

First you need to ensure that you have print/a2ps-a4, print/a2ps-letter installed.

Then download the filter drivers for Linux from Brother. I used the .deb-Archives and extracted them to a temporary directory.
The Linux driver is installed under /usr/local, but I don’t liked that so I created a separate directory in the opt-tree.

mkdir -p /opt/brother/mfc5490cn

And copied the two important directories from the Linux drivers over to that directory. These are the lpd and inf directories in the data part of the .deb-Archive.

cp -R /tmp/brmfc5490cn/data/lpd /opt/brother/mfc5490cn/
cp -R /tmp/brmfc5490cn/data/inf /opt/brother/mfc5490cn/

Since I changed the paths to these files I had to change these within the filter driver. Edit /opt/brother/mfc5490cn/lpd/filtermfc5490cn and change the BR_PRT_PATH variable to:

BR_PRT_PATH=/opt/brother/${PRINTER}

Then you need to edit the /opt/brother/mfc5490cn/lpd/psconvertij2 file, since there is a ambiguous sed command. You need to find the line saying:

RESOLUTION=`sed -n '/\<Resolution/p' $RC_FILE`

And change it to:

RESOLUTION=`sed -n '/^Resolution/p' $RC_FILE`

In my case I also had to change the /opt/brother/mfc5490cn/inf/brmfc5490cnrc file to make the printer use A4 instead of Letter format. Change the line:

PaperType=Letter

To:

PaperType=A4

Finally You just need to setup your /etc/printcap. Just paste the following lines and change the hostname in the rm line:

mfc5490cn:\
        :mx=0:\
        :sd=/var/spool/lpd/mfc5490cn:\
        :sh:\
	:rm=gutenberg:\
	:rp=lp:\
        :if=/opt/brother/mfc5490cn/lpd/filtermfc5490cn:\
#	:lf=/var/log/spool.log:

If you run into trouble just set the lf line active and run the following commands:

touch /var/log/spool.log
chown daemon:wheel /var/log/spool.log

If you need more output from the filter just write a set -x line in the /opt/brother/mfc5490cn/lpd/filtermfc5490cn and /opt/brother/mfc5490cn/lpd/psconvertij2 files. The output will be logged to the spool.log.