Compiling Android for MIPS
Monday, 31 May 2010 01:12

You may have heard about Google TV that is coming soon in our homes, through Android set-top boxes. It's expected to come out this fall, but the source code of the MIPS port is already available to the public. It is important to note that Android was originally designed for smartphones, which commonly use ARM processors. However, in the set-top box market, MIPS-based systems are quite popular. This is why the announcement of Google TV at the last Google IO conference was associated with the announcement of a reference development board and SDK for the Sigma SMP8654. A brochure on the Android platform support for Sigma media processors is also available.

 

Ok, this is all nice and beautiful, but how do we get started? If you go on mips.com/android you will be told to register on the main website of the Android MIPS port, mipsandroid.com. I suggest you register now, as your account needs to be activated manually by the site administrator, and that can take a while. In my case, it took a week before I could log in, but then I couldn't access the forums or the wiki. That took an additional two days before it got activated. Being registered gives you access to a lot of interesting documentation and resources you might need. You can still get started right now as you can fetch the sources from their public git server without being registered.

 

The first step is obviously to fetch the sources. For this purpose you will need git installed (sudo apt-get install git-core) and a wrapper on top of git provided by google, called repo. repo is there to automatically fetch the sources for the large number of git servers used for the various components of Android, otherwise you would need to go through each one of them manually.

 

Create a "bin" folder in your home:

 

mkdir ~/bin
cd ~/bin

 

Download repo and make sure it's executable:

 

wget http://android.git.kernel.org/repo
chmod +x repo

 

Create a directory for the Android for MIPS sources:


mkdir ~/mipsandroid
cd ~/mipsandroid

 

Initialize your local repository, and then sync with the remote git servers:

 

~/bin/repo init -u git://public.mipsandroid.com/platform/manifest.git -b mips-eclair
~/bin/repo sync

 

Downloading all the sources will take a while, so be patient.

 

While the sources are downloading, install the packages you will need later:

 

On Ubuntu 64-bit:

sudo apt-get install gcc build-essential ia32-libs git-core libreadline-dev zip curl wget valgrind python eclipse ecj flex bison gperf libsdl-dev libwxgtk2.6-dev libgmp3-dev libc6-dev-i386 libsds-dev clearsilver-dev libclearsilver-perl python-clearsilver gcc-multilib g++-multilib lib32stdc++6-4.4-dbg

 

On Ubuntu 32-bit:

sudo apt-get install gcc build-essential git-core libreadline-dev zip curl wget valgrind python eclipse ecj flex bison gperf libsdl-dev libwxgtk2.6-dev libgmp3-dev libsds-dev clearsilver-dev libclearsilver-perl python-clearsilver gcc-multilib g++-multilib

 

The above package listings have been tested on Ubuntu 9.10 and 10.04, and on 32-bit and 64-bit versions as well. Instructions for Debian should be close enough.

 

You will also need to download a MIPS toolchain (be prepared, that FTP server can be very slow):

 

wget ftp://ftp.mips.com/pub/tools/software/android/mips-4.3.tar.gz

 

and then install it in your /opt folder:

 

tar zxvf mips-4.3.tar.gz
sudo mv mips-4.3 /opt

 

You will also need a special version of Sun's JDK, as Android doesn't work with the latest versions. Google for jdk-1_5_0_22-linux-i586.bin. You need the 32-bit version and not the 64-bit version even if you are on 64-bit Ubuntu, otherwise Android will fail to build, most likely with errors related to clearsilver. Also, if the extraction of the jdk fails on 64-bit Ubuntu, make sure that you have ia32-libs installed.

 

Once you downloaded it, you can verify the md5 sum:

df5dae6d50d2abeafb472dde6d9a17f3  jdk-1_5_0_22-linux-i586.bin

 

Add execute permissions, extract and install to your /opt directory:

 

chmod +x jdk-1_5_0_22-linux-i586.bin
./jdk-1_5_0_22-linux-i586.bin
sudo mv jdk-1_5_0_22/ /opt

 

Once you have downloaded and installed everything described above, edit your /etc/profile to add the following lines:

 

export J2RE_HOME=/opt/jdk1.5.0_22/jre
export JAVA_HOME=/opt/jdk1.5.0_22/jre
export ANDROID_JAVA_HOME=$JAVA_HOME
export PATH=/opt/jdk1.5.0_22/bin:$PATH
export PATH=/opt/jdk1.5.0_22/jre/bin:$PATH
export PATH=/opt/mips-4.3/bin:$PATH
export PATH=~/bin:$PATH
export PATH=$PATH:~/mipsandroid/out/host/linux-x86/bin/
export TARGET_PRODUCT=generic
export TARGET_ARCH_VERSION=mips32
export TARGET_ARCH=mips
export ANDROID_PRODUCT_OUT=~/mipsandroid/out/target/product/generic
~/mipsandroid/build/envsetup.sh

 

Of course, if you've chosen names different from the ones I've used, you need to make some adjustments.

 

Also make sure that ~/mipsandroid/build/envsetup.sh is executable:

 

chmod +x ~/mipsandroid/build/envsetup.sh

 

Once this is done, move to your mipsandroid folder, and use the following command to use the profile you've just defined:

 

source /etc/profile

 

If everything went fine up to now, you should now be ready to build Android for MIPS. Simply type "make" and let it build. I suggest you use the -j option, which enables multiple build threads and reduces total build time. I usually put twice the number of cores of the processor in use:

 

make -j 8

 

Beware that using too many build threads can make the building process more CPU intensive and make your entire system slow.

 

When building is finished, you should now be able to launch the emulator with your built Android image (the location of the built Android image is given by ANDROID_PRODUCT_OUT which we defined in our profile):

 

emulator

 

The emulator is located in ~/mipsandroid/out/host/linux-x86/bin/, but typing all that is long for nothing so we've added it to our path in our profile too.

 

If you're lucky, you should now see the Android emulator appear, with Android booting shortly after. If the build failed, the emulator won't show up at all, and you'll have an error in your terminal saying that your build is incomplete:

 

 

That's it, you now have Android for MIPS :) You can start playing with it while waiting for Google TV to come out.

 

 

 
Installing Lexmark Linux Drivers in 64-bit Debian-Based Distributions
Monday, 01 March 2010 01:34

Very recently, Lexmark (finally!) released Linux drivers for its all-in-one home printer models. The package "lexmark-08z-series-driver-1.0-1.i386.rpm.sh.tar.gz" can be downloaded here, and is said to be a "Linux Driver for Lexmark x7600 Series, x5600 Series, z2400 Series, x4900 Series, x3600 Series for Linux". Having tried to reverse engineer the Lexmark network printing protocol (HBN3), this release came as a surprise. Maybe Lexmark realized that Linux was not only good for making cheap printer servers on their wireless printers, but that it was now used by ordinary people at home. Ok, while this driver is a great gift, I was totally expecting that: a 32-bit rpm package. Something tells me that 1) a lot of people are now running 64-bit linux and 2) a lot of them are NOT using an rpm-based Linux distribution such as red hat or openSUSE. As I'm using either 64-bit Debian or Ubuntu on most of my computers, I had to find a way to make it work anyway. Oh, and for some odd reason, their installation instructions will tell you that Ubuntu 9.10 is supported, and to use the non-existing .deb package for Debian-based distributions. It looks like someone made a mistake about the existence of such a package, or there's someone at Lexmark that forgot to put the .deb package on their website for download. Quick googling gave me some results about people asking if anybody was able to make it work in 64-bit Debian-based distributions. This article will show you how I was able to make it work in Debian Sid, but steps should be very similar if not the same in Ubuntu. I'd expect similar steps for work for 32-bit Debian-based distributions as well.

 

EDIT: After writing this article, I figured out the real download location of "lexmark-08z-series-driver-1.0-1.i386.rpm.sh.tar.gz", and then just replaced "rpm" by "deb" in the name just to see if it would work. It turns out that the .deb version of the package is out there, as it worked. You can download "lexmark-08z-series-driver-1.0-1.i386.deb.sh.tar.gz" here. The installer generates a .deb package and then installs it with the "--force" option which ignores the current architecture, so the installation will be successful. You may still however lack 32-bit dependencies, so if it doesn't work out of the box please read the section of this article about solving those kind of problems. I'm mirroring the package here in case the original link goes down.


1. Extracting the Installation Files

 

First, extract the contents of the archive:

 

aghaster@awake:~$ tar zxvf lexmark-08z-series-driver-1.0-1.i386.rpm.sh.tar.gz
lexmark-08z-series-driver-1.0-1.i386.rpm.sh

 

You now have a script that will extract the contents of the installer in a temporary folder and run it from there. The problem here is that 1) the installation will fail and 2) the installer deletes the temporary files before closing. To get around this problem, we will run the installer and create a backup copy of the temporary files before closing it. In a terminal, start the installer:

 

aghaster@awake:~$ ./lexmark-08z-series-driver-1.0-1.i386.rpm.sh
Verifying archive integrity... All good.
Uncompressing nixstaller..............................................................
Collecting info for this system...
Operating system: linux
CPU Arch: x86_64
Warning: No installer for "x86_64" found, defaulting to x86...
TRACKING IDENT = 170209
cpu speed = 1200 MHz
ram size = 3865.8671875 MB
hd avail = 48665 MB
/usr/lib/gio/modules/libgioremote-volume-monitor.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgioremote-volume-monitor.so
/usr/lib/gio/modules/libgiogconf.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgiogconf.so
/usr/lib/gio/modules/libgvfsdbus.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgvfsdbus.so

 

Now, in a second terminal (or just by browsing the files with your favorite file manager such as nautilus), go to /tmp and look for a folder with a name similar to "selfgz3382"

 

aghaster@awake:/tmp$ ls selfgz3382/
about              instarchive_all          rpm.lua
bin                instarchive_all.sizes    selectdirscreen.lua
config             langscreen.lua           slack.lua
deb.lua            lexribbon.png            startupinstaller.sh
files_extra        licensescreen.lua        summaryscreen.lua
finishscreen.lua   packagedirscreen.lua     utils.lua
generic.lua        package.lua              utils-public.lua
groups.lua         package-public.lua       welcomescreen.lua
info               packagetogglescreen.lua  xdg-utils
install.lua        pacman.lua
installscreen.lua  pkg
aghaster@awake:/tmp$ cp -R selfgz3382/ ~
aghaster@awake:/tmp$ cd ~
aghaster@awake:~$ cd selfgz3382/
aghaster@awake:~/selfgz3382$

 

As root, run the installer from the backup copy:

 

root@awake:~/selfgz3382# ./startupinstaller.sh
Collecting info for this system...
Operating system: linux
CPU Arch: x86_64
Warning: No installer for "x86_64" found, defaulting to x86...
TRACKING IDENT = 170209
cpu speed = 1200 MHz
ram size = 3865.8671875 MB
hd avail = 48526 MB
/usr/lib/gio/modules/libgioremote-volume-monitor.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgioremote-volume-monitor.so
/usr/lib/gio/modules/libgiogconf.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgiogconf.so
/usr/lib/gio/modules/libgvfsdbus.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgvfsdbus.so

 

Follow the instructions, and let the installer fail to install the package. We don't care if the installer fails, as all we want is the temporary package file it will create. You should now have an "arch.tar" archive. Extract it:

 

root@awake:~/selfgz3382# tar xvf arch.tar
printdriver.te
lexmark-08z-series-driver-1.0-1.i386.rpm
launcher.c
launcher
lsbrowser
lsusbdevice

 

The file of interest here is lexmark-08z-series-driver-1.0-1.i386.rpm. We will not attempt to convert the rpm package to a deb package using alien, but we will simply extract its contents and do the installation manually:

 

root@awake:~/selfgz3382# rpm2cpio lexmark-08z-series-driver-1.0-1.i386.rpm | cpio -idmv
./usr/local/lexmark
./usr/local/lexmark/08z-series-driver.link
./usr/local/lexmark/08z-series-driver.unlink
./usr/local/lexmark/08zero
./usr/local/lexmark/08zero/bin
./usr/local/lexmark/08zero/bin/.scripts
./usr/local/lexmark/08zero/bin/.scripts/apparmor.pl
./usr/local/lexmark/08zero/bin/.scripts/lsbrowser
./usr/local/lexmark/08zero/bin/.scripts/lsusbdevice
./usr/local/lexmark/08zero/bin/lxk08zusb
./usr/local/lexmark/08zero/bin/printdriver
./usr/local/lexmark/08zero/bin/prnutility
./usr/local/lexmark/08zero/docs
./usr/local/lexmark/08zero/docs/license.txt
./usr/local/lexmark/08zero/docs/readme.txt
./usr/local/lexmark/08zero/etc
./usr/local/lexmark/08zero/etc/99-lexmark-08z.rules
./usr/local/lexmark/08zero/etc/Lexmark-logo.xpm
./usr/local/lexmark/08zero/etc/Lexmark08_1_0_0.conf
./usr/local/lexmark/08zero/etc/lx36-46.ppd
./usr/local/lexmark/08zero/etc/lx4900.ppd
./usr/local/lexmark/08zero/etc/lx56-66.ppd
./usr/local/lexmark/08zero/etc/lx7600.ppd
./usr/local/lexmark/08zero/etc/lxZ2400.ppd
./usr/local/lexmark/08zero/etc/lxdq.conf
./usr/local/lexmark/08zero/etc/lxdqclr1.lut
./usr/local/lexmark/08zero/etc/lxdqclr2.lut
./usr/local/lexmark/08zero/etc/lxdqclr3.lut
./usr/local/lexmark/08zero/etc/lxdr.conf
./usr/local/lexmark/08zero/etc/lxdrSCc0.bin
./usr/local/lexmark/08zero/etc/lxdrSCg0.bin
./usr/local/lexmark/08zero/etc/lxdrclr1.lut
./usr/local/lexmark/08zero/etc/lxdrclr2.lut
./usr/local/lexmark/08zero/etc/lxdrclr3.lut
./usr/local/lexmark/08zero/etc/lxdrscan.conf
./usr/local/lexmark/08zero/etc/lxdu.conf
./usr/local/lexmark/08zero/etc/lxduSCc0.bin
./usr/local/lexmark/08zero/etc/lxduSCg0.bin
./usr/local/lexmark/08zero/etc/lxduclr1.lut
./usr/local/lexmark/08zero/etc/lxduclr2.lut
./usr/local/lexmark/08zero/etc/lxduclr3.lut
./usr/local/lexmark/08zero/etc/lxduscan.conf
./usr/local/lexmark/08zero/etc/lxdw.conf
./usr/local/lexmark/08zero/etc/lxdwSCc0.bin
./usr/local/lexmark/08zero/etc/lxdwSCg0.bin
./usr/local/lexmark/08zero/etc/lxdwclr1.lut
./usr/local/lexmark/08zero/etc/lxdwclr2.lut
./usr/local/lexmark/08zero/etc/lxdwclr3.lut
./usr/local/lexmark/08zero/etc/lxdwscan.conf
./usr/local/lexmark/08zero/etc/lxdx.conf
./usr/local/lexmark/08zero/etc/lxdxSCc0.bin
./usr/local/lexmark/08zero/etc/lxdxSCg0.bin
./usr/local/lexmark/08zero/etc/lxdxclr1.lut
./usr/local/lexmark/08zero/etc/lxdxclr2.lut
./usr/local/lexmark/08zero/etc/lxdxclr3.lut
./usr/local/lexmark/08zero/etc/lxdxscan.conf
./usr/local/lexmark/08zero/etc/testpage.pdf
./usr/local/lexmark/08zero/lib
./usr/local/lexmark/08zero/lib/libScanCorrect.so.2.0
./usr/local/lexmark/08zero/lib/libhdctransport.so
./usr/local/lexmark/08zero/lib/liblxdqflib.so
./usr/local/lexmark/08zero/lib/liblxdqhpec.so
./usr/local/lexmark/08zero/lib/liblxdqhpeh.so
./usr/local/lexmark/08zero/lib/liblxdqhpep.so
./usr/local/lexmark/08zero/lib/liblxdrflib.so
./usr/local/lexmark/08zero/lib/liblxdrhpec.so
./usr/local/lexmark/08zero/lib/liblxdrhpeh.so
./usr/local/lexmark/08zero/lib/liblxdrhpep.so
./usr/local/lexmark/08zero/lib/liblxduflib.so
./usr/local/lexmark/08zero/lib/liblxduhpec.so
./usr/local/lexmark/08zero/lib/liblxduhpeh.so
./usr/local/lexmark/08zero/lib/liblxduhpep.so
./usr/local/lexmark/08zero/lib/liblxdwflib.so
./usr/local/lexmark/08zero/lib/liblxdwhpec.so
./usr/local/lexmark/08zero/lib/liblxdwhpeh.so
./usr/local/lexmark/08zero/lib/liblxdwhpep.so
./usr/local/lexmark/08zero/lib/liblxdxflib.so
./usr/local/lexmark/08zero/lib/liblxdxhpec.so
./usr/local/lexmark/08zero/lib/liblxdxhpeh.so
./usr/local/lexmark/08zero/lib/liblxdxhpep.so
./usr/local/lexmark/08zero/lib/libnpa407.so
./usr/local/lexmark/08zero/lib/libprintengine.so
./usr/local/lexmark/08zero/lib/libprinterdictionary.so
./usr/local/lexmark/08zero/lib/libsane-Lexmark08_1_0_0.so.1.0.18
./usr/local/lexmark/08zero/lib/libuiocli.so
./usr/local/lexmark/08zero/lib/libuiocmd.so
./usr/local/lexmark/08zero/lib/libusblp.so
49798 blocks

 

2. Installing the Files Manually

 

After extracting the contents of the rpm package, copy the files to their final destination:


root@awake:~/selfgz3382# cp -R ./usr /

 

Now move to /usr/local/lexmark and run the "08z-series-driver.link" script with "/usr/local/lexmark" as a parameter:

 

root@awake:~/selfgz3382# cd /usr/local/lexmark
root@awake:/usr/local/lexmark# ls
08zero  08z-series-driver.link  08z-series-driver.unlink
root@awake:/usr/local/lexmark# ./08z-series-driver.link /usr/local/lexmark
-- Updating symbolic links

 

The above script creates symbolic links to your Lexmark files. Verify that they were properly created:

 

root@awake:/usr/local/lexmark# ls -l /usr/lexinkjet/
total 0
lrwxrwxrwx 1 root root 25 2010-03-01 19:46 08zero -> /usr/local/lexmark/08zero
root@awake:/usr/local/lexmark# ls -l /usr/lib/liblx*
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdqflib -> /usr/local/lexmark/08zero/lib/liblxdqflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdqflib.so -> /usr/local/lexmark/08zero/lib/liblxdqflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdqhpec -> /usr/local/lexmark/08zero/lib/liblxdqhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdqhpec.so -> /usr/local/lexmark/08zero/lib/liblxdqhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdqhpeh -> /usr/local/lexmark/08zero/lib/liblxdqhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdqhpeh.so -> /usr/local/lexmark/08zero/lib/liblxdqhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdqhpep -> /usr/local/lexmark/08zero/lib/liblxdqhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdqhpep.so -> /usr/local/lexmark/08zero/lib/liblxdqhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdrflib -> /usr/local/lexmark/08zero/lib/liblxdrflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdrflib.so -> /usr/local/lexmark/08zero/lib/liblxdrflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdrhpec -> /usr/local/lexmark/08zero/lib/liblxdrhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdrhpec.so -> /usr/local/lexmark/08zero/lib/liblxdrhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdrhpeh -> /usr/local/lexmark/08zero/lib/liblxdrhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdrhpeh.so -> /usr/local/lexmark/08zero/lib/liblxdrhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdrhpep -> /usr/local/lexmark/08zero/lib/liblxdrhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdrhpep.so -> /usr/local/lexmark/08zero/lib/liblxdrhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxduflib -> /usr/local/lexmark/08zero/lib/liblxduflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxduflib.so -> /usr/local/lexmark/08zero/lib/liblxduflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxduhpec -> /usr/local/lexmark/08zero/lib/liblxduhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxduhpec.so -> /usr/local/lexmark/08zero/lib/liblxduhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxduhpeh -> /usr/local/lexmark/08zero/lib/liblxduhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxduhpeh.so -> /usr/local/lexmark/08zero/lib/liblxduhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxduhpep -> /usr/local/lexmark/08zero/lib/liblxduhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxduhpep.so -> /usr/local/lexmark/08zero/lib/liblxduhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdwflib -> /usr/local/lexmark/08zero/lib/liblxdwflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdwflib.so -> /usr/local/lexmark/08zero/lib/liblxdwflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdwhpec -> /usr/local/lexmark/08zero/lib/liblxdwhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdwhpec.so -> /usr/local/lexmark/08zero/lib/liblxdwhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdwhpeh -> /usr/local/lexmark/08zero/lib/liblxdwhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdwhpeh.so -> /usr/local/lexmark/08zero/lib/liblxdwhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdwhpep -> /usr/local/lexmark/08zero/lib/liblxdwhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdwhpep.so -> /usr/local/lexmark/08zero/lib/liblxdwhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdxflib -> /usr/local/lexmark/08zero/lib/liblxdxflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdxflib.so -> /usr/local/lexmark/08zero/lib/liblxdxflib.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdxhpec -> /usr/local/lexmark/08zero/lib/liblxdxhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdxhpec.so -> /usr/local/lexmark/08zero/lib/liblxdxhpec.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdxhpeh -> /usr/local/lexmark/08zero/lib/liblxdxhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdxhpeh.so -> /usr/local/lexmark/08zero/lib/liblxdxhpeh.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdxhpep -> /usr/local/lexmark/08zero/lib/liblxdxhpep.so
lrwxrwxrwx 1 root root 44 2010-03-01 19:46 /usr/lib/liblxdxhpep.so -> /usr/local/lexmark/08zero/lib/liblxdxhpep.so

 

Next, add a symlink in /usr/lib/cups/backend from lxbusb to lxk08usb. This is needed as CUPS will try to use "lxkusb" and not "lxk08usb":

 

root@awake:/usr/lexinkjet/08zero/bin# cd /usr/lib/cups/backend/
root@awake:/usr/lib/cups/backend# ln -s lxk08zusb lxkusb
root@awake:/usr/lib/cups/backend# ls -l | grep lxk
lrwxrwxrwx 1 root root    39 2010-03-01 19:46 lxk08zusb -> /usr/local/lexmark/08zero/bin/lxk08zusb
lrwxrwxrwx 1 root root     9 2010-03-01 20:16 lxkusb -> lxk08zusb

 

3. Resolving Missing 32-bit Dependencies

 

The 32-bit binaries that may cause problems are located in "/usr/lexinkjet/08zero/bin":

 

root@awake:/usr/local/lexmark# cd /usr/lexinkjet/08zero/bin
root@awake:/usr/lexinkjet/08zero/bin# ls -l
total 164
-rwxr-xr-x 1 root root 25028 2010-03-01 19:45 lxk08zusb
-rwxr-xr-x 1 root root 63851 2010-03-01 19:45 printdriver
-rwxr-xr-x 1 root root 72839 2010-03-01 19:45 prnutility

 

Run ldd to check for missing shared libraries. If the following command returns nothing:


root@awake:/usr/lexinkjet/08zero/bin# ldd lxk08zusb printdriver prnutility | grep "not found"

 

Then all dependencies are satisfied. On Ubuntu 9.10, I didn't have missing shared libraries, but in Debian I did:

 

root@sidux:/usr/lexinkjet/08zero/bin# ldd lxk08zusb printdriver prnutility | grep "not found"
libcupsimage.so.2 => not found

 

To solve this problem, I downloaded the 32-bit libcupsimage .deb package from the Debian website, extracted its contents and then manually copied libcupsimage.so.2 to /usr/lib32. After copying libcupsimage.so.2, I checked again, to see that libcupsimage.so.2 had a dependency on libavahi-client and libavahi-common:

 

root@sidux:/usr/lexinkjet/08zero/bin# ldd lxk08zusb printdriver prnutility | grep "not found"
libavahi-common.so.3 => not found
libavahi-client.so.3 => not found

 

Simply manually install 32-bit shared libraries until ldd stops complaining.

 

4. Configuring CUPS

 

Before continuing, connect your Lexmark printer by USB to your Linux computer. Open your favorite browser and go to localhost:631. This is your CUPS configuration page, where you can add a new printer. Click on "Administration->Add Printer". You may see different entries listed that seem to match your Lexmark printer, but the one you need is "Lexmark USB Backend #1". All others won't work. If "Lexmark USB Backend #1" is not listed, then you won't be able to configure your printer. For some reason, while I could get it listed in Debian, I was unable to make it work in Ubuntu 9.10. If someone figures out why it doesn't work in Ubuntu, please mail me and I'll update this article. Here is what you should see:

 

 

Click "Continue" and follow instructions. When asked for a printer driver, choose to specify your own PPD file. The PPD files are located in "/usr/local/lexmark/08zero/etc". Here is what the installer's readme says about the PPD files:

 

Printer                            PPD
------------------------------------------------------
Lexmark Z2400 Series         ..... lxZ2400.ppd
Lexmark 3600-4600 Series     ..... lx36-46.ppd
Lexmark 4900 Series          ..... lx4900.ppd
Lexmark 5600-6600 Series     ..... lx56-66.ppd
Lexmark 7600 Series          ..... lx7600.ppd

 

In my case, I have a Lexmark x4690, so the correct ppd is lx36-46.ppd.

 

5. Conclusion

 

If your installation is successful, then you should be able to print a test page. If it doesn't work, don't give up. If you find any tricks not listed in this article, please mail me so that I update this article and make it easier for other people to install their Lexmark printer driver in Linux.



 
Sidux: Debian Hot & Spicy
Tuesday, 16 February 2010 19:55

About two months ago, I got fed up with Debian, and was looking for a new distribution. The biggest problem with Debian is that you're never really satisfied of the branch you're using. If you're using stable, you get really old software, but at least it's stable. If you're using testing, you get newer software, but if a package in testing is broken while a fixed version of it is present in the unstable branch, it still takes time for the fixed package to be promoted to the testing branch. The other option is to simply use the unstable branch, but then you are playing russian roulette with your system each time you dare to update it. As you may already know, Debian releases are named after characters from Toy Story. The unstable branch is given the perpetual name of "Sid", the kid that likes to break toys in the movie.

 

Having tried a couple of distributions, I didn't really know what I would like better than what I had. I'm already using Ubuntu on my laptop, and while it makes a nice laptop distribution I am quite unhappy with its stability. Even though I've been using Debian testing for somewhere about two years, I never had my kernel crash badly. My experience with stock kernels from Ubuntu really isn't as good: Ubuntu 9.04 would systematically crash on first boot on my laptop and on my friends laptop, and then a lot of the stock kernels would randomly crash. I eventually found a particular version of the stock kernel that would run *fine*, but it's still incredible that kernel stability is such an issue in Ubuntu. I recently changed my laptop, and installed Ubuntu 9.10. This time, it was way better than 9.04 in terms of stability, but I still managed to get a couple of random crashes. I thought it would probably be my hardware, but no, I've seen Ubuntu crash a couple of times on totally different hardware. I don't know what the Ubuntu team is doing to their stock kernels, but it really looks like other distributions are better at patching them.

 

Ok, to sum it up, I was fed up with Debian testing and I wasn't really interested in putting Ubuntu on my desktop computer knowing that it would likely have random kernel crashes just like on my laptop. In this moment of despair, I actually found my dream Linux distribution: sidux. From the name, you can probably guess that it stands for a contraction of "Debian Sid Linux". What sidux is in fact, is a distribution based on the unstable Debian branch, but with repositories of fixed packages that mask broken packages in Sid. In other words, the sidux developers are working at fixing broken packages in Sid so that you don't end up breaking your system. Of course, they can't fix everything or prevent any problems from happening, as you must not forget that sidux is still Debian Sid. However, after two months of regular usage, I have to say that I am amazed at how ridiculously easy maintaining my system was. I can barely say I had anything to fix, really.

 

Now, where's the catch? There is a little one that some of you may not like: only XFCE and KDE are officially maintained. This means that while you can decide to install Gnome, the Sidux developers won't spend all their time trying to maintain it. But, really, if you think you can't live without gnome, you actually can. I've been using Gnome for a while and never liked KDE, so I went for the XFCE installation and then just installed a couple of Gnome programs. In fact, it's even better than gnome, as I realized I didn't really need most of it. If you're a cairo-dock user just like me, and that you are using it with Gnome, you have probably noticed that it is really hard to remove the top panel. Well, it's a trivial thing to do in XFCE, and it's more lightweight. Ok, one could argue that my usage of XFCE barely makes it "XFCE", but I'm very happy with the way I've set it up. Here's how it looks like:

 

 

Notice that at the moment where I took this screenshot, the kernel version that can be seen on it was actually the latest one ;) This is one of the advantages of sidux: you really get the latest packages for everything, and you have a HUGE selection of packages, because it is still Debian Sid, while not suffering from major instability problems. When I first installed it, I really was expecting major problems. It never happened, and it has simply been working like a charm. All you really need to do is pay attention to the Sidux manual to learn how to properly maintain your system and you should be good. In the eventuality of a major problem, you can get help at the sidux IRC channel.

 

Obviously, because of the fact that sidux is based on the unstable Debian branch, I would not recommend it to a Linux beginner. However, if you have some level of comfort with Linux already and you know how to google for answers to problems, then you should have no problem at all using it. If you're interested in trying it, pay special attention to the way you need to burn your sidux DVD. It must be burned at slow speeds (8x and under) because it's using high compression technology. I ignored the warning the first time and ended up burning a corrupted DVD that stopped installation at 50%. I just paid more attention to this special need and burned a second disc that worked perfectly. Also, ext4 is supported as a root file system, as opposed to Debian :P.

 
Clonezilla, a Norton Ghost Alternative
Wednesday, 18 November 2009 23:23

When it comes to cloning your hard disk or creating a ghost image of it, you often hear about Norton Ghost. I never really had to use such a tool until now, where I wanted to move my Windows Server 2008 installation from a 40 GB to a 250 GB hard disk without the trouble of reinstalling everything. I wasn't really interested in trying to use a proprietary tool, so I just googled for a free software alternative. I immediately found Clonezilla. Looking at the description convinced me that it was the perfect tool for me. A broad range of filesystems are supported (ext2, ext3, ext4, reiserfs, xfs, jfs, FAT32, NTFS and HFS+) and if the filesystem is not supported it simply does a sector-to-sector copy. I was surprised to see that not only it supports hard disk cloning over the network, but it also supports multicast hard disk cloning using a server that can clone to a large number of target machines at the same time. In my case, all I had to do was boot on the live CD, select local disk to local disk cloning, specify a source and a target, and voila. Easy as pie. I'll probably use it to create a ghost after, as I like my Windows Server 2008 installation in its current state. Definitely a great tool to keep in your pile of handy live CDs.

 

While googling I also found an interesting article on how to use Clonezilla to transfer a native OS installation to a virtualized environment:

Migrate to a Virtual Linux environment with Clonezilla

 

I guess that doing things the other way around (from a virtualized environment to native) shouldn't be much harder, if the OS doesn't complain too much about the drastic environment change.

 
Improving Gnome Appearance
Thursday, 12 November 2009 00:08

One of the cool things with Linux is that it is very easy to customize it. If you've never really spent time on customizing the appearance of your gnome desktop, here are some tips I've learned over time that greatly enhance the beauty of my desktop. Hopefully you will also like them. For my demonstration I will use my debian system, but the same steps can be used on any system that comes with gnome.

 

1) Set panel transparency

 

This is about the first thing I do on a fresh installation. An opaque panel? No way. You want it to be half-transparent so that your background can be seen a little bit through it. To change transparency, right click your top panel, and select properties. Click on the "background" tab, where you will be given an option to set the panel transparency:

 

 

For best results, I suggest that you try setting it half transparent half opaque. A panel that is too transparent doesn't look any better than an opaque panel.

 

2) Change panel size

 

I find that the default size of the top panel is too small. The reason why I suggest to increase its size is to get slightly bigger icons on your top panel. I prefer to set the top panel size to 32 pixels:

 

 

3) Replace bottom panel with cairo-dock

 

You may have never thought the bottom panel was just fine, but no, it's not. Just replacing it with a much better bottom panel will greatly enhance your Linux experience. First install cairo-dock, and then remove your bottom panel. The default configuration and theme for cairo-dock may not be what you like, so spend some time in its configuration menu and try different themes until you find one you like. One of the things I always disable in cairo-dock are the separators. To disable separators between dock sections, go in the "Appearance / Icons" section of the configuration menu and then expand the "Separator" subsection at the bottom. Uncheck "Automatically add separators" and you're done.

 

Cairo-dock comes can be ran in two different modes, "no OpenGL" and "with OpenGL". If you have trouble getting 3D acceleration to work on your system, use "no OpenGL", which will work fine but will not look as nice as the OpenGL mode. Otherwise, just make sure that 3D acceleration is working fine and that compiz is installed and enabled. Now, you don't want to have to manually start cairo-dock each time you log in, so you want to add it to your startup applications (System->Preferences->Startup Applications):

 

 

4) Change theme and cursor color

 

Maybe you haven't thought of changing the theme, but not the cursor color. I actually like the black cursor way better than the default white one. If you're using Ubuntu, chances are that you hate the default '"Human" theme. My favorite theme is "Glossy" or any theme approaching it. Select your favorite theme and then click "Customize", and select the "Pointer" tab. That's where you can change the cursor color:

 

 

If you would like a bigger cursor, this can also be set in the same place.

 

5) Get a new background

 

This one is quite obvious. I suggest that you take a look at www.gnome-look.org for great wallpapers. In my case, I use two screens, so I want a wallpaper than can nicely spread across the two of them. In this case, the best is to find a wallpaper in svg format, which can easily be scaled without loss of quality (on gnome-look.org, those wallpapers can be found in the wallpapers/svg section).

 

6) Final result

 

Finally, here is what my desktop looks like (only left screen is shown):

 

 

.

 
«StartPrev1234NextEnd»

Page 1 of 4