.:MK-STUFF.DE:.
Navigation
Zufallsbilder
|
Linux on an IBM ThinkPad R50e
Last updated: Tue, 25 Dec 2007 12:21
This document describes how to install Debian GNU/Linux on an IBM ThinkPad R50e UR0BYGE. This is not a step-by-step guide. Do only follow my instructions if you know, what you are doing. If you want a Linux on your ThinkPad without having to do much work, you should consider buying one with a preinstalled Linux or using Ubuntu, which does some of the configuration automatically.
This report will probably be faulty. If you find any mistakes or if you have any questions, feel free to e-mail me at mk(at)mk-stuff(dot)de. If you lose your data, void your warranty or destroy your notebook, it's not my fault.
Table of contents
Specifications
| Manufacturer: | IBM |
| Model: | 1834-BYG |
| Product number: | UR0BYGE |
| CPU: | Intel Celeron M 1500 MHz |
| FSB: | 400 MHz |
| RAM: | 512 (2x256) MB DDR (Infineon) |
| Host bridge: | Intel 82852/855GM |
| HD: | Hitachi 30 GB ATA-100 |
| Optical drive: | DVD(8x)/CD-RW(24/24/24x) Combo drive |
| Graphics chip: | Intel 82852/82855 GM (64 MB shared memory) |
| Display | 15" XGA LCD TFT (1024x768) |
| Sound chip: | Intel 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller |
| Modem: | Intel 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller |
| CardBus bridge: | Texas Instruments PCI1510 |
| Ethernet controller: | Intel 82801BD PRO/100 VE |
| Wireless LAN: | Intel PRO/Wireless 2200BG |
| Ports: | 1x PCMCIA/Cardbus, 1x microphone, 1x headphones, 1x LAN, 1x modem, 2x USB 2.0, 1x parallel port, 1x AC, 1x VGA |
| BIOS: | Version 2.04 (1WET84WW / 2005-07-11; see below) |
| Battery duration: | 3:30 h (depending on what you are doing; sometimes even longer) |
Things to do before installing Linux
BIOS update
Before you delete your pre-installed Microsoft Windows XP, update your BIOS. It is only possible to update the BIOS under Windows or with a floppy. The second possibility does not work for me, because I don't have a floppy drive for my ThinkPad.
BIOS Update Instructions:
- Download the latest version from IBM.
- Read IBM's instructions.
- Plug in the ACDC.
- Start the downloaded BIOS update program under Windows 2000 or Windows XP.
- Follow the instructions on the screen.
- The system will restart.
- Follow the instructions on the screen.
Configuration of the BIOS
You can enter the BIOS setup utility by pressing F1 right after pressing the power button to start the system. I changed three things that bothered me:
- Config -> Display -> Boot Display Device: ThinkPad LCD
- Config -> Display -> Brightness: High (disables the automatic dimming of the display, when the system runs on battery)
- Config -> Power -> CD-ROM Speed: Silent (makes your CD/DVD drive quieter, but slower)
HDD Acoustic Management
The hard disk will be quieter, live longer and waste less energy when the Acoustic Management is set to "quite".
How to do this:
- Download the tool from Hitachi.
- Burn it on a CD and start from it.
Burn the recovery CDs
My ThinkPad came without Recovery CDs, but I read that one can order them at IBM. So I called the (excellent) IBM support and the guy on the phone told me that I can create them myself. OK, I could have figured that out on myself, but afterwards one is always smarter...
Instructions:
- Don't call the IBM support.
- Run Start -> Programs -> Access IBM -> Create CD/DVDs for recovery.
- Put in 7 blank CDs.
- Ready.
Now you can delete the recovery partition, which gives you back about 4.5(!) GB of your hard-drive.
Installing Debian GNU/Linux
- Download the i386 netinstall CD image for Debian 3.1 (about 111 MB)
- Burn it on a CD and start from it.
- Enter
linux26 as the boot command.
- Install the basic system and the additional stuff you need.
Later on I changed my /etc/apt/sources.list to Debian unstable. I don't really know, how intelligent the step was. On the one hand, Debian unstable is not as technically mature than Debian testing or even Debian stable. I had some problems with unresolved dependencies while trying to install software via apt-get (namely some QT3 stuff) and the systems seems to be a little bit slower than before. On the other hand, you get the latest software, like KDE 3.4, OpenOffice 2.0 or X.org, which is very cool. Decide for yourself, what fits best to your requirements.
Compiling a new Kernel
It is best to start with a customised kernel, so a lot of hardware will work and system will become faster.
How to compile your own Kernel:
- Get the latest Kernel-sources from Kernel.org.
- Unpack them and change in the linux-2.6.... directory.
- Enter
make menuconfig and configure the Kernel. If you don't know what to do, just copy my .config (without PCMCIA) in the directory. My .config is for Kernel 2.6.21.3 with the Suspend2-Patch applied. All the changes I suggest you to do at your Kernel configuration are already applied to this configuration.
- Enter
make ...become root and enter...
make modules_install
cp arch/i386/boot/bzimage /boot/vmlinuz
cp System.map /boot/System.map
- Re-adapt your /boot/grub/menu.lst if necessary.
- Reboot your Linux with the new Kernel.
If you experience any problems or don't know what to do, take a look at the Kernel Rebuild Guide.
What works out of the box
- the X-Server (the driver for the graphics chip is called "i810")
- ALSA (install alsa-base and alsa-utils; I set master volume and pcm volume to 77, to not overload the built-in speaker)
- the 3 buttons to control the volume
- the Fn+Home/End buttons to control the brightness/contrast of the display
- the Fn+PgUp button to control the ThinkLight
- DVD+/-/RAM reading
- Burning CDs/CDRWs
- PCMCIA (not with my .config though, because I deactivated it)
- GPM (the device is called "/dev/input/mice")
Configuring VESA Framebuffer
I added vga=0x318 to the "kernel..."-string in my /boot/grub/menu.lst to get a console with a resolution of 1024x768 @ 24 bpp. Here are other possible configurations for the Framebuffer device:
| BPP | 640x480 | 800x600 | 1024x768 | 1280x1024 | 1600x1200 |
| 8 | 0x301 | 0x303 | 0x305 | 0x307 | 0x31C |
| 15 | 0x310 | 0x313 | 0x316 | 0x319 | 0x31D |
| 16 | 0x311 | 0x314 | 0x317 | 0x31A | 0x31E |
| 24 | 0x312 | 0x315 | 0x318 | 0x31B | 0x31F |
For further information take a look at [YourKernelSourceDirectory]/Documentation/fb/vesafb.txt.
Once you got the Framebuffer working, the console has a higher resolution, you can view pictures...fbi [filename] ...and you can watch videos...mplayer -vo fbdev [filename]
Scrolling with the middle button and the trackpoint
It is possible to scroll with the middle button and the trackpoint. Therefore the middle button gets deactivated, but pressing the left and the right button at the same time emulates the middle button. Change the section "InputDevice" of your /etc/X11/xorg.conf to the following:
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Protocol" "PS/2"
Option "Device" "/dev/input/mouse0"
Option "YAxisMapping" "4 5"
Option "XAxisMapping" "6 7"
Option "Emulate3Buttons"
Option "EmulateWheelButton" "2"
Option "EmulateWheel" "true"
EndSection Now you can scroll in all directions while holding the middle button. If you need the "real" middle button for like inserting text, you press the left and the right button at the same time.
Attention: Some programs, e.g. Mozilla-Firefox, have special functions on mouse button 6 and 7 (vertical scrolling), like going back and forward in the history. But there is a way to disable this annoying feature in Mozilla Firefox:
- Type "about:config" in the URL-bar.
- Type "mousewheel.horizscroll.withnokey.action" in the filter and change the value from 2 to 0 via double-click.
- Type "mousewheel.horizscroll.withnokey.numlines" in the filter and change the value from -1 to 1 via double-click.
- Now the history is disabled and you can actually scroll vertically.
Wireless LAN
In order to use the Intel Pro Wireless 2200 chip with Monitor Mode you have to do the following:
- Enable the following options in your Kernel configuration:
- Networking \ Networking support
- Device Drivers \ Network device support \ Wireless LAN drivers (non-hamradio) & Wireless Extensions
- Cryptographic options \ AES cipher algorithms (i586)
- Cryptographic options \ ARC4 cipher algorith
- Cryptographic options \ Michael MIC keyed digest algorithm
- Cryptographic options \ CRC32c CRC algorithm
Don't enable the Kernel 80211 subsystem or the Kernel ipw2200 driver - they just suck!
- Compile, install and boot the Kernel.
- Download the latest firmware and unpack it into /usr/lib/hotplug/firmware.
- Download the ieee80211 subsystem for Linux from http://ieee80211.sourceforge.net/downloads.php, unpack and install it with `make` and `make install`.
- Download the latest ipw2200 driver from http://ipw2200.sourceforge.net/downloads.php, unpack and install it with `make` and `make install`.
I wrote a little script to manually shut down the W-LAN and, if it is already turned off, turn it on again. The script is called Fn-F5.sh. You can find it here.
Suspend-to-Ram (S3)
Suspend-to-Ram works generally fine. Add the following line to your /etc/X11/xorg.conf into the section "Device":Option "VBERestore" "true" Now the section will look something like this:Section "Device"
Identifier "Standardgrafikkarte"
Driver "i810"
BusID "PCI:0:2:0"
Option "VBERestore" "true"
EndSectionThere are a few things to do just before suspending and right after it, so it is best to use a script for suspend. My script is called Fn-F4.sh. You can find it below. It does the following:
- It switches to console one (prevents problems with after resume).
- It writes all unwritten data to the harddisk or whereever they are supposed to be written on.
- It unloads the Kernel module for the power button to prevent an immediate shutdown after resume.
- It writes current data from the graphic chip into the RAM.
- It starts the Suspend-to-Ram function.
- After resume the script is still running and writes the data back to into the graphic RAM.
- The Kernel module for the power button is loaded again.
- Finally the script switches back to console seven (X-server).
The power consumption while Suspend-to-RAM is about one percent of the main accumulator per 40 minutes, so do not leave your ThinkPad in suspend more than about 2.5 days.
Suspend-to-Disk (S4/Hibernate)
Software Suspend 2 works fine. The HowTo on www.suspend2.net is excellent. Here are the most important steps:
Patching the Kernel
Installing the Hibernate Script
- Download the hibernate script from www.suspend2.net.
- Unzip it.
- Install it...
su
hibernate-script-1.12/install.sh
- Change the FilewriteLocation in /etc/hibernate/hibernate.conf:
FilewriterLocation /suspend_file 512
- Enter the following:
mkdir /hibernate
hibernate --no-suspend The last command creates the image file and returns something like file:/dev/hda2:0xb4800
- Append "resume2=" and what is returned as a Kernel parameter to your /boot/grub/menu.lst. It might look like this:
title Debian GNU/Linux, kernel 2.6.21.3
root (hd0,1)
kernel /boot/vmlinuz-2.6.21.3 root=/dev/hda2 ro vga=0x318 resume2=file:/dev/hda2:0x3800
savedefault
boot
- Reboot your system.
Using it
Once you successfully applied the patch and installed the script you can test hibernate withsu
hibernate The laptop should shut down within a few seconds. To wake it up again just press the power button. Booting should take much less time than usual. As there are some things I would like my ThinkPad to do before and after suspending, I wrote a script called Fn-F12.sh. It does the following:- It writes all unwritten data to the harddisk.
- It shuts down my W-LAN connection (if I do not do this the configuration in iwconfig is somehow gone).
- It saves the memory of the graphic chip into a file (this prevents graphic problems).
- It starts the hibernation cycle.
- After resuming the memory of the graphic chip is written back.
- The W-LAN is woken up again.
VGA-Out
Clone Mode
The clone mode with the i810 driver is very tricky, because there are many bugs in this driver. A number of programs are available, which pretty much act as a kind of error workaround, because basically everything should be controllable with the ibm-acpi Kernel module. Before further reading you should check what happens when you turn on your VGA out. Become root and try:echo crt_enable > /proc/acpi/ibm/video If your monitor output is OK, please let me know which Kernel you are using. For all the others who do not have a satisfying output, here are two solutions...
Switching on-the-fly
If you do not have to use your VGA-Out regularly, the switching on-the-fly solution may be OK for you. The major disadvantages are:- no mouse pointer on the monitor, only on the built-in display of the ThinkPad
- many games look weird on the external monitor
- most videoplayers will only show the video on the internal display (depending on your output plugin)
If you still want to use this solution, here is how it works:- Download i855crt and unpack the .tar.gz-file in /sbin/. The complete directory is now called /sbin/i855crt-0.4/
- Become root and run `Make`.
- Use my Fn-F7.sh to switch between LCD only and LCD + VGA-Out. This script is pretty much just an error workaround. You should take a look at it before using it and adapt it if necessary.
Ugly bug: Once you turned on the VGA-Out, the BIOS option Config -> Display -> Boot Display Device is changed. This really sucks! To prevent further problems, turn it back to "ThinkPad LCD".
Permanent Clone Screen
The permanent cloning of the screen works much better than the on-the-fly solution. You have a mouse pointer, games work and you can watch videos. Just use this file as your /etc/X11/xorg.conf.
ACPI
Install "acpid" and "acpi" and try it out. The output looks something like this:
mk@ThinkPad:~$ acpi -V
Battery 1: charged, 100%
Thermal 1: ok, 49.0 degrees C
AC Adapter 1: on-line
You can get a whole lot more of great information out of /proc/acpi/. You even can change hardware settings in /proc/acpi/.
| File (/proc/acpi/...) | Information (cat xxx) | Possible actions (as root) |
| ac_adapter/AC/state | power connection status | none |
| alarm | ? | tell your notebook when to wake up automatically: `echo yyyy-mm-dd hh:mm:ss > alarm` |
| battery/BAT0/alarm | low battery alarm in mWh | you can change the treshold, e.g. via `echo 2000 > alarm` |
| battery/BAT0/info | various information about the battery, including the state of charge | none |
| battery/BAT0/state | state of charge in a much shorter form | none |
| dsdt | DSDT table | ? |
| embedded_controller/EC/info | some information about the embedded controller | ? |
| event | read out the ACPI events | ? |
| fadt | ? | ? |
| ibm/bay | tells you that "bay" (MultiBay?) is not supported | none |
| ibm/beep | none | let your notebook beep with `echo [0-17] > beep` |
| ibm/bluetooth | tells you that BlueTooth is not supported | none |
| ibm/brightness | current brightness setting | `echo level [0-7] > brightness` |
| ibm/cmos | ? | ? (afraid to try) |
| ibm/driver | the "IBM ThinkPad ACPI Extras" driver version | none |
| ibm/hotkey | state of the hotkeys | activate and deactivate hotkeys via `echo enable > hotkey` or `echo disable > hotkey` |
| ibm/led | none | manipulate various leds on your notebook |
| ibm/light | state of the IBM ThinkLight | turn it on or off via `echo on > light` or `echo off > light` |
| ibm/thermal | reads out various temperatures | none |
| ibm/video | state of the video output | possible commands: lcd_enable, lcd_disable, crt_enable, crt_disable, dvi_enable, dvi_disable, auto_enable, auto_disable, video_switch, expand_toggle |
| ibm/volume | current audio volume setting | setting the volume |
| info | ACPI version | none |
| power_resource/PUBS/state | ? | ? |
| processor/CPU/info | some information about the processor | none |
| processor/CPU/limit | ? | ? |
| processor/CPU/power | ? | ? |
| processor/CPU/throttling | CPU frequency information | If you have configured CPU-Frequencing, you can use `echo [0-7] > throttling` to influence the speed of your CPU (0=fastest, 7=slowest). |
| thermal_zone/THM0/cooling_mode | tells, if the cooling mode is active or passive, whatever is meant with that (it's not the fan) | none |
| thermal_zone/THM0/polling_frequency | ? | ? |
| thermal_zone/THM0/state | ? | ? |
| thermal_zone/THM0/temperature | CPU temperature | none |
| thermal_zone/THM0/trip_points | ? | ? |
| video/VID/* | ? | ? |
| wakeup | ? | ? |
Laptop-Mode
Laptop-Mode increases your battery life by turning off the harddisk. Minor data writings are saved in the RAM until a certain time or a certain mass of data is passed. The data is then written and the harddisk can turn off again. Laptop-Mode distinguishes between working on battery and power supply.
If you want to know more, take a look at http://www.linuxjournal.com/article/7539.
Controlling the Fan
The fan of the R50e works fine. Usually it is turned off. If it is on, it is pretty quiet. Nevertheless, some might be interested in controlling it manually. But remember: If you turn off the fan or set it too slow, you could seriously damage the hardware.
If you are interested, take a look at Julius' ThinkPad report.
Hotkeys (Fn-Fx keys)
Making the buttons work
To use the hotkeys you have to load the module ibm-acpi unless you already compiled it into your Kernel like I did. Then you need to activate the special Fn-Fx keys withecho enable > /proc/acpi/ibm/hotkey
echo 0xffff > /proc/acpi/ibm/hotkey Now you can check if the keys work with `acpi_listen'. You should see the ACPI keycodes for the Fn-Fx keys when you press them.
Making it permanent
Unfortunatly after rebooting the keys are deactivated again, so I have to run a script on boot time which sends out the echo ...-command to activate the buttons. My script is called hotkeys.sh. Copy it in your /etc/init.d/ directory and make a symbolic link named S22hotkey in /etc/rc2.d/.
Defining actions
The actions connected to the various buttons are stored in textfiles in /etc/acpi/events. Every button has its own file, so it is a good idea to name the files like the buttons are named. Within the files there is the keycode given from acpi_listen and the corresponding action (preferably with sudo). The action is a script file, so pressing a button in the end starts a script. If you want to use sudo you have to add "/usr/bin/Fn*.sh" in visudo. Here you can see my /etc/acpi/events/Fn-F4 as an example:event=ibm/hotkey HKEY 00000080 00001004
action=sudo /usr/bin/Fn-F4.sh You can find all necessary files in the files section. Important: If you change something in /etc/acpi/events/ you have to restart your notebook for the changes to come into effect.
Buttons and what they do:
| Button | Action | Command in /etc/acpi/events/Fn-XX |
| Fn-F3 | Turning off/on the LCD | `/usr/bin/Fn-F3.sh` |
| Fn-F4 | Suspend-to-RAM | `sudo /usr/bin/Fn-F4.sh` see here |
| Fn-F5 | Turning off/on W-LAN | `sudo /usr/bin/Fn-F5.sh` |
| Fn-F7 | Switching between LCD only and LCD+CRT | `sudo /usr/bin/Fn-F7.sh` see here |
| Fn-F12 | Suspend-to-Disk | `sudo /usr/bin/Fn-F12.sh` see here |
CPU-Frequencing
The Intel Celeron M 1500 supports the following eight frequencies:
| 187.5 MHz | 375 MHz | 562.5 MHz | 750 MHz | | 937.5 MHz | 1125 MHz | 1312.5 MHz | 1500 MHz |
Enable the following modules in your Kernel configuration in "Powermanagement Options" -> "CPU Frequency Scaling":
- CPU Frequency Scaling
- Performance governor
- Intel Pentium 4 clock modulation
Now you can manually change the CPU frequency in /sys/devices/system/cpu/cpu0/cpufreq:
echo 750000 > scaling_min_freq
echo 750000 > scaling_max_freq This sets the CPU frequency to 750 MHz (750000 kHz). Try the other available frequencies (see above) and check it with cat /proc/cpuinfo
It kind of sucks to change the frequency manually, so I installed "cpufreqd". The basic configuration does not fit to the possibilities you have with your processor, so it is important to change the /etc/cpufreqd.conf
Now the CPU frequency is set to the optimal frequency, if you are running on battery.
Important:
Various people expressed doubts about the effectiveness of CPU-Frequencing with the Celeron M, because, in contrast to the Pentium M, it cannot vary its voltage. As nobody could give me clear information about this issue, I decided to check it myself. So I put an amperemeter between the power outlet and the AC/DC and did some measurements (see here):
| State | mA | W | Conclusion |
| 1500 MHz, full brightness, no load, fan is off | 106 | 23.32 | It makes no difference, whether the CPU works at high or low frequency, when there is no load. |
| 187.5 MHz, full brightness, no load, fan is off | 106 | 23.32 |
| 1500 MHz, full brightness, full load, fan is on | 155 | 34.10 | At full load you save about 21% of energy, but the processes my take up to 8 times as long as before, so actually you save nothing, you even waste energy and time. |
| 187.5 MHz, full brightness, full load, fan is on | 123 | 27.06 |
| 1500 MHz, full brightness, no load, fan is off | 106 | 23.32 | The brightness of the display makes a difference of about 18% of the power consumption. |
| 1500 MHz, lowest brightness, no load, fan is off | 87 | 19.14 |
Of course I know that these measurements are highly imprecise, because the power supply unit has its wastages and it is not fully predictable, what the system does in the background, but I think my measurements are precise enough to point out, that there are no or nearly no savings while decreasing the CPU frequency. Reason enough for me to deactivate all CPU-Frequencing options in the Kernel configuration and to remove cpufreqd. This saves bootup time, memory and CPU time.
Update: I learned that I could have read out the current power consumption from /proc/acpi/battery/BAT0/state when the notebook is on battery. This is much more precise and saves you the trouble with the amperemeter.
3D Graphics
My R50e only has a low budget graphics chip. On the internet I often read that it was way too slow play any games at all. Well, it may be slow compared to state-of-the-art chips, but it is fast enough to play a little every now and then. glxgears makes more than 500 frames per second. To activate 3D support you have to load the i915 module. In my case it is loaded automatically. If you do not have this module, try my Kernel configuration. Additionally you will need to install libgl1-mesa-dri. Reboot your system and check the result with glxinfo. It should say "direct rendering: Yes" (see my output).
A Word on Security
Someday your laptop might get lost, so you should make it possible for honest finders to contact you. I did two things:
Enhancing your battery life
There are various ways to improve your battery life with Linux. One important step we already took is using laptop-mode, but there are several other very important tricks you should know about:
- Decreasing the CPU wakeups per seconds: Your CPU tries to go to sleep as often as possible, but as soon as there are programs trying to do something, the CPU is forced to wake up. While your CPU is sleeping, it consumates less power than normal, so we'll try to let it sleep as long as possible. To achive that, you use the tool powertop from Intel. It shows you, which programs and Kernel modules wake your CPU. It also gives you hints on optimizing your Kernel configuration. Most changes are already applied to my .config, like:
- Deactivating the PCMCIA Modules (I don't need them)
- Activate AC97 Power-Saving Mode
- Activate HPET.
- Mount your drives with the "noatime" option. This prevents Linux from writing timestamps each file access. Just append this option to the options in your /etc/fstab.
- Disable DRI: I usually don't run 3D applications on my notebook, so I appended Option "NoDRI" to the "Device" section of my /etc/X11/xorg.conf
Final steps
At this point you have a running Linux system and the most important things are configured. Here are some recommendable things to do at this point:
Some output
My configuration files
/
|-- boot
| `-- grub
| `-- menu.lst
|-- etc
| |-- acpi
| | `-- events
| | |-- Fn-F3
| | |-- Fn-F4
| | |-- Fn-F5
| | |-- Fn-F7
| | `-- Fn-F12
| |-- apt
| | `-- sources.list
| |-- cpufreqd.conf (not in use, see above!)
| |-- hibernate
| | `-- hibernate.conf
| |-- init.d
| | `-- hotkeys.sh
| |-- laptop-mode
| | `-- laptop-mode.conf
| |-- network
| | `-- interfaces
| |-- rc2.d
| | `-- S22hotkeys -> ../init.d/hotkeys.sh
| |-- sudoers
| `-- X11
| `-- xorg.conf (DRI deactivated!, see above)
`-- usr
|-- bin
| |-- Fn-F3.sh
| |-- Fn-F4.sh
| |-- Fn-F5.sh
| |-- Fn-F7.sh
| `-- Fn-F12.sh
`-- src
`-- linux-2.6.21.3
`-- .config (with applied Suspend2-Patch, without PCMCIA)
To do
- Modem
- a few words about Antialiasing and Sub-Pixel-Hinting
Related documents and links
This article is listed at...
Thanks to...
- Boobaa for his hints about the scrolling in Mozilla Firefox
- Julius Plenz for his great HowTo
- Lutz Willek for a lot of ThinkPad specific help
- Nikolaj Sorensen for his `echo [0-7] > /proc/acpi/processor/CPU/throttling`-hint
- Werner Heuser for his help
|