{"id":487,"date":"2024-06-12T21:38:05","date_gmt":"2024-06-12T11:38:05","guid":{"rendered":"https:\/\/www.ubermotive.com\/?p=487"},"modified":"2024-06-12T22:51:07","modified_gmt":"2024-06-12T12:51:07","slug":"porting-old-32-bit-brother-laser-cups-drivers-to-64-bit-linux","status":"publish","type":"post","link":"https:\/\/www.ubermotive.com\/?p=487","title":{"rendered":"Porting old 32-bit Brother laser CUPS drivers to 64-bit Linux."},"content":{"rendered":"\n<p>I&#8217;ve had a Brother HL-3150CDN for quite some time. Brother are still maintaining the firmware, with the latest release being in late 2023. Things are going driverless, and it does support modern communications such as AirPrint\u2122 and IPv6 over ethernet. While it can do these things, the limitations of tiny CPU and 64MB RAM become evident. It does not handle network printing well, compared to over USB with a desktop CPU doing all the heavy lifting.<br><br>Over USB, it does not support IPP Everywhere\u2122 and indeed still requires a driver to operate.<br><br>The problem: They have not updated the Linux driver since 2013, and it ships with only 32-bit binaries. For the record, the last 32-bit desktop processor was released in 2006, and the last Ubuntu LTS with a 32-bit option was released in 2016. You simply don&#8217;t run 32-bit software on Linux anymore.<\/p>\n\n\n\n<p>How much effort is too much effort for Brother to continue to support its older printers? Well, it&#8217;s not much effort at all. I&#8217;ve found that their newer drivers are completely generic, and work perfectly fine when you repackage them to work on an older model. I&#8217;ll go into detail of how I made the driver below. This process can likely be adapted to other models. If you&#8217;re only here for the HL-3150CDN, I&#8217;ll just link to a download for the repackaged driver and you can be on your way.<\/p>\n\n\n\n<p><strong>Download the driver here:<\/strong> <a href=\"https:\/\/bender.ubermotive.com\/~russell\/hl3150cdnpdrv-3.5.1-1.amd64.deb\">hl3150cdnpdrv-3.5.1-1.amd64.deb<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\">Rolling Your Own Driver<\/h2>\n\n\n\n<p>First, download the driver for your printer. I got the HL-3150CDN driver from <a href=\"https:\/\/support.brother.com\/g\/b\/downloadtop.aspx?c=au&amp;lang=en&amp;prod=hl3150cdn_us_as_cn\">here<\/a>. Also download the driver for the nearest current model. I chose the <a href=\"https:\/\/support.brother.com\/g\/b\/downloadtop.aspx?c=au&amp;lang=en&amp;prod=hll3240cdw_us_eu_as\">HL-L3240CDW<\/a> (v3.5.1-1). It&#8217;s their current basic networked colour laser.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter is-resized is-style-default wp-duotone-unset-1\"><img loading=\"lazy\" decoding=\"async\" width=\"359\" height=\"170\" src=\"https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/brothers.png\" alt=\"\" class=\"wp-image-497\" style=\"width:359px;height:auto\" srcset=\"https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/brothers.png 359w, https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/brothers-300x142.png 300w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><figcaption class=\"wp-element-caption\">They&#8217;re like&#8230; Brothers.<\/figcaption><\/figure>\n\n\n\n<p>Extract the .deb files to a working directory. Here&#8217;s what the old CUPS wrapper deb package contains:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full wp-duotone-unset-2\"><a href=\"https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"785\" height=\"330\" src=\"https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-6.png\" alt=\"\" class=\"wp-image-502\" srcset=\"https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-6.png 785w, https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-6-300x126.png 300w, https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-6-768x323.png 768w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/a><\/figure>\n\n\n\n<p>The only file you actually need from this is <code>brother_hl3150cdn_printer_en.ppd<\/code>. If you inspect that binary  with &#8220;<code>file brcupsconfpt1<\/code>&#8220;, you&#8217;ll find it&#8217;s an ELF 32-bit executable. Yuck.<\/p>\n\n\n\n<p>If you inspect the new driver, you&#8217;ll find this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full wp-duotone-unset-3\"><a href=\"https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"801\" height=\"685\" src=\"https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-5.png\" alt=\"\" class=\"wp-image-501\" srcset=\"https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-5.png 801w, https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-5-300x257.png 300w, https:\/\/www.ubermotive.com\/wp-content\/uploads\/2024\/06\/image-5-768x657.png 768w\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" \/><\/a><\/figure>\n\n\n\n<p>The <code>brother_lpdwrapper_hll3240cdw<\/code> file is a perl script (architecture-independent). Both binaries in the x86_64 directory are ELF 64-bit binaries. Perfect!<\/p>\n\n\n\n<p>Now, to make a working v3.5.1-1 driver for the HL-3150CDN, it&#8217;s actually quite trivial: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Remove <code>brother_hll3240cdw_printer_en.ppd<\/code> and replace it with  <code>brother_hl3150cdn_printer_en.ppd<\/code> from the older driver.<\/li>\n\n\n\n<li>Find and replace &#8220;<code>hll3240cdw<\/code>&#8221; with &#8220;<code>hl3150cdn\"<\/code> in <code>prerm<\/code>, <code>postinst<\/code>, <code>postrm<\/code>, <code>control<\/code>, <code>cupswrapperhll3240cdw<\/code> and <code>brhll3240cdwrc<\/code>.<\/li>\n\n\n\n<li>Rename every file and directory so that <code>hll3240cdw<\/code> becomes <code>hl3150cdn<\/code>.<\/li>\n\n\n\n<li><em>(optional)<\/em> remove the <code>i686<\/code> directory and change the architecture property in the <code>control<\/code> file from <code>i386<\/code> to <code>amd64<\/code>. Remove the i686 symlinking from the <code>postinst<\/code> script too.<\/li>\n\n\n\n<li>Repackage the <code>.deb<\/code> file.<\/li>\n<\/ul>\n\n\n\n<p>Repackaging can be done with <code>dpkg-deb<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dpkg-deb -b <em>&#91;workingdir]<\/em> hl3150cdnpdrv-3.5.1-1.amd64.deb<\/code><\/pre>\n\n\n\n<p>Then install the <code>.deb<\/code> as usual. When you restart CUPS, the driver will appear.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve had a Brother HL-3150CDN for quite some time. Brother are still maintaining the firmware, with the latest release being in late 2023. Things are going driverless, and it does support modern communications such as AirPrint\u2122 and IPv6 over ethernet. While it can do these things, the limitations of tiny CPU and 64MB RAM become [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-487","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=\/wp\/v2\/posts\/487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=487"}],"version-history":[{"count":16,"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=\/wp\/v2\/posts\/487\/revisions"}],"predecessor-version":[{"id":514,"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=\/wp\/v2\/posts\/487\/revisions\/514"}],"wp:attachment":[{"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ubermotive.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}