samedi, janvier 28, 2012

Installing Samsung ML-2950 series printer drivers on FreeBSD

I've just replaced my inkjet printer with a laser one (Samsung ML-2955ND: Netword and Duplex).
Samsung provide drivers for lot's of OS (HP-UX, IBM AIX, GNU/Linux, MacOSX, etc…) but nothing for FreeBSD :-(

Hopefully the GNU/Linux drivers is CUPS based and use standard PPD file… But with a binary only cups-filter.
I didn't know if it was possible to use the Linux emulation layer of FreeBSD for using this cups-filter, but a previous experience was successful, then I try it too.


The major idea is to:

  1. Install print/cups
  2. Enable and install the FreeBSD Linux binary compatibility
  3. Getting the Samsung Unified drivers for the ML-2950 series
  4. Extracting the PPD file and the i386 binary cups-filter used by the PPD
  5. Fixing the missing dependency needed by the samsung cups-filter

I will not explain the steps 1,2 and 3.

Extract the Unified Linux Drivers:
$ tar zxvf ULD_Linux_V1.00.06.tar.gz

Then check the filter used by the PPD file:

$ grep cupsFilter uld/noarch/share/ppd/Samsung_ML-2950_Series.ppd
*cupsFilter:  "application/vnd.cups-raster 0 rastertospl"

=> This PPD file use the "rastertospl" filter.


Now copy the PPD and the Samsung cups-filter to the local cups directories:
$ mkdir /usr/local/share/cups/model/samsung
$ cp uld/noarch/share/ppd/Samsung_ML-2950_Series.ppd/usr/local/share/cups/model/samsung/
$ cp uld/i386/rastertospl /usr/local/libexec/cups/filter/

Once copied, you can execute rastertosamsungspl from a CLI for displaying the missing Linux libs:

# /usr/local/libexec/cups/filter/rastertospl
/usr/local/libexec/cups/filter/rastertosamsungspl: error while loading shared libraries: libcups.so.2: cannot open shared object file: No such file or directory

There are two method here:

The first and easiest is simply to install print/linux-f10-cups-libs. It should install all dependency needed by the crappy Samsung binary filter (Thanks Patrick for this tips!)

The second, a lot's more complex, and that add lot's of file not managed by the FreeBSD package manager is to check for missing libs one by one: You need to install the missing libs, running a ldconfig and re-execute rastertosamsungspl for discovering that another libs is missing.
Here is the list of all libs that I've installed:
# cd /tmp
# fetch http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/10/Everything/i386/os/Packages/cups-libs-1.3.9-2.fc10.i386.rpm
# fetch http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/10/Everything/i386/os/Packages/gnutls-2.4.2-2.fc10.i386.rpm
# fetch http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/10/Everything/i386/os/Packages/libtasn1-1.5-1.fc10.i386.rpm
# fetch http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/10/Everything/i386/os/Packages/libgcrypt-1.4.3-2.fc10.i386.rpm
# fetch http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/10/Everything/i386/os/Packages/libgpg-error-1.6-2.i386.rpm
# cd /compat/linux
# rpm2cpio /tmp/cups-libs-1.3.9-2.fc10.i386.rpm | tar -zxf -
# rpm2cpio /tmp/gnutls-2.4.2-2.fc10.i386.rpm | tar -zxf -
# rpm2cpio /tmp/libtasn1-1.5-1.fc10.i386.rpm | tar -zxf -
# rpm2cpio /tmp/libgcrypt-1.4.3-2.fc10.i386.rpm | tar -zxf -
# rpm2cpio /tmp/libgpg-error-1.6-2.i386.rpm | tar -zxf -
/compat/linux/sbin/ldconfig


Once all dependencies are installed, you should have this message when executing rastertosamsungspl:

# /usr/local/libexec/cups/filter/rastertosamsungspl 
INFO: Usage: rastertosamsungspl job-id user title copies options [file]
ERROR: Wrong number of arguments

Now you can add your printer from the CUPS admin panel and use it :-)

mercredi, octobre 05, 2011

BSD Router Project: Version 1.0 disponible

Cela faisait plusieurs mois qu'il n'y avait pas eu de nouvelle version de ce routeur libre: C'est corrigé depuis cette nuit.
Et comme j'ai passé pas mal de temps à le tester dans tous les sens, je me suis dit que cette version méritait finallement de passer directement en 1.0.
J'ai par contre découvert une grosse limitation concernant la protection des protocoles de routages IPv6 sous FreeBSD (RIPng et OSPFv3): Ces protocoles n'incluent plus leur propre mécanismes de sécurité mais les délèguent à la couche IPSec d'IPv6. Cela veux dire que nous devons passer par setkey(8) pour configurer des SAD/SPD manuels les protégeant.… Or la couche IPSec de FreeBSD ne sait pas gérer les adresses multicast et l'usage du multicast est très courant en IPv6 (RIPng et OSPFv3 l'utilisent). Cette limitation est assez bloquante car elle ne permet pas d'avoir le même niveau de protection des réseaux RIP/OSPF en IPv6 qu'en IPv4 sous FreeBSD.

J'ai aussi amélioré les scripts VirtualBox (PowerShell et Shell) permettant de lancer les labs virtuels facilement pour qu'ils prennent en charge les fonctionnalités de linked-type-clone et Page Fusion: Le gain en ressource pour la machine hôte est impressionnant!
Par exemple sur le lab BGP route reflector/confederation qui nécessite le lancement de 7 routeurs, donc 7 VMs (avec 128Mo de RAM et 256Mo de disque alloué à chacune):
  • La fonctionnalité «linked-type-clone» permet de ne consommer que 153Mo d'espace disque pour l'ensemble des VMs: Le template de référence utilise 80Mo et chacun des clones 10Mo.
  • La fonctionnalité «Page Fusion», elle, permet de ne consommer que 112Mo de RAM pour l'ensemble des VMs (environ 16Mo par VM).
Pour la suite, va falloir que je travaille un système de centralisation/gestion des configurations et pourquoi pas permettre le pre-provisionning des configurations pour du déploiement grande échelle.