My Employer Got a Free Software Compatible x86 Laptop: Acer eMachines D725

Submitted by Eus
on September 2, 2009 - 11:56pm

Last month my employer asked me to find for a free software compatible x86 laptop with the best bargain. So, based on my previous experience, I offered him Asus EEE PC 1000HE and A*Note. But, those didn't satisfy him since Asus was too slow for development works (e.g., compiling programs) as a result of using Intel Atom, and A*Note's warranty period was too short. So, I said to him that we had to find a laptop equipped with Intel chipset (Intel 3D graphics accelerator is free software compatible) and Atheros wireless card (Intel wireless card is NOT free software compatible). A week ago, my employer called me up to help him check the components of a laptop that he was interested in buying. All was okay, so in the evening he asked me to set up a GNU/Linux Ubuntu 8.04 on the laptop. How surprised I was knowing that the laptop is Acer eMachines because previously I had ever tried the laptop out and it hung when playing an ogg movie titled `Experience ubuntu' in directory Examples of the home directory.

Yes, the laptop failed to play the ogg movie again with the stock kernel (2.6.24-19-generic). Moreover, since the laptop started with the stock kernel and had its NICs unusable, I downloaded Uncle Gnufs' linux kernel image and headers in another machine and transported them to the laptop with a USB disk: wget http://aligunduz.org/gNewSense/freedomshoppe/linux-{image,headers}-2.6.30-libre-fshoppe1_i386.deb
Putting those files in the home directory, I installed them into the system to get the laptop's NICs up and running: sudo dpkg -i linux-{image,headers}-2.6.30-libre-fshoppe1_i386.deb
After that, I restarted the laptop and booted into Uncle Gnufs' linux kernel.
Upon entering the GUI login screen, the following error message saying that the video adapter is unrecognized was displayed.

Ubuntu is running in low-graphics mode

Your screen and graphics card could not be detected
correctly. To use higher resolutions, visual effects or multiple
screens, you have to configure the display yourself.

[ ] Always run in low-graphics mode

[Configure] [Shut Down] [Continue]

I clicked `Continue' to force my way into the system.

After comparing the output of `lsmod' between running the stock kernel and Uncle Gnufs' kernel, I figured out that the culprit was that my installation of Uncle Gnufs' linux kernel didn't load a special back-ported Intel AGP driver located under `/lib/modules/2.6.24-19-generic/ubuntu/char/intel-agp-ich9m/'. It turned out that the information regarding this special driver (intel-agp-ich9m) was very sparse on the Internet. So, first I asked the question to fellow Free Software activists via IRC in #gnewsense channel because gNewSense derives from Ubuntu Hardy 8.04, with which I was having a problem. Not getting any information, I turned to Ubuntu Launchpad's question facility: https://answers.launchpad.net/ubuntu/+question/79296. I got no answer there but a pointer to a better place to ask the question: https://lists.ubuntu.com/archives/kernel-team/2009-August/006769.html. It was finally answered there.

Based on the answer, I investigated the source code of Uncle Gnufs' kernel and found out that while PCI_DEVICE_ID_INTEL_GM45_HB was treated as I965 on the stock kernel, it is treated as G4X on the newer kernels including Uncle Gnufs' kernel. So, I made the following patch and recompiled Uncle Gnufs' kernel as follows:

------ 8< --- emachines.patch
--- drivers/char/agp/intel-agp.c	2009-06-10 10:05:27.000000000 +0700
+++ drivers/char/agp/intel-agp.c	2009-08-13 19:47:42.000000000 +0700
@@ -60,6 +60,7 @@
 		 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965Q_HB || \
 		 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_HB || \
 		 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GM_HB || \
+		 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB || \
 		 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GME_HB)
 
 #define IS_G33 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G33_HB || \
@@ -74,7 +75,6 @@
 #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGD_E_HB || \
 		agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \
 		agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB || \
-		agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB || \
 		agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G41_HB)
 
 extern int agp_memory_reserved;
------ 8< -------------------

Following Uncle Gnufs' tutorial (http://www.aligunduz.org/articles/buildkernel.html) with some modifications, prepare for building Uncle Gnufs' kernel from its source:
1. sudo aptitude update
2. sudo aptitude install fakeroot kernel-package libncurses5-dev build-essential

Now on the the recompilation:
1. Download Uncle Gnufs' linux kernel source geared for Asus EEE PC: http://aligunduz.org/gNewSense/freedomshoppe/linux-source-2.6.30-libre-f...
2. Install the source: sudo dpkg -i linux-source-2.6.30-libre-fshoppe1_all.deb
3. Extract the source: tar xjf /usr/src/linux-source-2.6.30-libre-fshoppe1.tar.bz2
4. Get into the source directory: cd linux-source-2.6.30-libre-fshoppe1
5. Apply my emachines.patch: patch -p0 < PATH_TO_PATCH_FILE/emachines.patch
6. Following Uncle Gnufs' tutorial, execute the following commands:
a. make clean mrproper
b. cp /boot/config-2.6.30-libre-fshoppe1 ./.config
c. make oldconfig
d. make-kpkg clean
e. fakeroot make-kpkg --initrd --append-to-version=-emachines kernel_image kernel_headers
7. After completing the compilation process, restart the laptop and boot into the stock kernel so that Uncle Gnufs' linux kernel can be purged to allow the installation of the modified version that has just been compiled: sudo dpkg -P linux-{image,headers}-2.6.30-libre-fshoppe1
8. Install the modified versions: sudo dpkg -i linux-{image,headers}-2.6.30-libre-emachines_2.6.30-libre-emachines-10.00.Custom_i386.deb
9. Restart the laptop and boot into the modified kernel.

Although the recompilation fixes the error message saying that the video adapter is unrecognized, it does not fix the problem with the hanging of the laptop when an ogg movie titled `Experience ubuntu' in directory Examples of the home directory is played. So, I had the hunch that I needed to recompile the X server as well.

But, before I recompiled the X server, I decided to give GNU/Linux Ubuntu Jaunty (9.04) a try first. And, yes, it works well including playing the `Experience ubuntu' movie. So, to ensure that the problem does not lay in Uncle Gnufs' kernel, I installed Uncle Gnufs' kernel in Jaunty. It works well. Therefore, the problem should lay with the X server of my Hardy. Unfortunately, the laptop was taken from me and assigned to one of my colleague that works at a client site. So, I put this case on hold until I can have the laptop again. Meanwhile, I would be glad if someone can shed a light on this problem.