Here is a real-world example of something Windows will never do do that Linux *encourages*: rebuilding your kernel to support new hardware. You can do this on Linux; you may not want to but it is really nice knowing that you can. Microsoft will never ever allow this so opting with Linux here is less a philosophical choice than a practical one. Same goes for the wireless and audio drivers. Now you probably will not want to compile your kernel every day but if you do it the Debian way, you can do it fairly easily and safely when you need to.
Normally installing Linux these days is a pretty uneventful process. Sure once in a while the odd bit of hardware can provide some drama but that usually lasts as long as it takes Google to hand me the answer. Sony hardware on the other hand usually has enough uniqueness to it that you get to test your problem-solving abilities or at the very least your patience. The Sony CR 190 was no different.
The hardware and software discussed in this article are a year old at this point; however the hardware is what you will find on the budget machines available today. Some of the hardware will probably be supported by a current distro without requiring such extraordinary measures but that is not the point. The skills used here are useful with just about any Linux with just about any hardware.
In this article we will install Debian Etch on a Sony Vaio CR 190 and at the end of the day have everything but the web cam working. We will rebuild the kernel from fresh source, we will configure and rebuild Alsa to support the advanced audio, we will enable hardware acceleration on a common GPU, and finally rebuild and configure the wireless drivers.
This was a gift from my lovely wife who had it engraved and really tricked out nicely. For what it is worth, the keyboard is probably the best I have ever felt and that is after 25 years of coding. Originally I wrote this when it was new (~ Sept 2007); I posted it to the main Linux laptops site. When I had the recent web server issues and had to change hardware, this document got left behind. When I corrected it and checked the laptop site, it was no longer listed there so I am posting it here.
Disclaimer: I work for Sony which has nothing to do with this or anything else on this website. Heck, I use my EEE more at work than a “company” laptop and paid full sticker price for the Vaio.
Basic specs:
| Item | Type | Status |
| CPU | Intel Core Duo 2 T7100 | Works |
| RAM | 1G default, 2G on mine | Works |
| GPU | Intel X3100 | Works, OpenGL 890 FPS |
| Sound | Intel HDA ICH8 Audio | Works |
| Wireless | Intel 4965 ABGN | Works mostly; when set to autostart in static IP mode, works on startup. When set to autostart in DHCP mode, it does not work until you (as root) do a network restart (“sudo /etc/init.d/networking restart”). |
| Ethernet | RealTek 8101E | Works |
| Webcam | Internal, unknown type | No Go |
| Memory card reader | Texas Instruments 5-in-1 Multimedia Card Reader | Not out of box but I didn’t really try. |
| Flash | Adobe | Working |
The Distro:
I wound up going with a straight Debian Testing (64-bit) for the end product for the following reasons:
-
I stuck with a Debian-based distribution because I know it the best and Ubuntu is based on Debian Testing anyways.
-
The key difference between Ubuntu, MEPIS and other Debian derivatives is that they have tweaked the systems to be automatic with a large cross-section of the hardware available whereas Debian is more of a vanilla “blank slate” with very few if any assumptions made on the target hardware. This is largely why Ubuntu et al run on maybe 3 architectures (32, 64 bit Intel and PPC) where Debian runs on 30. Consequently, when you hit some new bleeding-edge hardware like what is present in the CR-190, you need the blank slate to work with and Debian, traditionally the “harder” distribution, can actually be the easiest to get to work.
-
MEPIS 6.95 B3 was KDE-based, had video (to an extent) and audio working out of the box. Wireless and full video acceleration were MIA after several hours of effort.
-
Ubuntu Gutsy Tribe 5 (latest beta of version due out in October 2007) had audio, video and with a little work wireless working. The reason this was discarded was that A. It was an Alpha release, susceptible to breakage and B. while I got all of the key stuff working, something was wonky with the C run times because anything compiled on that machine, even the simplest apps, crashed with a core-dump.
-
Ubuntu Feisty needed a hack which basically back-ported the Intel video drivers out of Gutsy back to Feisty to get anything better than a rather hideous 800×600. Additionally, wireless refused to work consistently.
Now the Debian installation procedure may seem convoluted to the uninitiated but it wasn’t that bad if you knew what you were doing.
The Installation:
I used a Debian netinst image, which installs a tiny portion of Debian and installs the rest from the Internet. Specifically I downloaded and installed this:
The thing to know about the difference between Debian Testing and “test” versions of other distributions is that Debian has a historically long test period for packages and that for something to land in the “testing” zone, it has to be nearly defect-free for a long period of time. Testing for other distros is usually beta or even alpha-quality releases, often a LOT more buggy.
Anyhow, I initially used a regular ethernet connection to do the installation but even with that, even though Debian found the network card, for some reason it refused to move data. Thus, I rebooted, pressed F6 when given the chance for a custom install, and entered:
install vga=771 noapic nolapic
From here the text-based installer worked like normal; you set up the usual suspects (time zone, language, etc). When it got to the hard drive portion, I told it to use the whole hard disc and used the default partitioning. When asked about the package selection, accept the defaults (desktop, laptop and base system).
The installation will proceed to reformat the drive, install the base system, connect to the internet and pull the rest of the needed packages. Near the end of installation you will be asked to set the root password, the default user and set up the grub boot loader. Fill in the obvious information, accept the defaults for the boot loader and soon you should have to reboot. When you get finished with the reboot you will have a very plain GNOME-based installation.
Audio will work out of the box but not for long but that is OK. Wireless will not and video will only work with no acceleration. Not to worry.
Wireless and more:
What we need to do first is to enable mac80211 wireless support in the kernel so we will download a fresh batch of kernel source, configure and compile the kernel and install it. For those who care, this will be the “Debian way” of kernel compile/install in that we will create a compiled kernel in a .deb package that can then be simply installed. If anything goes wrong it can then just as easily be uninstalled but more importantly, if you have several laptops like this, the deb package can be copied to the new box and installed by-passing the kernel configure and build stage entirely. So lets get started. Open a term window and as root pull down the module-assistant and a few friends:
apt-get install module-assistant build-essential libncurses5-dev gettext fakeroot debhelper kernel-package.
Still as root:
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.tar.gz
tar -zxf ./linux-2.6.22.tar.gz
cd linux-2.6.22
make menuconfig
This will start the curses-based kernel configuration tool. Configuration can be daunting if you have never done it before but there is a safe-ish way of doing this. Understand that Debian does a good job of setting sane defaults and leaves the config file for this in /boot/. So near the bottom of the screen (you should make your term full screen if you have not already done so) you will find a Load Alternate Config option; select this and enter the path of the config file for the pre-existing kernel here. On my system it was config-2.6.21-2-amd64. Then from here, go into networking->wireless and activate mac80211 wireless support. Set any other options you feel safe doing; when done, select Save Alternate Config, accept the default of “.config” and then exit.
When ready, at the same menu prompt enter:
fakeroot make-kpkg –initrd –revision=custom.1.0 kernel_image
Where custom.1.0 can be any descriptive alpha-numeric combination. I did custom-vaio.1.0. This will compile the kernel and build a Debian package (.deb) file for it. This will take a little while.
When done, cd to the directory with the resulting deb file and enter:
dpkg -i <your deb file>.
When done, reboot; you will see your new kernel as the default option in the bootload menu and if all goes well, you will be back to your graphical login screen in short order.
Now, the reason you did all of this was to get the wireless stuff to compile since the Intel 4965 ABGN is so new. Download the latest driver and firmware from the Intel site. Untar the firmware and move it to /lib/firmware. Untar the iwlwifi driver, cd into the directory, make and make install (as root). Reboot.
Go to your System->Administration->Networking menu and configure the wireless card for your network. Now this is the odd part; I was only able to get it to autostart on boot up, If I set it to to static; DHCP would time out on boot up. However if I manually started it after boot up with a /etc/init.d/networking restart it worked every time. YMMV.
Now that you have a new kernel, the audio will be gone but not to worry. Go to alsa-project.org and download the development versions of alsa-driver, alsa-lib and alsa-utils to the /usr/src folder, untar them. Switch to the alsa-driver folder, and enter:
./configure –with-cards=hda-intel
make
make install
cd into the alsa-lib folder and:
./configure
make
make install
cd into the alsa-utils folder and:
./configure
make
make install
Reboot and you will have audio once again.
Video acceleration:
As root:
apt-get install xlibmesa-dri
apt-get install xlibmesa-gl
apt-get install xlibmesa-glu
apt-get install mesa-utils
apt-get install libgl1-mesa-dri
apt-get install libgl1-mesa-glx
Restart X and you will have as much video acceleration as the Intel 3100 will provide. Not great but better than software rendering.
Flash:
Edit your /etc/apt/sources.list file to look like this:
#
# deb cdrom:[Debian GNU/Linux testing _Lenny_ - Official Snapshot amd64 NETINST Binary-1 20070908-20:55]/ lenny contrib main
# deb cdrom:[Debian GNU/Linux testing _Lenny_ - Official Snapshot amd64 NETINST Binary-1 20070908-20:55]/ lenny contrib main
deb http://ftp.debian.org/debian/ lenny main non-free contrib
deb-src http://ftp.debian.org/debian/ lenny main non-free contrib
deb http://security.debian.org/ lenny/updates main contrib
deb-src http://security.debian.org/ lenny/updates main contrib
deb http://ftp.debian-unofficial.org/debian testing main contrib non-free restricted
deb http://getswiftfox.com/builds/debian unstable non-free
Save it, do an apt-get update. It will whine about some missing PGP keys; this is expected and fixable by downloading and installing the proper keys from the above sites. Then:
apt-get install flashplugin-nonfree
And you will have flash.
This is as much as I have going but it is enough to have a very capable system. Note that strictly speaking all of the reboots were not necessary; I did them to make sure that the right drivers would load on the next reboot. Modprobe and friends would have simply loaded the drivers if need be so the only truly essential reboot was the one after the kernel upgrade.
Jeff
UPDATE: 1 October 2008
This has been a sweetheart of a machine and definitely powerful enough to do what I want it to. As of this date, all of the Debian-based distros pretty much support things out of the box. I did find driver source for the web cam (something called a Motion Eye), built them but never got them to work. Even with that I think it is a good thing to learn some of these skills. They are non-trivial to beginners but they are also confidence-builders as well. When you get some problematic bit of gear working because you rebuilt your kernel and built the drivers from source as well (module-assistant is your friend here), it can be a nearly euphoric feeling (and if you are like me you are back into reconfiguring the kernel and making more with different settings almost immediately).
Peace,
JeffC

Related Articles
9 users responded in this post
What a stupid argument - Windows doesn’t let you recompile the Kernel primarily because there is no reason why you would - all of the items you listed in this article work in Windows (out of the box) by using ‘drivers’ - these should never be part of ‘the Kernel’.
Way to go at showing how easy it all is - just throw a dozen lines of random characters at a text terminal and you will be fine? Great, just what I wanted to hear.
Well Dave, personal experience would beg to differ; when machine that came with XP Pro on it could not even connect to the Internet to get drivers or recognize basic hardware like the USB ports, it kinda gives lie to the old concept that Windows implicitly made for a better install. Beyond that, if you were to hit hardware your version of Windows did not understand and the device maker did not make a version of the driver for your OS, you would be screwed. With Linux or any free OS, if you don’t mind using your brain you can enable parts of your kernel that would handle the new device, recompile and you are on your way.
Finally, with a static kernel like Windows, the memory is CPU it uses is what it uses. If you could recompile the Windows kernel like you can a free one, you could trim out stuff that is useless to you and have a leaner and faster machine as a result.
You are more than welcome to your limited view. The reason why many of us have embraced this is because it is nice to push the boundaries of “what if”
Peace,
Jeff
Thats right , we can surely clear the extra baggage and the computer will work more effectively.Very interesting article though i am not a computer geek and do not understand the technical terminology but can still learn quite a lot of things from this site,
It sure is teh difference between the will to do it and not allowed to do it.
I am happy to read your blog and admit the webmaster has done a very good job by putting all the information content at one place. I’d like to recommend it with reference to my website http://www.pctechoutlet.com
[...] rebuilding to support some of the hardware on a Vaio. You can look here to see how easy it is…JBCobb.net
Hallo an alle,
ich bin gerade auf einer kleinen Reise quer durchs http://www. Nun bin ich also auf dieser tollen Homepage gelandet und muss sagen: Der Besuch hat sich gelohnt! Ich werde deine Seite auf jeden Fall wieder mal besuchen! Wenn du Lust hast, kannst du ja auch mal auf meiner Homepage vorbei schauen. Ich würde mich sehr freuen. Nun wünsche ich eine tolle Zeit!
A few days after the negativity that I received had halted because of me cutting several ties, but then the nuiscance phonecalls started where there was heavy breathing this was at sporadic occasions 3am within the morning, 6am and it got towards the point wherever I had been thinking about changing my number to all three of my Phones.
I suggest this site to my friends so it could be useful & informative for them also. Great effort.
Leave A Reply