
Debian Logo
This post explains how I have installed the Debian Lenny distribution on my HP DV6810us Laptop.
The following are the configuration of my Laptop
Model: HP DV6810us
Processor: AMD Turion 64 bit X2 (Dual Processor)
RAM: 3Gigs
Graphics Card: nVidia GeForce Go 7150M
Wireless Card: Atheros AR5007EG Chipset: AR242x
Current OS: Windows Vista (I was trying for a dual boot with Vista and Debian)
Picking up the right Distribution
There are many Linux distributions available in the market viz. Debian, Ubuntu, Slackware, Fedora Core, Mandrake Linux etc. But debian was my choice because its the true Linux supported by the Open Source Community. Most of other distributions like Ubuntu are based on debian. It doesn’t matter much which flavor you are installing because all the linux distributions are having the same underlying kernel
Picking up the right architecture
Having a 64bit AMD Turion processor, my biggest concern was which architecture should I choose. I searched a bit on the net and finally decided to go with the i386 architecture instead of AMD 64. Even though 64 bit is the future, I decided to go with i386 because of the following reasons
- amd64 architecture causes a lot of memory overhead
- currently there is a little or no performance improvement for most of the applications
- 64bit version of many applications are still unavailable (Flash Player being one). You might need to install 32 bit libraries to make them work under the 64bit architecture
- The AMD Turion processor overheats and the processor fan will be on most of the time, which is very frustrating to me
Downloading the Install Image
Debian can be downloaded from the debian website. http://www.debian.org/distrib/
You can either download the CD or DVD image from their FTP site http://www.debian.org/CD/http-ftp/#stable. Make sure that you use a download manager software like Download Accelerator because you can resume if your download breaks in middle. The best option is to use the Jigdo because it strains the debian servers, the least.
I downloaded the first CD image from the following location http://cdimage.debian.org/debian-cd/5.0.0/i386/iso-cd/ . You need only the first CD for the basic debian installation. Later you can download packages and install it yourself. After downloading the ISO image for CD-1, burn it on a CD and make sure that it boots
Making Space for Debian on your Hard Disk
As we all know, Linux uses a different file system from Windows, called ext3 (which has a journaling layer over ext2 file system). In fact you can choose from ext2, ext3, reiserfs etc. My choice was Ext3.
So for installing debian you need two separate partitions other than your windows partitions
- root partition ( will be used to store all your data in the debian system)
- swap partition (will be used as swap space which is analogous to the virtual memory space in windows)
You can use a software like “Partition Magic” for creating these above partitions without loosing your windows data. You can also do it while installing debian without loosing your windows data. The following link explains in detail how to create Linux partitions on windows http://forums.debian.net/viewtopic.php?t=30611
Booting from the Debian Installation CD
Now its the time put the Debian Installation CD and restart the system. Let the system boot from the CD. On my Laptop, it seemed to hang while booting from the CD. I later found out that it was because debian was unable to populate some device on my laptop. So I have to wait for a timeout on that device and debian will boot. I also found out that instead of waiting just press and hold the power button for a second will resume the booting.
After booting on to the CD, I can either go for a graphical installation or text installation. I chose graphical. In the next few screens you can select your language, country, etc and finally it will come to the Hard Disk Partitioning screen. Use the above link (http://forums.debian.net/viewtopic.php?t=30611) to create the root and swap partitions. Generally swap partitions will be allocated 10% - 15% of root partition size.
Installing Debian
After the partitioning everything is simple and straight forward. There might be a problem while configuring the network. I selected my ethernet card as the default networking device and configured it. On HP DV6810 the wireless will not be configured during the installation. Just skip it. After installing the base system debian will detect whether your system is a laptop or a desktop and automatically select the required packages by default. Select all the defaults and finish the installation. At the end of the installation debian will detect the Windows OS and will ask you before installing the GRUB boot loader. Once the installation is finished Debian will eject the CD-Rom and will reboot the system.
When I rebooted after installation I had two problems which I had already anticipated. There was no wireless and the display was not in proper resolution. We are going to fix these two problems after logging in
Why no Wireless and Improper Display after Debian Installation?
Simple Question!! Simple answer!! because the drivers are missing…. But why the drivers are missing??
We all know that Debian is an open source operating system available under the GPL(GNU Public Licence). Everybody has the freedom to install, use and modify it according to your needs. But there are some proprietary hardware vendors like Atheros who neither provide a Linux Driver nor publish the Specifications for their proprietary hardware (Hardware Specs are necessary for writing a driver for that hardware). So the open source community has to inspect the hardware, find out the specs and write a driver for that. Since this is a very difficult and time consuming job, drivers for many new hardwares are unavailable for Linux.
There are some other hardware vendors like nVidia who does provide a Linux driver for their hardware; but we have to accept their licence agreements which is far away from the GPL licence. So debian can’t include these drivers in its distribution.
Setting up the Display
Setting up display was easy for nVidia graphics card. nVidia provides a Linux Driver for most of their graphics cards. So I just had to download and install it. Following is the procedure I followed to setup the display.
- Go to “Download Drivers” section of the nVidia website. Then select the proper graphics card. I selected “Product Type: GeForce”, “Product Series: GeForce Go 7 Series (Notebooks)”, “Operating System: Linux 32 bit”, “Language:English (US)”. Then click the search button and download the driver. The direct link to download is http://us.download.nvidia.com/XFree86/Linux-x86/180.29/NVIDIA-Linux-x86-180.29-pkg1.run
- To install the driver we need the ‘build-essential’ package and ‘linux-headers’ package to be pre-installed on the system. These packages provides the necessary header files to compile the graphics driver modules. Install these two packages by issuing the following commands on a root console
apt-get install build-essential
apt-get install linux-headers-$(uname -r)
- You also need to have the GNU C Compiler pre-installed. So if gcc is not installed on your machine by default, install it by issuing the following command
apt-get install gcc
- To install the driver, go to the console mode by pressing ALT+CTRL+F1. Then login as the root
- Before installing nVidia driver, we need to stop the X Server by issuing the following command (gdm stands for Gnome Display Manager)
/etc/init.d/gdm stop
- Execute the downloaded file by issuing the following command (make sure that the downloaded file is in the current working directory)
sh NVIDIA-Linux-x86-180.29-pkg1.run
- First it will ask you to agree to their licence terms.
Then it will ask something like the following
“No precompiled modules found. Do you want to download one from nVidia website?”
Select “No” here.
In the next step it will compile a driver module for you.
It may also produce a warning like “The program is compiled using a different version of the compiler, do you want to do this?” Select “Yes”.
Now after compiling and installing the driver modules, it will ask you for confirmation before modifying the XConfig file. Select “Yes” here also. (It will backup the current XConfig file before modifying it. So if this didn’t work, you can go back to your old XConfig file)
- After the program finishes, start the X-server by issuing the following command
/etc/init.d/gdm start
Now you will be able to see the nVidia logo, and the display will be in proper resolution
Setting up the Wireless
Setting up wireless is usually a bit difficult task for Atheros and Broadcom wireless cards. My laptop has an Atheros Wireless card (AR5007EG). The default driver installed on Debian for my Atheros card was ath5k, which didn’t work. So I searched on the internet and found out that I have two options to go with. First is the open source Madwifi drivers. Second option is using the proprietary windows drivers in Debian using the open source wrapper Ndiswrapper.
Madwifi Vs Ndiswrapper
Madwifi is an open source driver for Atheros wireless cards on Linux. The Madwifi project actually provides three drivers viz. 1. madwifi 2. ath5k 3.ath9k. More information about Madwifi drivers can be found at http://madwifi-project.org/ . The unfortunate thing about madwifi is that its current stable release version v0.9.4 does not support the AR5007EG wireless card. But I have heard that the snapshot of latest testing version does work with the AR5007EG card but only on 32-bit (i386) version of Debian. You can download the snapshot from http://snapshots.madwifi-project.org/
Ndiswrapper is an open source wrapper which act as a middle layer between the Linux Kernel and the Windows drivers. Since with Ndiswrapper we are using the driver supplied by the vendor itself, probably Ndiswrapper will be a bit faster than Madwifi. Ndiswrapper currently supports Atheros AR5007EG on both 32-bit (i386) and 64-bit (amd64) versions of Debian. But remember, by using Ndiswrapper, you will be using a proprietary windows driver on your GPL Debian!!
Based upon the above facts, I decided to go with Ndiswrapper. I can accomodate using the proprietary windows drivers until Madwifi begins support for this card.
Installing Ndiswrapper
I have found a very good tutorial on installing Ndiswrapper. The link is http://www.linuxquestions.org/linux/answers/Networking/NdisWrapper_The_Ultimate_Guide/. Basically I just followed the instructions in this tutorial to get my wireless working. I am summarising the steps below. (The following process requires lot of files to be downloaded from the internet. Since I didn’t have wireless, I used a wired connection or I could download these files using Windows)
- The first step is to find out the appropriate windows drivers for the wireless card. I have downloaded the windows XP 32-bit drivers for my Atheros AR5007EG card from the following link http://www.atheros.cz. The file name is xp3264-7.6.1.184-whql.zip
- Extract this zip file to a folder. You can see a lot of files but we need only the following files
- athw.sys
- athwx.sys
- layout.bin
- netathw.inf
Copy these files to another directory named wireless-drivers inside your home directory
- Now download Ndiswrapper from the following link http://sourceforge.net/projects/ndiswrapper/ to your home directory. The current stable release version is 1.54
- Now before installing Ndiswrapper you have to remove the existing driver. On my system, the existing driver was ‘ath5k’. On your machine it will be ‘ath5k’ or ‘ath_pci’ or something starting with ‘ath’. Open up a root terminal and issue the following command to see all the modules in your system
lsmod
After finding out the existing driver, it has to be unloaded from the kernel. Issue the following command to do this
rmmod ath5k
If you have ath_pci, replace ‘ath5k’ with ‘ath_pci’
Now check your ‘/etc/modules’ file to see if ‘ath5k’ is listed there. Issue the following command
gedit /etc/modules
This will open up the modules file in the Text Editor. If ‘ath5k’ is listed there, then remove it
Now we need to blacklist this driver. (By blacklisting the driver, you are telling the system that this driver is dangerous for the system and it should not be loaded under any circumstance. We are doing this inorder to prevent loading of this ath5k driver, which is anyway not working). To backlist the driver issue the following command
gedit /etc/modprobe.d/blacklist
This open the file ‘blacklist’ on the Text Editor. Add the following line at the end of this file and save it.
blacklist ath5k
If you have ath_pci then replace ‘ath5k’ with ‘ath_pci’. On my system the bottom part of the file looked like the following
blacklist wafer5823wdt
blacklist wdt285
blacklist wdt977
blacklist wdt
blacklist wdt_pci
blacklist ath5k
Now restart the system. Once the system is started issue the following command
iwconfig
In the output of the command you won’t be able to see any wireless device
- Now open a root terminal and issue the following command to unzip the ndiswrapper
tar xvf ndiswrapper-1.54.tar.gz
It will extract the contents of the zip file to a directory named ndiswrapper-1.54. Now move on to this directory by issuing the following command
cd ndiswrapper-1.54
Now issue the following command to compile the Ndiswrapper. (Make sure that you have the build-essential package and the linux-headers package, as described above)
make
If the make command completes successfully, issue the following command to install ndiswrapper
make install
Once this command completes, the ndiswrapper module will be installed. Now move to the ‘wireless-drivers’ folder created in Step. 2 by issuing the following command
cd ../wireless-drivers
Now install the windows drivers using Ndiswrapper by issuing the following command
ndiswrapper -i netathw.inf
Once the command is completed, make sure that there are no errors logged on the system by issuing the following command
dmesg
If the dmesg output shows some errors related to ndiswrapper, then you are at your luck
You can check the driver installed with Ndiswrapper by issuing the following command
ndiswrapper -l
Now we need to insert the ‘ndiswrapper’ module in to “/etc/modules” file. (This will make sure that the ndiswrapper module will be loaded everytime you boot your computer). Issue the following command
gedit /etc/modules
This will open up the modules file on the text editor. Add the word ndiswrapper as the last line and save the file. On my system the file content look like the following
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
loop
sbp2
ndiswrapper
Now restart the computer (ndiswrapper will be loaded when the computer starts. You can also use modprobe or insmod to load the module yourself)
Once the computer starts up, open a root terminal and issue the following command
iwconfig
In the output of this command if you can see your wireless device as wlan0, then wireless is configured properly
- Now we need a wireless connection manager software to manage all the connections. By default, the ‘Network Manager’ package will be installed on debian. If you have ‘Network Manager’ on your system, you can see the wireless networks. Select your network and connect to it.
- On my system the ‘Network Manager’ was missing. So I decided to install a software named ‘wicd’ as my wireless manger. This is a pretty good software. You can get more details about this at the following link http://wicd.sourceforge.net/. I followed the below steps to install wicd
- If you have access to a wired network, you can easily install wicd using apt-get (If you do not have access to a wired network, go to Step. 9). Make sure that the debian ftp mirrors are added to your /etc/apt/sources.list. Issue the following command
gedit /etc/apt/sources.list
- Then the sources.list file will be open in a text editor. Make sure that you have commented the CD source like the following
#deb cdrom:[Debian GNU/Linux 5.0.0 _Lenny_ - Official i386 CD Binary-1 20090214-16:29]/ lenny main
Then add the debian ftp mirrors and the wicd sources. So if any of the following lines are missing from your sources.list file, then add it and save it
deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb http://apt.wicd.net lenny extras
Now issue the following command to update your package info
apt-get update
The wicd package in debian package repository is cryptographically signed. So inorder to verify the signature we need to install the key in to the debian key ring. Issue the following command to do this
wget -q http://apt.wicd.net/wicd.gpg -O- | sudo apt-key add -
Once the key is installed, issue the following command to install wicd
apt-get install wicd
(wicd package has a dependancy on ‘wpa supplicant’ package. So this package also will be installed) Now you can see the wicd under “Main Menu > Internet > Wicd Network Manager’. Run this and you can see the wireless networks.
- If you do not have access to a wired network, you can manually download the wicd package (wicd_1.5.9_all.deb) using another machine from the following link http://sourceforge.net/project/showfiles.php?group_id=194573&package_id=229460
Then install this debian package by issuing the following command
dpkg -i wicd_1.5.9_all.deb
Conclusion
I hope the this article is informative and helpful for setting up your debian system. For me it took a lot of time to find out and do all these things. But once you are successful the satisfaction and happines you get is ineffable. Good luck to everyone who are trying Debian!!