# HOWTO: Linux on the IBM ThinkPad R51 (and compatible models)

## nomad-

Three days ago I received my shiny new IBM R51 laptop. It's a great machine and there's nothing I don't like about it (except the HDD being just 40GB). I spent about 15 minutes playing with the IBM tools in Windows and got on to the fun part - install Gentoo Linux and make it just as compatible with the laptop as is Windows (and even more :p ).

Windows

I backed up the predesktop area (a FAT32 partition with some kind of stripped down Windows 2000) using the Recovery CD tool in Access IBM. I have a DVD writer, so I inserted 1 CD-R for the bootable CD and a DVD-R after that for everything else. If you only have a CD burner, you'll get about 7 recovery CDs and you better make sure you don't lose any one of them.  :Smile:  I deleted some directories from the main partition (I386, VALUEADD, IBMWORK, DRIVERS) to free up disk space and used Partition Magic to delete the predesktop area, size down the Windows partition and move it to the end of the drive. That way, if I ever decide I don't need Windows anymore, I can just delete the partition and use the grow feature most Linux filesystems have to make use of the free space. It would take less than a minute.

Installation

I downloaded a 2004.2 LiveCD (only a couple of days old by the time I installed it) and did a Stage 1 install. Strangely enough, hotplug on the LiveCD tried to load the ipw2100 driver for the 802.11b card, but of course it's not on the CD. 

I made a 1GB swap partition (512MB RAM * 2) and a single XFS partition for everything else. The installation was pretty straightforward, following the Gentoo Handbook. Here's my make.conf:

```
CFLAGS="-march=pentium3 -O3 -mcpu=i686 -pipe -msse2 -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CXXFLAGS="${CFLAGS}"

USE="-kde -qt gtk gtk2 gnome cups php httpd -java alsa dvd apache2 -arts cdr dvdr pam mmx sse alsa"

```

Note: While compiling KDE, you would want to remove the -msse2 option from the CFLAGS. Thanks to PMT for the tip.

Kernel

I started with 2.6.7-mm6, with the mm-sources being my personal preference. However, swsusp2 patches don't work well against mm-sources, so I switched to gentoo-dev-sources-2.6.7-r11. Here's my kernel config.

Note: I have combined all the kernel patches (including the one below and swsusp2) into a single (724k) patch. It will probably not work well against anything but a clean gentoo-dev-sources-2.6.7-r11. Use that to apply it:

```
cd /usr/src/linux-2.6.7-gentoo-r11

wget -qO - http://onda.zvuk.net/r51/gentoo-2.6.7-r11-thinkpad.diff.gz | gunzip - | patch -p1
```

...and build the kernel as usual.

The R51 does not power off on shutdown with ACPI, so I applied this patch to disable Local APIC before shutdown.

Video

The notebook comes with an ATI Mobile Radeon 9000. Although not a FireGL card, it works fine with the FireGL drivers. The installation is simple.

```
emerge ati-drivers

/opt/ati/bin/fglrxconfig

opengl-update ati

```

For the most part you are OK with the default values in fglrxconfig. The only thing you need to change is the resolution (defaults to 640x480). Make sure you save the config file as /etc/X11/xorg.conf and not /etc/X11/XF86Config-4. Once you are done, you'll have a working Xorg with 3D acceleration installation.

I got a few video-related freezes in X and switched back the the xorg-x11 driver. No crashes have happened since then.

```
opengl-update xorg-x11
```

The fglrx will crash after resuming from a suspend/sleep, so I switched to the radeon driver in the kernel DRI instead. Here's my xorg.conf. It's got both modules configured. Just comment/uncomment lines 510 and 511 to switch between the two.

Mouse/UltraNav

I used /dev/input/mice as a mouse device with a PS/2 wheel mouse driver both for X and GPM. It worked right away with the TouchPad and a USB mouse being simultaneously used. Tapping works too. I guess the TrackPoint would work too, but I disabled it from the BIOS and haven't tested it. 

Keyboard

The keyboard works (no big surprise). The Fn+F5 (Bluetooth), Fn+Home/End (Brightness), Fn+PgUp (ThinkLight) work, because they are directly wired to the hardware. Fn+F3 (Screen off) and Fn+F4 (Suspend) work with APM. Fn+F4 fires a sleep event with ACPI running. Fn+F12 (Hibernate) does not appear to work at all. Alt+Space (Zoom) doesn't work, but that's stupid anyway. The Back and Forward buttons above the cursor keys don't work by default, but in X you can map them to F19 and F20 by putting those 2 lines in your WM's startup file:

```
xmodmap -e 'keycode 233 = F20'

xmodmap -e 'keycode 234 = F19'

```

You could probably make those work in the console too, but I have not tried. The Fn key also fires a keypress event, if you are interested.

The Access IBM and the volume buttons do not fire off keypress events, but are detected by the app-laptop/tpb package.

Note: tpb requires app-laptop/thinkpad. thinkpad <5.0 doesn't work with the 2.6 kernel, and 5.0 is still not in Portage. Emerge that ebuild before emerging tpb.

APM/ACPI

I read some good things about APM, but I could not get it to work completely and I like ACPI because it provides more control over the various processes. ACPI sleep (echo 3 > /proc/acpi/sleep) works, but you need to unload some drivers. See default.sh for an example. Emerge acpid and optionally acpi and add acpid to the default services.

```
rc-update add acpid default
```

Software Suspend

Warning: If you applied my complete kernel patch, you already have swsusp2 installed properly. You still need the hibernate script and GRUB settings, though.

The software suspend module, bundled with the kernel, does not work correctly, so I went with swsusp2. Version 2.0.0.102 don't work with SMP turned off (should be fixed in .103), so I downgraded to 2.0.0.100. Get the patches and apply the 20*, 21*, 30* and 31* files sequentually. 

I also installed the hibernate script that comes with swsusp2. It's quite useful. Here's my /etc/hibernate/hibernate.conf (with comments).

In order to make swsusp2 actually resume after a suspend, you need to add this to your kernel startup line in GRUB (hdaX is your swap partition):

```
resume2=swap:/dev/hdaX
```

Update: When using the hibernate script, swsusp2 will more often than not freeze, waiting for pdflush, a kernel pseudo-process, to freeze (just press Esc to cancel the suspend). It appears that there is no such problem when using "echo 4 > /proc/acpi/sleep" instead, so I modified my ACPI event script to handle the suspend by itself.

Sound

Works with the ALSA intel8x0 driver. The volume keys are hard-wired and you cannot use them to control your software mixer volume, which is a pity. tpb shows the hardware mixer volume on screen when the OSD option is enabled.

Framebuffer Console

The framebuffer console works. I have not tested the radeonfb module, but the VESA one works. Make sure you enable MTRR. Also, since 1400x1050 is a pretty high resolution for a console, I recommend you use some big console font, such as the SUN one that comes with the framebuffer in the kernel. Use those kernel options if you have a 1400x1050 display:

```
video=mtrr,vesafb:1400x1050 vga=834

```

Bootsplash works (the gentoo-dev-sources include the patch already). Follow the howto and fire up The GIMP to do some magic on the 1600x1200 images and resize them to 1400x1050.  :Smile: 

Wireless

Note: this section refers to models with the Intel PRO/Wireless 2100 wireless card. Check the replies below for information on the other cards, installed in som R51s.

The ipw2100 driver works quite well. The WiFi card will power up (and the WiFi LED will light up) when you load the module in the kernel, and it will power down when you unload it. The 0.44 release failed to power up the card after about 10 reloads, so I went with 0.49. 

```
emerge wireless-tools

ACCEPT_KEYWORDS="~x86" emerge =net-wireless/ipw2100-0.49

```

I found the wireless-config package extremely useful for configuring WiFi the Gentoo way. It's not in portage, so you need to setup your Portage overlay directory (if you haven't done that already).

```
mkdir /usr/local/portage

echo PORTDIR_OVERLAY="/usr/local/portage" >> /etc/make.conf

```

Now download the ebuild and install it.

```
mkdir -p /usr/local/portage/net-wireless/wireless-config

cd /usr/local/portage/net-wireless/wireless-config

wget http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.5.5.ebuild

ebuild wireless-config-0.5.5.ebuild digest

ACCEPT_KEYWORDS="~x86" emerge wireless-config

etc-update

ebuild /var/db/pkg/net-wireless/wireless-config-0.5.5/wireless-config-0.5.5.ebuild config

```

Apply my patch to load the kernel module when needed and unload it after that

```
cd /etc

wget -qO - http://onda.zvuk.net/r51/wireless-config-module-support.diff | patch -p1 

```

Now edit your /etc/conf.d/wireless. Keep in mind that the wireless card will appear as eth1, not eth0 or wlan0. Do:

```
ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth1

/etc/init.d/net.eth1 start

```

Your wireless should work now!

Automatic interface switching

The Windows installation that comes with the notebook has a program that automatically switches between the Ethernet and wireless interfaces. When I plug my Ethernet cable, the wireless card is powered down and Ethernet is used. When I unplug, the wireless is reenabled. I found a program, called ifplugd, which I used to replicate that functionality in Gentoo.

```
emerge ifplugd
```

Edit /etc/conf.d/ifplugd and set the following values:

```
INTERFACES="eth0"

AUTO="yes"
```

Don't set anything for eth1 (wireless). Patch /etc/init.d/net.eth0 to work with interfaces, monitored by ifplugd.

```
cd /etc/init.d

wget -qO - http://onda.zvuk.net/r51/make-net.eth0-check-for-ip.diff | patch -p1

```

Get my ifplugd.action and put it in /usr/sbin. Now, test ifplugd.

```
/etc/init.d/net.eth0 stop

/etc/init.d/net.eth1 stop

/etc/init.d/ifplugd start
```

Unplug the ethernet cable and if you got everything correct, the wireless LED should light up in a couble of seconds. If it fails to associate with an access point, it will turn back off, saving power.

Also, you don't want hotplug loading the ipw2100 module on boot by default, so you can add it to the blacklist.

```
echo ipw2100 >> /etc/hotplug/blacklist
```

Once you are done, make ifplugd start by default.

```
rc-update del net.eth0

rc-update del net.eth1

rc-update add ifplugd default
```

Note: ifplugd will always issue an interface down event when stopped. If that's not what you want (for example, while suspending), use /etc/init.d/ifplugd suspend and /etc/init.d/ifplugd resume

CD/DVD

CD writing works with the IDE driver (I haven't tested the SCSI emulation one). XCDRoast works fine. For some reason the driver (MATSHITA, a Panasonic brand) does not recognize low-end 4X DVD+Rs. However, DVD-Rs by the same company work fine. I haven't tested more expensive brands though. Burning a DVD takes about 25 minutes. DVDs play well both with xine and mplayer. I don't know what is the region setting of the DVD.

Update: DVD burning works too, with the dvdr USE flag. It's a wise thing not to set the speed to 16x (the maximum CD burning speed), but to 2x (the maximum DVD burning speed), because otherwise some burners will try to reach 16 all the time and trash your DVD media.

Parallel Port

Not tested. I've got a network printer at home.

USB

Works with a Microsoft Optical Wheel Mouse out of the box. Haven't tested anything else.

VGA port

Not tested.

Bluetooth

I don't have any Bluetooth devices to test with the laptop. Pressing Fn+F5 loads the kernel Bluetooth driver.

PCMCIA

No experience whatsoever. I don't have any PCMCIA devices.

TCPA Security Chip

I have no intention to ever use it.

Active Disk Protection

It needs a software driver and I don't think it's going to work in Linux anytime soon. Also, it only seems to react when the laptop is tilted, but not shocked. So it would help save the disk if you drop the notebook, but not if, say, it stays in the car and you pass through a bump at high speed.

Ethernet

Works both with the kernel driver and the e1000 ebuild. I haven't tested it at 1Gbps.

IrDA

Couldn't get it to work with a Siemens SL45 cell phone. Actually, I cannot find the infrared port on the laptop. Some help with that would be appreciated.  :Smile: 

IEEE 1394

Again, I have no FireWire devices, so I cannot test it. The driver seems to work in the syslog, though.

Modem

Couldn't get slmodem to compile. Will investigate further.

TV-out

Update: TV out seems to work halfway with the fglrx driver. However, it is not enabled, because the driver complains 1400x1050 is not a valid resolution for a TV. Any suggestions about that are welcome.

Battery Saving

I spent a fair amount of time optimizing battery usage and I think I've reached the battery's maximum. I used cpufreqd for CPU throttling and it works like a charm. Once you emerge it, you need to edit /etc/cpufreqd.conf, set the power management mode to ACPI and change all the frequency percentages to absolute values. For example, for a 1.8Ghz CPU, 33% = 600000. My cpufreqd.conf, tailored for a 1.5Ghz CPU. The CPU frequency won't go below 600Mhz.

The hard drive is the other big consumer of power that you can optimize. One thing to do is mount partitions with the noatime option. By default, when every file is opened for reading, it's last access time is updated, resulting in a disk write for almost every disk read. noatime disables that, but it might make a few programs (mutt and some inbox monitors) not work correctly. 

I also played with the kernel laptopmode and converted the sample script in /usr/src/linux/Documentation/laptopmode.txt to a Gentoo rc script. It forces the kernel to cache disk writes until there is a disk read, thus reducing the spinups of the hard drive. It also sets the default spindown time for the drive to 5 seconds. The drive will spinup every 10 minutes to flush its buffers and the journal (for journaled file systems). In the case of a battery failure/system crash you risk losing up to 10 minutes of work. Those options are editable in /etc/cond.d/laptop-mode.

```
wget http://onda.zvuk.net/r51/laptop-mode.conf -O /etc/conf.d/laptop-mode

wget http://onda.zvuk.net/r51/laptop-mode.rc -O /etc/init.d/laptop-mode

/sbin/depscan.sh

```

We don't want the laptop-mode always active to increase the lifetime and responsiveness of the hard drive. So we will configure acpid to start and stop laptop-mode when the AC adapter is (un)plugged. Take a look at my /etc/acpi/default.sh for an example.

Once laptop mode is enabled, you would want to reduce further disk operations. A good thing to do is to make your syslogger not write the logs to the disk. Most people don't use those logs anyway, so why waste battery on them? Here's my /etc/syslog-ng/syslog-ng.conf:

```
options {

        long_hostnames(off);

        sync(0);

 

        # The default action of syslog-ng 1.6.0 is to log a STATS line

        # to the file every 10 minutes.  That's pretty ugly after a while.

        # Change it to every 12 hours so you get a nice daily update of

        # how many messages syslog-ng missed (0).

        stats(43200);

};

source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); };

destination console_all { file("/dev/tty12"); };

log { source(src); destination(console_all); };

```

It outputs the logs on the last virtual terminal (Ctrl+Alt+F12).

Optimizing bootup time

When I had completed my installation, my boot time from GRUB to a useful GNOME (with GDM autologin) was about 74 seconds. I could only get it down to 53-4 by writing a xdm rc-script, which starts GDM right away, instead of waiting for all other services to start. I added the script to the boot runlevel. Gnome's startup includes lots of waiting with no disk activity (I don't know what it's doing), so the other services start in the background without affecting overall performance. 

```
wget http://onda.zvuk.net/r51/xdm-quick -P /etc/init.d/

chmod +x /etc/init.d/xdm-quick

/sbin/depscan.sh

rc-update del xdm

rc-update add xdm-quick
```

If you are using GDM, edit /etc/X11/gdm/gdm.conf and set this option:

```
FirstVT=9
```

You can also make services start in parallel, which will save waiting for some slow services, such as hotplug, on startup, by setting this option in /etc/conf.d/rc/:

```
RC_PARALLEL_STARTUP="yes"
```

In contrast, my Windows boot startup time (with pretty much the standard IBM install) is 150+ seconds till disk activity stops and the system becomes useful.

Useful links

A great guide for installing Linux on ThinkPad T40, although biased towards the 2.4 kernel.

Another not that great, but still useful page for the R50.

ToDo

- Test the TV-out, modem and IrDA.Last edited by nomad- on Fri Aug 06, 2004 11:23 am; edited 3 times in total

----------

## scott_b

wonderful.  you just answered a ton of my questions.

thanks a lot.

----------

## schmobag

Thanks for your post, nomad.

I got my Thinkpad R51 a few weeks ago, but my Gentoo setup was quite different.  First of all, I was not as ambitious.  I have not even tried to get hibernation (Fn-F12) working yet.  Second, I had much better luck with apm than with acpi when trying to get standby (Fn-F3) and sleep (Fn-F4) working.  I haven't checked your kernel config, but I had to disable CONFIG_X86_UP_APIC in order to prevent my computer from locking up when it went into standby mode (this took me quite a while to figure out).  Doing this also fixed the problem of the computer not powering off after shutdown.  Have you seen any problems with freezes on standby?  Do you think I should try recompiling my kernel with your "disable APIC before shutdown" patch?  

The alsa intel8x0 driver is working great for me, but I have it compiled into the kernel, rather than as a module.

My R51 has ipw2200 wireless, rather than ipw2100.  I didn't want to wait for the ipw2200 driver to catch up to the 2100, so this last Saturday I picked up a D-link wireless card (DWL-G650) with an atheros chipset.  This is supported by the madwifi driver (net-wireless/madwifi, masked).  The driver seems to work fine, it gets loaded when I pop the card in.  When I do /etc/init.d/net.ath0, I can even find my access point.  But when I try to ping it, I get "Destination host unreachable" (pinging the access point works in Windows, however).  I guess I just need a little primer on getting wireless properly configured.  I've never set it up in Linux before.  In fact, I've never set up a Linux machine with more than one network interface.  I've posted my /etc/conf.d/net and my /etc/conf.d/wireless here and here.  Any help would be greatly appreciated.

----------

## nomad-

Hey schmoobag!

You better use the disable-lapic-before-shutdown patch, because Local APIC is reported to be needed by some modules, such as ehci-hcd (USB 2 support). Regarding wireless, I assume you have properly emerged the wireless-config package.. Here's my config file. You can use it as a reference, just change eth1 to ath0. 

I took a look at your wireless file. Are you sure you are using ad-hoc mode? Also, try setting the ESSID to the one you are using instead of using "any". Also, I noticed that wireless-config has some bugs regarding ad-hoc mode, but I don't know if they are fatal or not, because I cannot test it.Last edited by nomad- on Mon Aug 02, 2004 4:34 pm; edited 1 time in total

----------

## UberLord

wireless-config isn't in portage - you need todo a manual install

Click link in my siggy for instructions  :Smile: 

----------

## nomad-

UberLord, I've taken the freedom to copy your installation guide to my howto  :Smile: 

----------

## schmobag

I feel a little silly for not finding this out sooner, but right after putting up my last post I learned that I could use ndiswrapper and a Windows XP driver to get my onboard Intel 2200bg wireless working under linux.  So I tried that, and it works.  I'm still not sure why the D-link card didn't.  I've configured the onboard Intel card the same way I was trying to configure the D-link.  My best guess is that it's one of those mysterious incompatibilities between certain cards and access points (though that doesn't explain why it worked under Windows).  Anyway, I don't care, because I'll be returning the d-link to CompUSA tomorrow and getting my fifty bucks back.

There is one little hangup with using ndiswrapper for the 2200.  You have to disable CONFIG_4KSTACKS under "Kernel Hacking" and rebuild your kernel.  Otherwise you'll get lockups (see the ndiswrapper compatibility chart).  

nomad:

If I use your "Disable APIC before shutdown" patch and reenable CONFIG_X86_UP_APIC, will I still get lockups when I try to use standby mode?  I haven't had any problems with USB.

----------

## nomad-

I don't know about the lockups with APM, since I have not really used it. No lockups in ACPI though.

----------

## scott_b

When I fn-f4  to go into standby it starts back up immediatly.  This is probably because I didn't apply the patches you wrote about in the "Software Suspend" section.  I didn't do that because I don't know how.  How do I apply patches 20*, 21*, 30*, etc.?

----------

## nomad-

For standby to work you need to at least have the following lines in your /etc/acpi/default.sh (assuming you are using ACPI):

```
   sleep)  rmmod ehci-hcd

                                echo 3 > /proc/acpi/sleep

                                modprobe ehci-hcd

                                ;;

```

The ehci-hcd module will always fail to suspend, so you need to unload it (rmmod ehci-hcd) and load it in after that (modprobe ehci-hcd). Make sure EHCI is compiled as a module in the kernel. It's in Device Drivers > USB. If you still can't get it to work, check your system logs (Ctrl+Alt+F12) right after trying a suspend and look for something like

```
PCI Device 0000:01:23.4 failed to stop.
```

Run lspci and look for the device with that ID. You can post your findings and I'll try to help you.

You don't need Software Suspend for sleep to work, only for hibernating. However, to apply the patches, download them in a directory, extract the archive, and do this:

```

cd /usr/src/linux

for i in /location/of/patches/2*; do patch -p1 < $i; done

for i in /location/of/patches/3*; do patch -p1 < $i; done

```

Or just apply my big patch - it includes Software Suspend.

----------

## PMT

I've got an R51 here, but I've had a few different experiences.

Graphics:

I've got a Mobility 7500 [don't ask; I didn't choose the da*n thing.], so the nice thing about it is, I'm fairly certain after a week of searching that it's the least-supported ATI card on the market. I have yet to get direct rendering working [despite the past month of on and off effort], so...yeah. Fortunately, I've still got the module loaded, despite the rendering and lack thereof, so I'm using KDE with no problems.

CFLAGS:

I'd suggest you disable -msse2; that's a filed bug in KDE's Bugzilla; go try to recompile KDE with that flag, it'll crap out on kdeartwork, usually.

Miscellaneous:

I haven't tried most of your more ambitious tricks yet [including battery optimization], but I've got a few hours tomorrow, so I'll see how that goes.

I've had a nasty problem with the sound driver occasionally faulting out and muting for no apparent reason; but since nobody's posted about this, YMMV.

I'm using the SCSI emulation driver, and I must say, xcdroast works flawlessly [though craptastically slow, since I have the low-end CD burner].

The wireless in this particular one is the infamous 2200BG, and after some teething, I've found it works very nicely with ndiswrapper .7 and .9-pre2 [CVS and .8 always gave me nasty problems and randomly hung the IRQ the wireless was assigned to, which has the nasty side effect of killing the keyboard].

Anyone else?

----------

## sburnett

I've got a similar model to PMT, with the Mobility 7500 graphics chip. I've gotten 3d acceleration to work nicely using xorg and the DRI cvs. Simply compile xorg as usual, disable DRI in the kernel, enable *Intel* agp in the kernel (this is important), then download and install the DRI CVS (there are instructions somewhere around here for how to do this).

The R51 seems to have pretty crappy battery life, though. I only get around 3 hours with CPU underclocked to 600 MHz. Never tried it in Windows, though, so I can't say how it would compare. Anyone have any insight on this topic?

(Before you ask, yes I am using the laptop-mode script, as well as ACPI and cpufreqd)

----------

## schmobag

I'm also using ndiswrapper (0.8) and a Windows XP driver for the wireless, and I have seen the same problem with the keyboard being disabled, though it has only happened once or twice in the ten or so times that I've modprobed ndiswrapper.  

If I modprobe ndiswrapper right after booting, it seems to load up no problem, but if I do it after I have been running for a couple of hours, it fails, and dmesg shows a message about the XP driver requesting too much memory.

I'll try .9-pre2 and see if the keyboard problem and/or the other problem go away.

----------

## PMT

Interestingly, sburnett, I discovered that solution last night, while banging away at xfree after it whined one too many times about module versions. I compiled xorg and the dri CVS snapshots again, and it's working like a charm...mmm, 1000 FPS glxgears.

----------

## scott_b

 *nomad- wrote:*   

> For standby to work you need to at least have the following lines in your /etc/acpi/default.sh (assuming you are using ACPI):
> 
> ```
>    sleep)  rmmod ehci-hcd
> 
> ...

 

I'm still unable to standby.  my /etc/acpi/default.sh looks just like you said it should.  EHCI is compiled as a module in my kernel.

I looked in the log as you suggested and discovered that the device holding me up is 0000:00:1d.7.  lspci tells me that this is "USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH$-M) USB 2.0 EHCI Controller (rev 03)"

what do you suggest as my next step?

----------

## nomad-

The line

```
rmmod ehci-hcd
```

in /etc/acpi/default.sh is supposed to stop the EHCI device, but apparently it fails. Two things you can do are

a) run 

```
rmmod -v ehci-hcd
```

from the command line and see if the module unloads. If it unloads, you've probably messed up your default.sh. If it doesn't rmmod should at least tell you why. You can also try putting

```
rmmod [b]-f[/b] ehci-hcd
```

in /etc/acpi/default.sh to force the module unloading.

b) if you don't often use USB 2.0 with your laptop, put the ehci-hcd module in hotplug's blacklist.

```
echo ehci-hcd >> /etc/hotplug/blacklist
```

Remove the "modprobe ehci-hcd" line from /etc/acpi/default.sh and restart. In case you ever need USB 2.0 support, just type:

```
modprobe ehci-hcd
```

----------

## scott_b

I checked /proc/modules and found that ehci isn't in there, only my ethernet adapter.  I've done "modprobe ehci-hcd" several times, and it never seems to end up there.  I'm wondering if the module isn't loaded properly.

I followed each one of your steps.  when I try rmmod, it tells me that it doesn't exist in /proc/modules.  none of the other steps work either.  

I don't use USB 2.0 for anything at the moment.  only a portable minidisc player that i obviously havn't figured out how to work on linux yet.  

can I wipe out a bunch of ehci stuff and start over? or just wipe it out altogether?

----------

## nomad-

Weird. You might still try disabling EHCI completely from the kernel config and recompiling. (Make sure /boot is mounted before you install a new kernel.)

----------

## objectswitch

First, Nomad, thank you for your very detailed instructions, and especially,

the patches!

If only I'd had this 6 months ago when I bought my T40!

I am having one issue using ifplugd.  When booting up, if there is no

ethernet cable plugged in, ifplugd is not calling /usr/sbin/ifplugd.action.

As a result, wireless is not activated.

If I manually start eth1  ( /usr/sbin/ifplugd.action eth0 down) then

things work fine.  I can plug in the ethernet, and ifplugd calls

ifplugd.action, the eth1 interface is taken down, drivers are unloaded,

and eth0 is activated.  Unplug the cable, and wireless is then automatically

activated.

Any suggestions?

-David

----------

## nomad-

For every problem there is a solution, though sometimes a pretty hacky one.  :Smile: 

There appears to be no way for ifplugd to calll the .action script on start. I wrote a patch for the /etc/init.d/ifplugd script to check the status of eth0 on bootup (using ifplugstatus) and run 

```
/usr/sbin/ifplugd.action eth0 down
```

if the cable is not connected, thus starting the wireless connection.

To install the patch do:

```
cd /etc/init.d

wget -qO - http://onda.zvuk.net/r51/ifplugd-check-if-on-start.diff | patch -p1
```

The patch adds a 3 second sleep which appears to be what ifplugd needs to  detect the cable after being started. It only checks for eth0, but that's ok for most ThinkPads. If you are not using parallel service startup (see the optimization section of the howto), your boot time will increase by 3 seconds.

----------

## objectswitch

Nomad,

Brilliant.  After updating to ifplugd 0.25 and applying your patches, and

tweaking /etc/conf.d/ifplug the network switching is working!

Hibernate is also working well.  Using your /etc/acpi/default.sh, all

I needed to do was substitute the driver for wireless (I have a cisco

card, using a patched airo driver from Fabrice Ballet)

I have a weird problem with suspend, however.  From X, when resuming

from suspend, all is well for a half a minute to several minutes.  Then

the USB mouse gets very sluggish and networking is lost.  ifconfig shows

eth1 is still up.  Nothing jumps out at me in /var/log/messages.  The

touchpad continues to work fine.

I can't get networking back in this situation and must reboot.

Restarting eth1 and it fails to get a dhcp address.

I'll try to narrow this down over the next few days.

-David

----------

## nomad-

I have not experienced your problems with USB and networking failing. I would take a wild guess and blame it on the Cisco card's driver. Try disabling it completely (take it out if it's a PCMCIA card) and check if the problems goes away. Also, is there a LED that shows if the card is powered or not? I would make sure it's powered off before suspending, using iwconfig's power commands, rmmod-ing the module, unloading the PCMCIA module, or some other card-specific method.

----------

## chk

Thanks nomad- for your great guide. It helped a lot. 

Although I have a few problems with ACPI and my R50p. When I press the power button to hibernate, the TP hibernates very well. When I switch it back on it resumes but hibernates in the next moment. It is an infinite loop. If I call the hibernate script manually it works....

If I call echo 3 > /proc/acpi/sleep the TP immediately goes to sleep, but how can I resume it? I thought I have to hold fn but nothing happends.

Does anybody has an idea to solve these issues?

I use development-sources with the swsusp2 103 patch. The kernel is compiled without Local APIC enabled, because with it it is not possible for me to use fn+f7. The LCD only goes black and it is not possible to get screen back. So I disabled Local APIC:

Antoher thing,  nomad- you mentioned the tpb package depends on app-laptop/thinkpad. In my opinion only the tpctl depends on that. tpd compiles fine without the thinkpad package.

Christian

----------

## nomad-

Hey Christian!

I experienced the problem with looped hibernation after resuming, but it only happened once to me. I believe it has to do with holding the power button or pressing it several times before the actual hibernation. That would make acpid hibernate again, right after resuming.

To resume from sleeping, just press the power button. The Fn key does not seem to work for some reason, but using the power button instead is not a big deal. 

You are right about the tpctl package. My bad. tpb only requires /dev/nvram support. 

Thanks for notifying me of the swsusp2 103 release. I'll check out the new patches right away.

----------

## scott_b

how do i get /dev/nvram support?

----------

## nomad-

To get /dev/nvram working, enable this in the kernel config:

```
Device Drivers >

    Character Devices >

        /dev/nvram support
```

and recompile your kernel. If you compile it as a module, you'll need to manuallly load the nvram module (put it in /etc/module.autoload.d), because hotplug will not load it for you.

----------

## PMT

Quick addendum I thought I'd note...

Intel's official IPW2200 driver project just released 0.3, which actually supports doing productive things with the card [though no productivity with WEP, sorry].

Figured some of the R51 users might want to grab that driver and give it a spin.

EDIT: Oh, and for those who don't read the README or TODO, it connects in .11b mode, meaning that you only get 11 MBit throughput...for now.

----------

## fraehttt

Resuming from hibernation works fine by pressing the power switch for me. I got an R51.

The only things that do not work are Suspend to RAM and the modem.

I got it working with connexants hsf-driver, but I don't want tu use a commercial driver and at the moment I even don't get this one working.

----------

## fraehttt

To resume from Suspend-to-RAM and so on, I just pressed the power-button. Since I patched my 2.6.8.1 with the acpi.sourceforge.net patches it simply resumes when I open the lid  :Smile: 

----------

## maltheus

Thanks for posting this just before I bought my R51. It's part of the reason I ended up going with Gentoo.

You had mentioned you had gotten wireless working. You didn't mention if you got WEP working though. If you did, could you please post your key_ESSID line? I've tried just about every combination of passphrase and hex key(s) with "open," "restricted" and everything else. Everything works fine when I disable WEP. And my hex key(s) were cut and pasted (no typos). I've read the UberLord thread and the format makes all the difference here and even though I have the 2200bg (I've tried ndiswrapper 0.7-0.10), I'm hoping the format between our boxes will be the same.

What ends up happening is:

```

* Running preup function

*    Configuring wireless network for wlan0

*    Connection to "MySsid" (WEP enabled)...

*        wlan0 connected to "MySsd" in managed mode

*        on channel 6 (WEP disabled)

* Bringing wlan0 up via DHCP...

```

...and then it fails. It's almost like it loses the WEP key.

I haven't seen a clear answer on this but is WPA even possible? I'd hate to have to disable WEP.

Thanks!

----------

## nomad-

My WiFi router (a Netgear piece of crap) does not support WEP, so I cannot help you with that. You would probably want to go the wireless-config discussion thread and ask there.

----------

## objectswitch

Nearly everything on the thinkpad t40 is working well now.

One thing that has never worked is the function to switch between

internal LCD and external CRT.  I really would like to get this working,

as I use a docking station and would like to be able to undock and

walk away without having to stop and restart X with a different

config.

Is this possible with the radeon driver, or only with the ati

proprietary drivers?  I'm shy of the ati drivers as I experienced

random screen lock-ups (only mouse continued to work).  This

was under X86Free, but I switched to the open source radeon

on the problem disappeared.

I am now running Xorg.

----------

## timeout

 *maltheus wrote:*   

> Thanks for posting this just before I bought my R51. It's part of the reason I ended up going with Gentoo.
> 
> You had mentioned you had gotten wireless working. You didn't mention if you got WEP working though. If you did, could you please post your key_ESSID line? I've tried just about every combination of passphrase and hex key(s) with "open," "restricted" and everything else. Everything works fine when I disable WEP. And my hex key(s) were cut and pasted (no typos). I've read the UberLord thread and the format makes all the difference here and even though I have the 2200bg (I've tried ndiswrapper 0.7-0.10), I'm hoping the format between our boxes will be the same.
> 
> What ends up happening is:
> ...

 

I made my wireless card linksys WPC54g work with WEP by following commands:

```

iwconfig wlan0 essid "myessid"

iwconfig wlan0 key "s:xxxx" open

ifconfig wlan0 up

dhcpcd -d wlan0

```

i do not know how to fix this problem with wireless-config, if someone knows plz let me know

----------

## yangman

I have recently placed an order for a R51; it's encouraging to see the relative lack of problems installing gentoo on this system.

I also plan to dual-boot Gentoo along with Windows, and am planning to leave an extra partition between the linux partitions and the ntfs parition (which will be moved to the end of the HD) so that I have some room to manuver when I eventually migrate to reiser4, or even possibly expand my Windows partition. 

However, I am uncertain if Partition Magic is able to expand a Windows boot partition safely without affecting the other linux partitions. Has anyone had experience with this?

Also, am I correct to assume that after the rearrangements, reinstalling Windows would be impossible since the partition no longer occupies the beginning of the harddrive? (I haven't had to deal with reformatting Windows for ages, much to my delight)Last edited by yangman on Sun Aug 29, 2004 5:41 am; edited 1 time in total

----------

## Eagle_

Hi,

I would like to know how could i create a short key (Fn + F4) for telling my T41 thinkpad to suspend?

Thanks

----------

## PMT

yangman > Relative lack of problems indeed. Post here if anything breaks, or PM me, and I'll try to help you fix it, if you'd like...that goes for everyone. I actually have everything except for three things working exactly as I want them on this laptop...

1) Issuing "poweroff" throws the laptop into some low-power suspend that doesn't escape, until being powered off.

2) The $!@# Radeon card has no 3D acceleration with standard drivers, and very imperfect rendering in certain games [Scorched 3D, notably] with the CVS DRI.

3) The wireless drivers have yet to enable .11g support.

A tidbit I picked up recently: S-Video out on the laptop isn't like the monitor-out, where it automatically outputs to the monitor when it's plugged in. You need to use atitvout, in Portage.

And Eagle_: That would be, if anywhere, in Regional & Accessability > Keyboard Shortcuts.

----------

## Eagle_

Hi PMT,

I hadnt found the option suspend under  Regional & Accessability > Keyboard Shortcuts. Anyway, it not realy what i am looking for.

I would like, when i press Fn + F4, that the suspend would work from any place i am in linux or grafical meneger, not only KDE.

If i understand currectly, it suppose to be some kinf of event, I am suppose to add it to /etc/acpi/default.sh or to some othere event file. I would like it to be a global config not local.

Thanks

Eagle

----------

## PMT

All right...

Offhand, I don't know how to do that, honestly. Look on The Linux Documentation Project for a HOWTO on that, or wait for someone more competent than I to answer your question. If you find it, though, please reply, as I'm sure others are interested in doing this as well.

Unfortunately, since my ThinkPad is an R51, it already does suspect on Fn-F4, so all I have to do is find out how to modify ACPI for it to work properly...so I can't test your solution without modifying it to another F key, like F6.

Good luck.

----------

## Bluepixel

What's the difference between using swsusp2 and the kernel hibernate function (echo "disk" > /sys/power/state)?

I use the latter, and it worked once, but now my wireless card always resumes the computer:

```

Stopping tasks: ===================================================================|

Freeing memory: ...............................................................................................................................................................|

eth1: Orinoco-PCI entering sleep mode (state=3)

PM: Attempting to suspend to disk.

PM: snapshotting memory.

PCI: Setting latency timer of device 0000:00:1d.0 to 64

PCI: Setting latency timer of device 0000:00:1d.0 to 64

PCI: Setting latency timer of device 0000:00:1d.1 to 64

PCI: Setting latency timer of device 0000:00:1d.1 to 64

PCI: Setting latency timer of device 0000:00:1d.2 to 64

PCI: Setting latency timer of device 0000:00:1d.2 to 64

ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 7 (level, low) -> IRQ 7

ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 5 (level, low) -> IRQ 5

PCI: Setting latency timer of device 0000:00:1f.5 to 64

eth1: Orinoco-PCI waking up

Restarting tasks... done

```

The first time I tried it, that didn't happen. Any ideas how I can solve this?

----------

## intendedacceleration

It appears as though your patch to /etc/init.d/ifplugd is broken by perhaps an updated init script. I attempted to construct my own but it appears that ifplugstatus no longer exists. Is there a command that has replaced it?

----------

## intendedacceleration

I got it working again. Here is my /etc/init.d/ifplugd init script:

```
#!/sbin/runscript

# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/files/ifplugd,v 1.4 2004/07/15 00:43:53 agriffis Exp $

#NB: Config is in /etc/conf.d/ifplugd

IFPLUGD=/usr/sbin/ifplugd

[ -z "$INTERFACES" ] && INTERFACES="eth0"

[ "$INTERFACES" = "auto" ] && INTERFACES=`cat /proc/net/dev | awk '{ print $1 }' | grep ^eth | cut -d: -f1`

start() {

   einfon "Starting ifplugd: "

        check_ifs

   for IF in $INTERFACES ; do

      echo -n "$IF "

      $IFPLUGD -i $IF $ARGS

   # You can't trust the exit code, so we pretend it works

   #   status=$?

   #   if [ $status -ne 0 ]; then

   #      echo

   #      eend $status "Problem starting for $IF"

   #      return 1

   #   fi

   done

   echo

   eend 0

}

stop() {

   einfon "Stopping ifplugd: "

        check_ifs

 for IF in $INTERFACES ; do

  echo -n "$IF "

  $IFPLUGD -k -i $IF

 done

 echo

 eend 0

}

check_ifs() {

 sleep 3 # 2 seconds are not enough

 linkstatus="`ifstatus | grep eth0 | cut -d ' ' -f 2`"

 if [ "$linkstatus" == "unplugged" ]

 then

  /usr/sbin/ifplugd.action eth0 down &

 fi

}

# vim:ts=4
```

Thanks for the awesome writeup!

----------

## Sgeorg

Hi folks!

I have the following problem:

only the sleep (F4), power and lid switches are detected by acpid (I rewrote event/action to see if I'm right). the sleep button works only once and then never more.

the display off button worked once but stopped now to do so, and the suspend to disk (F12) button never threw an acpid event

Please help,

Georg

Ps: updated to the newest bios and embedded controller sw. before installing linux

----------

## Sgeorg

Hello!

Solved the problems more or the less!

display blanking doesn't work because I use the radeon fb --> radeontool for backlight off

(there is also a kernel modul which turns off the backlight if the vesa fb on console turns off the screen)

F12 + Fn : doesn't work at all --> maybe I should give ibm-acpi, thinkpad, tcplt.... a try?

But I have a new problem: laptop-mode doesn't work!!!!

for testing I killed all processes (except init and a shell) and disabled swap then I started laptop-mode manually but the hd never goes to standby it allways stays active/idel. only after a initial hdparm -y it stays in standby for some time!

So I manually set hdparm -S1 /dev/hda and looked up all kernel parameters like laptop-mode and so on. all parameters have the values they should have. what should I try to solve this?

I checkt the HD state with hdparm -C /dev/hda.

Thanks

Georg

----------

## inode77

 *Quote:*   

> 
> 
> PostPosted: Mon Sep 06, 2004 6:02 pm    Post subject:
> 
> Hi folks!
> ...

 

Answer:

Emerge ibm-acpi and activate the functionality of the kernel module according man page or example below.

```

[ebuild   R   ] app-laptop/ibm-acpi-0.3   0 kB

# echo ffff > /proc/acpi/ibm/hotkey

# echo enable > /proc/acpi/ibm/hotkey

```

For me now Fn+F{3,4,5,7,9,12} trigger an ACPI event and I can enable/disable bluetooth/thinklight by software commands. (Backlight control does not work on my T40p)

Please give feedback to the author according man page to ensure further development.

Author: Borislav Deianov <borislav@users.sf.net>

Information needed: See #vi /usr/share/doc/ibm-acpi-0.3/README.gz

----------

## Sgeorg

Thanks for that tips! --> solved nearly all my problems!

Maybe I can help you with your backlight if you have a radeon mobility!

      Try 

```
radeontool
```

 from portage!  or http://fdd.com/software/radeon/

It has direct access to the HW to switch the backlight on or off!

Also on the HP of radeontool there is a module for vesa console blanking with backlight switching. and some other things.

In X11 backlight switching works like charme, just turn on DPMS in the monitor section of the xorg-x11.conf:

```
Section "Monitor"

        Identifier   "Monitor0"

        VendorName   "Monitor Vendor"

        ModelName    "Monitor Model"

        Option       "dpms"

EndSection

```

I've a R51 1500MHz / 512MB / Radeon 9000 Mobility / 1400x1050 / 15".

----------

## inode77

 *Quote:*   

> 
> 
> Maybe I can help you with your backlight if you have a radeon mobility!
> 
> Try
> ...

 

Thanks alot, but I already know the tool and it works fine even on my M9 ATI FIRE-GL 9000 Mobility.

I don't really need it because the backlight is hardwired in my notebook so no software needed really, but it's always nice to have full control.  :Wink: 

Keep up the spirit, helping each other is the goal  :Smile: 

----------

## wizatdiz

Could someone help me with the thinkpad-5.5.ebuild?  I have done the following:

PORTDIR_OVERLAY set to /usr/local/portage in my make.conf

Downloaded the ebuild into /etc/local/portage/app-laptop/thinkpad

ebuild thinkpad-5.5.ebuild digest

All of the above seems to work fine and follows what I did with wireless-config.  I then do a emerge thinkpad and get:

Calculating dependencies ...done!

>>> emerge (1 of 1) app-laptop/thinkpad-5.5 to /

>>> md5 src_uri  :Wink:  thinkpad_5.5.tar.gz

!!! ERROR: app-laptop/thinkpad-5.5 failed.

!!! Function pkg_setup, Line 31, Exitcode 0

!!! Missing /usr/local/portage/app-laptop/thinkpad/files/thinkpad

If I look in .../thinkpad/files, there is no file or directory thinkpad.  I have know idea how to resolve this and I have not located anything helpful in searching.

----------

## inode77

I don't know where in bugs.gentoo.org the ebuild with file was but I have the file and it's just named thinkpad. Make it and put the code section content in it and it should work.

```
keep

path[thinkpad]=/lib/modules/%KV%/thinkpad

# Uncomment this with the options you like.

#options thinkpad enable_smapi=1 enable_superio=1 enable_rtcmosram=1 enable_thinkpadpm=1

# Uncomment this if you are not using devfs for some reason, and comment the

# rest. Otherwise, leave it as is.

#alias char-major-10-170 thinkpad

alias /dev/thinkpad thinkpad

alias /dev/thinkpad/thinkpad thinkpad

alias /dev/thinkpad/smapi smapi

alias /dev/thinkpad/superio superio

alias /dev/thinkpad/rtcmosram rtcmosram

alias /dev/thinkpad/thinkpadpm thinkpadpm

```

----------

## sog

```
If I call echo 3 > /proc/acpi/sleep the TP immediately goes to sleep, but how can I resume it? I thought I have to hold fn but nothing happends. 
```

same problem here. it sleeps all right, it just won't wake up  :Wink: 

i've tried fn/F4, fn/F7, power, lid close/open, and pretty much everything else i could think of. nothing doing. 

running a thinkpad x23, gentoo-dev-sources 2.6.7 (unpatched, little fuzzy on that end), etc.

i'm not holding out for hibernate - at the moment i'd be content with just suspend, but obviously need to be able to wake the box  :Smile: 

----------

## l0calh05t

I have an IBM Thinkpad R51 with 1.5Ghz Pentium-M (Dothan), 512Mb RAM, a 1024x768 screen and Intel Extreme Graphics 2 graphics chipset and I have a number of problems.

Firstly, I can't resume from sleep 3 state (neither the power button nor holding the fn button cause the computer to resume, the only thing i can do is press and hold the power button until it turns itself off). I hope someone can tell me how to solve this problem.

Secondly, I have no idea how to get control of the backlight of the monitor (and thusly being able to turn it off with Fn+F3)

I have tons of other problems with the laptop as well, but these are currently the most important ones. (although i will want to solve those to as soon as the above are resolved)

Thankyou in advance to anyone who can (and will  :Wink:  ) help me with this.

EDIT: I just recompiled my kernel (gentoo-dev-sources 2.6.8-r3)  after adding the acpi.sourceforge.net kernel patch. Now my laptop switches on again from sleep mode when pressing fn, BUT after it does the screen remains dark and nothing happens anymore.Last edited by l0calh05t on Fri Sep 17, 2004 3:17 pm; edited 1 time in total

----------

## superjoesmoe

hi guys,

i have a t23 and the latest thinkpad and tpctl 4.14 does not work for me and am considering using ps2.exe instead to get suspend, standby, and hibernate to work.  the question is, how can i get ibm's tp configuration utility to for under linux?  thanks.

----------

## Sgeorg

Hi!

The site is down where to load the patches from!!

Please could anyone post the wireless patches and scripts, as plain text?

Thanks

Georg

----------

## l0calh05t

An update to my suspend-to-ram problem. I just tried adding acpi_sleep=s3_bios to my kernel options, now the monitor switches on again... but only to display three letters in yellow: "inu" and then some random dots...this sucks

EDIT: It seems that it works when i'm not in X and turn the framebuffer off. Well, at least it works at all finally, but if anybody knows a solution to this problem please tell me

----------

## Bohemian

That guy has seemed to disappear.  I hope he comes back.  I am ordering my R51 next week.

----------

## Sgeorg

@mejoc

Hi!

maybe I could help you out with some patches or scripts!

have quite the same as in the tutorial (did it my self after no reply from this guy) except:

- less sofiticated wifi config, only dhcp without any security.

- not using softwaresuspend2 only kernel built in swsusp - works quite fine

- have activated all Fn keys

- screen blanking over Fn + F3

- hibernate over Fn + F12

- sleep............. blutetooth......... etc....

- tpb

- cpudyn not cpufreq

- my own laptop mode

- crypto dev mapper for home (NO LOOP)

- crypto for swap hopefully soon

after writing all this, I could have written my own howto.   :Laughing: 

Georg

PS: don'zt blame me for this extremely weird security setting on wlan, I don't use wlan at home, only at univerity where it's free an completely open.  (installed macchanger, don't know for what, but you never know)

----------

## Bohemian

Sounds great.  I liked that guys howto but when he hasn't been around in about 15 days and his apache server is down...well it scared me.  So you got everything working?  I don't know much about networking, I don't even think my college network is wireless.  The IT guy for the college lives accross the street, I'll ask him today.  I know nothing about networking, I have only had one computer my whole life.  I would like wireless if my school has it, if not I can deal with a 10 foot chord so I can work on my bed.  I can leave the other computer in my room too.  Do you have AIM or something?

Chris

----------

## arand

Sgeorg:  I would be interested in how your got your Function keys working, and the screen blanking.  I have a T42.  The one thing that I am still working on is getting the video out working.

----------

## inode77

 *arand wrote:*   

> Sgeorg:  I would be interested in how your got your Function keys working, and the screen blanking.  I have a T42.  The one thing that I am still working on is getting the video out working.

 

Use ibm-acpi to get your function-keys working. It's in portage.

----------

## sog

just a friendly warning folks, i emerged tpctl/thinkpad/configure thinkpad and in so doing borqed my machine (thinkpad X23). details are here: https://forums.gentoo.org/viewtopic.php?t=231393&highlight=

given the lack of similar experiences with the emerge, i can only conclude the problems were from a lack of configuration on my part, but i wanted everyone to be aware that you may experience problems if you don't configure prior to a reboot.

anyhow, i did that trying to get suspend working, but giving the experimental nature of ACPI suspend support, i went backward to APM. there's a great APM HOWTO located here:

https://forums.gentoo.org/viewtopic.php?t=152736&highlight=standby+thinkpad

HTH.

----------

## yangman

I've been running Gentoo on my new R51 for over two weeks now, and so far there hasn't been any major problems.

A word of warning for those who are planning to relocate the preinstalled Windows patition: make sure your BOOT.INI is changed to reflect the NTFS' partition's new location BEFORE starting your partition shuffle. I had not done this with my install, and WinXP would not boot, spitting out a "hal.dll is missing/corrupted" error. All that's needed is to change a few numbers in BOOT.INI, but it's a pain to do so since the recovery CD you can create on the ThinkPad does not have any filebrowsing capabilities, and my Win2k CD does not include a text editor. It was eventually solved by uploading BOOT.INI to a webserver with gentoo, editing it, downloading it to my NTFS partition with the IBM recovery CD, then moving it to the correct place with my Win2K CD.

On the issue of ACPI, none of my Fn+F# keys seem to trigger any events. I currently have ibm_acpi, thinkpad, and pctl emerged. Are there things that need to be configured?

superio will fail modprobing with an unknown error and thinkpadpm returns device not found.

----------

## l0calh05t

Check out /proc/acpi/ibm/hotkeys you have to enable them with this (and maybe set the correct mask)

----------

## lefou

The Infrared-Port is in the down-left corner, just beneath the Centrino-Label.

----------

## arand

 *lefou wrote:*   

> The Infrared-Port is in the down-left corner, just beneath the Centrino-Label.

 

Just out curiosity has anyone got the IR working.  From what research I have done I am pretty sure that it uses FIR (IBM T42).  After reading several IR and linux sites it seems that this is a bad thing.  If it was SIR we would have a good chance of getting it to work.

Also,

 *l0calh05t wrote:*   

> Check out /proc/acpi/ibm/hotkeys you have to enable them with this (and maybe set the correct mask)

 

How did you do this?  I currently do not have /proc/acpi/ibm .

Thanks

----------

## lefou

 *arand wrote:*   

> 
> 
> Also,
> 
>  *l0calh05t wrote:*   Check out /proc/acpi/ibm/hotkeys you have to enable them with this (and maybe set the correct mask) 
> ...

 

I don't have this /proc/acpi/ibm stuff, too. What the magic patch/software to get this?

I thought, one can use any FIR as a SIR. But I never tested irda and in general, it's not possible to use remote controls with standard IR laptop ports.

lefou

----------

## Vollkorn

Hi,

I have /proc/acpi/ibm/hotkey and I think it comes with ibm-acpi

Just emerge it (~x86) and add ibm-acpi to your /etc/modules.autoload.d/kernel-2.6

----------

## stnd

If anyone has had success getting the wireless card going, please let me know how you did it...

I attempted using the ipw2200 firmware and drivers but no luck so far...

Hopefully someone has already found an easy way...

Cheers,

Luka

----------

## lefou

@Vollkorn: I never recognized this module. It works on my R50. What exactly is happen, when I enable /proc/acpi/ibm/hotkey? 

Thank you,

lefou

----------

## Vollkorn

@lefou: I tried to find out for myself but all I could find out is it's about the Fn-Keys and produces events recognizable for apcid so you can use some of the Fn-Keys which are not hard-wired.

I'm not sure about this but it doesn't make a big difference on my R51.

----------

## yangman

I've been digging around ACPI and ibm-acpi related documentations, and was surprised at the lack of step-by-step instructions on how to make them work together. Luckily for you all, I've finally figured it out. On my R51, I can now turn off the LCD screen, have the screen turn off automatically when the lid is closed, toggle screen expansion at will, and hibernate the system with no problems at all.

Here is a run-down.

Enabling Hotkeys

First, you will need to emerge ibm-acpi to use the hotkeys (Fn + F# combinations), and, of course, acpid.

```
emerge acpid

rc-update -a acpid default

emerge ibm-acpi
```

Next, make sure ibm-acpi is loaded on boot by adding it to the appropriate modules.autoload.d file.

```
echo ibm-acpi >> /etc/modules.autolaod.d/kernel-2.6
```

Next, make sure hotkeys are enabled automatically on modprobing the module.

```
echo 'options ibm-acpi hotkey=enable' > /etc/modules.d/ibm-acpi

modules-update

```

At this point, load the ibm-acpi module and start acpid if necessary.

```
/etc/init.d/acpid start

modprobe ibm-acpi

```

Mapping Hotkeys

Now, you must map the hotkeys to their respective functions. Instead of explaning it in detail, I will simply provide my current script here.

Not all hotkeys are currently mapped to execute something, and I can't recall what Fn+F9 is supposed to do. It is unlabled on my R51, as well as Fn+F8, although both generate ibm-acpi events.

Also note that some events uses commands that requires X to be running.

I will update with a more complete script once I have more functions working.

/etc/acpi/tp.sh

```

#!/bin/sh

# Event script for IBM Thinkpad R51

group=${1/\/*/}

action=${1/*\//}

dpms_force='/usr/X11R6/bin/xset -display :0.0 dpms force'

case "$group" in

        # standard acpi button events

        button)

                case "$action" in

                        # powerbutton

                        power)  /sbin/init 0

                                ;;

                        # lid open/close

                        lid)

                                if [[ -n `grep open /proc/acpi/button/lid/LID/state` ]] ; then 

                                        $dpms_force on

                                else 

                                        $dpms_force off

                                fi

                                #xflock4

                                ;;

                        # everything else -- undefined

                        *)      logger "ACPI action $action is not defined"

                                ;;

                esac

                ;;

        # ibm-acpi events

        ibm)

                case "$action" in

                        # Fn+F# hotkey

                        hotkey)

                                case "$4" in

                                        # F3 - turn off lcd

                                        00001003)

                                                $dpms_force off

                                                ;;

                                        # F4 - sleep

                                        00001004)

                                                echo 3 > /proc/acpi/sleep

                                                ;;

                                        # F5 - bluetooth

                                        00001005)

                                                ;;

                                        # F7 - switch display

                                        00001007)

                                                ;;

                                        # F8 - display expand

                                        00001008)

                                                echo expand_toggle > /proc/acpi/ibm/video

                                                ;;

                                        # F9 - ???

                                        00001009)

                                                ;;

                                        # F12 - hibernation

                                        0000100c)

                                                echo 4 > /proc/acpi/sleep

                                                ;;

                                        esac

                                ;;

                        *)      logger "ibm/$action is no defined"

                                ;;

                esac

                ;;

        *)

                logger "ACPI group $group / action $action is not defined"

                ;;

esac

```

Modify /etc/acpi/events/default to use the new script

```
event=.*

action=/etc/acpi/tp.sh %e
```

And, that's it! Assuming your Thinkpad has the same hotkey mapping as mine, the LCD display should now powerdown completely when the lid is closed or Fn+F3 is used. It will automatically turn on again when the lid is opened. Fn+F4 will tell the system to enter standby, but it may exit immediately depending on your configurations: there are problems with standby that I've not tried to solve yet. Fn+F12 will trigger hibernation (or software suspend) assuming your kernel supports it.

Software Suspend

I'm not going to go into details about how to enable support for hibernation here, but it's basically enabling it in your kernel configuration then recompiling.

Once it is enabled in your kernel, modify your bootloader so that your kernel is started with the resume= option. Below is the relevant lines from my grub.conf. Note that my swap partition is /dev/hda1.

```
title Gentoo Linux 2.6.8-r7

root (hd0,1)

kernel /kernel-2.6.8-gentoo-r7 root=/dev/hda5 video=vesafb:1400x1050-24@72,ywrap,mtrr resume=/dev/hda1
```

Assuming you are using my script and it works for you, Fn+F12 will now put your system into hibernation mode. You may also change your powerbutton to do the same thing by changing the following line in tp.sh:

```
power)  /sbin/init 0 
```

 to 

```
power) echo 4 > /proc/acpi/sleep
```

Resuming from hibernation is as simple as booting your system as you would normally.Last edited by yangman on Thu Oct 21, 2004 4:59 pm; edited 3 times in total

----------

## lefou

I don't like init scripts if these are not necessary.

 *Quote:*   

> For some reason, hotkeys are disabled by default when the module is loaded. This can be solved easily by creating a simple init.d script --  in my case, /etc/init.d/ibm_acpi.
> 
> ```
> #!/sbin/runscript
> 
> ...

 

You don't need such an init script. It ist enough, to create the file /etc/modules.d/ibm_acpi with the following content:

```
# Enable Hotkey-Event for IBM-Thinkpad

options ibm_acpi hotkey=enable
```

Then you have to run modules-update. That's all. When ever you load the kernel module ibm_acpi into the kernel, it will enable the hotkey feature.   :Very Happy: 

----------

## yangman

lefou:

Thanks for the heads up.  :Smile: 

I've edited my post to reflect the change.

----------

## Sgeorg

FOR ALL OF YOU THINKPAD USERS:

WATCH THIS:

http://www.thinkwiki.org

has quite some potential.

Georg

----------

## Sgeorg

Having a Problem with my G-Nic after sleep!

```

Oct 23 15:01:25 thinkpad ifplugd[16187]: Link beat lost.

Oct 23 15:01:29 thinkpad e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex

Oct 23 15:01:30 thinkpad ifplugd[16187]: Link beat detected.

Oct 23 15:01:34 thinkpad NETDEV WATCHDOG: eth0: transmit timed out

Oct 23 15:01:34 thinkpad ifplugd[16187]: Link beat lost.

Oct 23 15:01:40 thinkpad e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex

Oct 23 15:01:40 thinkpad ifplugd[16187]: Link beat detected.

Oct 23 15:01:50 thinkpad NETDEV WATCHDOG: eth0: transmit timed out

Oct 23 15:01:50 thinkpad ifplugd[16187]: Link beat lost.

Oct 23 15:02:02 thinkpad e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex

Oct 23 15:02:02 thinkpad ifplugd[16187]: Link beat detected.

Oct 23 15:02:12 thinkpad NETDEV WATCHDOG: eth0: transmit timed out

Oct 23 15:02:12 thinkpad ifplugd[16187]: Link beat lost.

Oct 23 15:02:20 thinkpad e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex

Oct 23 15:02:20 thinkpad ifplugd[16187]: Link beat detected.

Oct 23 15:02:25 thinkpad NETDEV WATCHDOG: eth0: transmit timed out

Oct 23 15:02:25 thinkpad ifplugd[16187]: Link beat lost.

Oct 23 15:02:35 thinkpad e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex

Oct 23 15:02:36 thinkpad ifplugd[16187]: Link beat detected.

Oct 23 15:02:40 thinkpad NETDEV WATCHDOG: eth0: transmit timed out

Oct 23 15:02:41 thinkpad ifplugd[16187]: Link beat lost.

Oct 23 15:02:46 thinkpad e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex

Oct 23 15:02:47 thinkpad ifplugd[16187]: Link beat detected.

Oct 23 15:03:11 thinkpad NETDEV WATCHDOG: eth0: transmit timed out

Oct 23 15:03:12 thinkpad ifplugd[16187]: Link beat lost.

Oct 23 15:03:15 thinkpad e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex

Oct 23 15:03:16 thinkpad ifplugd[16187]: Link beat detected.

```

even without ifplugd the e1000 doesn't work. you have too reboot, after sleep tho get the NIC working again.

rmmod e1000 / modprobe e1000 before sleep, after ........ doesn't help.

Thanks Georg

ps: It's an R51 - 1829EGH

----------

## The_Fallen

Hi, 

shutdown doesn't work on my R51 and the disable-lapic-before-shutdown patch isn't available anymore under the given URL. Where can I find it?

thx,

fallen

----------

## Sgeorg

have 2.6.8-r9

shutdown works like charm on my R51, without the patch!

Georg

----------

## The_Fallen

Are you using APM or ACPI?

I'm working with kernel 2.6.8.1 and ACPI and shutdown doesn't work...  :Sad: 

Any ideas, what I can do?

----------

## Sgeorg

Using acpi.

just noticed (because forgot to patch) that shutdown works without it.

tried r10 --> this doesn't even boot, just shutsdown while booting (without any pathch applied)

and the newest 2.6.9-r1 has no swsusp in it, so I just use r9!

So try r9.

Georg

----------

## The_Fallen

I just updated to Kernel 2.6.9 and it works fine now.  :Smile:  Thanks für your help.

----------

## (andrew)

Hi everybody,

at first the HW I am using: a IBM Thinkpad R50p with a FireGL (VGA compatible controller: ATI Technologies Inc M10 NT [FireGL Mobility T2] ) 

My current SW:  

   ->Gentoo Linux, gentoo-dev-sources 2.6.9 

   -> xorg-x11-6.8.0-r1, my video driver is the standard video driver from xorg for ati

            Identifier  "Card0"

            Driver      "ati"

            VendorName  "ATI Technologies Inc"

            BoardName   "Unknown Board"

            BusID       "PCI:1:0:0"

Because i need to connect my laptop to an external monitor or a beamer, i need to use the vga port. Under the console, switching with Fn F7 works fine ( only laptop, both laptop and monitor, only monitor -> everthing works fine). As soon as i switch to X, the keys Fn F7 does not work any more. If I connect a monitor, the picture is directly shown on the external monitor without hitting the keys. But the picture flickers a lot, so its not usable.Any further hit of the keys has no impact. Any ideas ? perhaps some options in the xorg-config file ? I searched for quite a while, but didn't find a solution.

thx   :Razz: 

----------

## gen2doggy

looking for one but cant find any R5x models with anything other than the Radeon 7500 (which I gather is worse than pants)

----------

## Bohemian

Get a Thinkpad T23!

----------

## gen2doggy

Where from?

Isn't that an old model?

----------

## Bohemian

overstock.com  

This is my uname -a

Bohemian root # uname -a    

Linux Bohemian 2.6.10-gentoo-r4 #1 SMP Sun Jun 12 15:32:39 Local time zone must be set--see zic  i686 Intel(R) Pentium(R) III Mobile CPU      1133MHz GenuineIntel GNU/Linux

256 ram.  30gb hdd.  You could pay 150 from dirtcheapdrives.com and get a 60 gb hdd.  I recommend it.  14inch screen, and weighs 4.5 pounds.  Does anything I want.  I use Fluxbox.  Get one, for 700 bucks including a 2 year warrenty, you can't beat it!

----------

## gen2doggy

i need to find a site like that in the UK   :Razz: 

----------

## Bohemian

They will ship to the UK.  Or try ebay.  It shouldn't be hard to find.

----------

## gen2doggy

gordon brown likes to take his cut with stuff like that coming into the country   :Evil or Very Mad: 

----------

## Bohemian

Heh, who is Gordon Brown?

----------

## francesco

I apparently got suspend to RAM to work in ACPI on my Thinkpad X31.

The problem was previously that the display backlight woudn't turn off.

Here's my /etc/acpid/default.sh

```

#!/bin/sh

# Default acpi script that takes an entry for all actions

set $*

group=${1/\/*/}

action=${1/*\//}

case "$group" in

        button)

                case "$action" in

                        power)  /usr/bin/chvt 7

                                radeontool light on

                                ;;

                        sleep)  sync && sync && sync

                                /usr/bin/chvt 1

                                radeontool light off

                                echo 3 > /proc/acpi/sleep

                                radeontool light off

                                ;;

                        lid)  sync && sync && sync

                                /usr/bin/chvt 1

                                radeontool light off

                                echo 3 > /proc/acpi/sleep

                                radeontool light off

                                ;;

                        *)      logger "ACPI action $action is not defined"

                                ;;

                esac

                ;;

        *)

                logger "ACPI group $group / action $action is not defined"

                ;;

esac

```

The key is to switch to a text console prior to use radeontool to turn off the display (the  /usr/bin/chvt 1  line).

Obviously, you need to enable acpid in your startup scripts, and emerge radeontool...

----------

## mhvaughn

Evil, evil thinkpad!

After much searching online I'm hoping someone here might be able to help me...

When I first installed gentoo about a year ago, I couldn't get sleep (echo 3 > /proc/acpi/sleep) working and I didn't have time to fix it.  It would successfully sleep, but there was no way to wake it up.

Now, I've just upgraded my kernel to the gentoo-dev-sources 2.6.10 r6 and sleep works better, in that it goes to sleep *and* hitting the function key seems to wake it up---sort of.

When it's waking up , the screen says "in" in yellow text for a while, then the sleep light goes out and the thing reboots.

Anyone else have this problem, or know what could be causing it?

I've tried a variety of kernel options (like acpi_sleep=s3_bios, hdx=stroke, nolapic...) but nothing seems to make any difference.

I don't really want to switch to APM but I cannot, for the life of me, get this thing working.

----------

## gen2doggy

Do the recovery cd's re-instate the backup/pre-desktop partition? or once it's gone is it gone for good?

I just want to be sure that if I screw everything up, I can bang the recovery cd's in and have a working system as beautiful as it was when it arrived?

----------

## The_Fallen

Hi,

I've just bought a new hard drive for my thinkpad, but there's one big problem... Warranty ended one week ago and IBM now wants about 60 for the recovery cd, what I really don't want to pay. So I would like to backup the predesktop, but I don't know why, on my R50 the IBM app for backupping doesn't exist (i can only backup the installed system)...

So I switched off the security function, so that I can see the part of the hard drive. But cfdisk tells me, that it is really "free space", so I don't know, how to backup it...

Any ideas, how I can do that?

thx,

Tim-Oliver

----------

## Master One

 *nomad- wrote:*   

> Get my ifplugd.action and put it in /usr/sbin. Now, test ifplugd.

 

Anyone has nomad-'s ifplug.action file? Because the link to his site is not working any more, and I really would like to have a look at it (noone should have to invent the wheel twice  :Wink:  )

----------

## batzee

Just wanted to say thank you for this fine thread  :Smile: 

I'm off to get one of these R51, see you guys later ...

----------

## objectswitch

Or at least, my current version of it:

sunds@espoir>> more /usr/sbin/ifplugd.action 

#!/bin/bash

logger ifplugd.action run $*

if [ -x ${rc_script} ]; then

        case "$2" in

                up)

                        /sbin/ifconfig $1 down &> /dev/null

                        /etc/init.d/net.eth0 --quiet start 

                        /etc/init.d/net.eth1 stop

                        ;;

                down)

                        /etc/init.d/net.eth0 --quiet stop  

                        /etc/init.d/net.eth1 start

                        ;;

                *)

                        echo "$0: wrong arguments"

                        echo "Call with <interface> <up|down>"

                        exit 1

                        ;;

        esac

else

        echo "$0: init script ${rc_script} not found"

        exit 2

fi

logger interface $1 changed to $2

exit 0

----------

## Master One

 *objectswitch wrote:*   

> Or at least, my current version of it: /usr/sbin/ifplugd.action

 

Thank's, but it was about nomad-'s more sophisticated version of that script. In the meanwhile I already worked out a solution by myself, please see this thread.

----------

## 2lt.chronic

all of this guys links are down.... anyone have these files up somewhere elsE?

----------

## badgers

Hey I have a general question, There seems to be several different types of R51 out there

can anyone tell me if this laptop

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&rd=1&item=6754834826&ssPageName=STRK:MEWA:IT

is the type that this howto refers to?

I had read somewhere that the centrino technology was not supported under linux, and I am not sure if this is the same Wi-Fi card as is indicated in this howto

thank you all for your time and have a  good day

----------

## br_linux

I have a R50 and got problems configuring sound... I compiled alsa with on the kernel but nothing works. 

My lspci

0000:00:00.0 Host bridge: Intel Corp. 82855PM Processor to I/O Controller (rev 03)

0000:00:01.0 PCI bridge: Intel Corp. 82855PM Processor to AGP Controller (rev 03)

0000:00:1d.0 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)

0000:00:1d.1 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)

0000:00:1d.2 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)

0000:00:1d.7 USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 01)

0000:00:1e.0 PCI bridge: Intel Corp. 82801 Mobile PCI Bridge (rev 81)

0000:00:1f.0 ISA bridge: Intel Corp. 82801DBM (ICH4-M) LPC Interface Bridge (rev 01)

0000:00:1f.1 IDE interface: Intel Corp. 82801DBM (ICH4-M) IDE Controller (rev 01)

0000:00:1f.3 SMBus: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)

0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)

0000:00:1f.6 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)

0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M7LW [Radeon Mobility 7500]

0000:02:00.0 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)

0000:02:00.2 FireWire (IEEE 1394): Texas Instruments: Unknown device 802a (rev 01)

0000:02:01.0 Ethernet controller: Intel Corp. 82540EP Gigabit Ethernet Controller (Mobile) (rev 03)

0000:02:02.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abgNIC (rev 01)

My lsmod

Module                  Size  Used by

radeon                 70784  1

drm                    55188  2 radeon

ohci_hcd               18184  0

parport_pc             28740  0

parport                30408  1 parport_pc

ohci1394               28676  0

ieee1394               87860  1 ohci1394

usbhid                 30016  0

ehci_hcd               27400  0

uhci_hcd               27664  0

intel_agp              18972  1

agpgart                27176  2 drm,intel_agp

usbcore                97400  5 ohci_hcd,usbhid,ehci_hcd,uhci_hcd

snd_intel8x0           27200  0

snd_ac97_codec         67576  1 snd_intel8x0

snd_pcm                76040  2 snd_intel8x0,snd_ac97_codec

snd_timer              19460  1 snd_pcm

snd                    44132  4 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer

snd_page_alloc          7428  2 snd_intel8x0,snd_pcm

e1000                  80180  0

I dunno if I am using the right module. I tryed snd_intel8x0 and snd_ac97_codec

my /etc/modules.autoload.d/kernel-2.6

e1000

snd_intel8x0

Thanks in advance for the help !

Regards,

Br_linux

----------

## saturday

 *badgers wrote:*   

> Hey I have a general question, There seems to be several different types of R51 out there
> 
> can anyone tell me if this laptop
> 
> http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&rd=1&item=6754834826&ssPageName=STRK:MEWA:IT
> ...

 

The laptop at ebay has a lower screen resolution, another graphics chip etc. However, the howto may be useful. I used it to configure my R51 (yet another model).

----------

## homry

 *nomad- wrote:*   

> 
> 
> ```
> CFLAGS="-march=pentium3 -O3
> ```
> ...

 

sorry, just a little question, because i am also planning to install gentoo linux on my r51.

in the doc of the gnu gcc, i found the option "-march=pentium-m" more appropriate.

http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options

but i am really not a specialist. so maybe i overlook something.

homry

----------

## lefou

 *homry wrote:*   

>  *nomad- wrote:*   
> 
> ```
> CFLAGS="-march=pentium3 -O3
> ```
> ...

 

CFLAGS="-march=pentium-m" should be OK. 

I use -march=pentium4 for my ThinkPad R50 to stay binary compatible with my older A31 with a Pentium 4.

lefou

----------

## saturday

 *homry wrote:*   

>  *nomad- wrote:*   
> 
> ```
> CFLAGS="-march=pentium3 -O3
> ```
> ...

 

If I understood other postings correctly, "-march=pentium-m" only works with gcc 3.4, not gcc.3.3 .So using gcc 3.3 I've chosen "CFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"

Note that there's no "-msse2" in my CFLAGS, because I could not compile Openoffice with it. KDE may have problems with it, too.

----------

## hoschi

hello, 

i want buy an ibm r51 laptop, with ati radeon or intel-extrem-graphics 2.

how fast is intel-ex.g.2 ? 3D? is it possible to run quake3 or 3d modelling programms?

----------

## lefou

I run a R50 with Radeon 900 Mobility, 1.5GHz Centrino. Quake 3 Demo is really fast, even in highest resolution. Don't know about performance with 3d modelling software.

----------

## saturday

I hope someone can help me out with this. I'm trying to get the Fn+F-keys working, but I am still having problems with FN+F3. The screen doesn't go black.  :Sad: 

I emerged ibm-acpi and used the script yangman posted on side 3 of this thread (21.10.04).

FN+F4 sends the thinkpad to sleep mode, but FN-F3 doesn't work.

The ACPI-event is recognized, but in my /var/log/acpid, but I can see the following error:

```
Xlib: connection to ":0.0" refused by server

Xlib: No protocol specified

/usr/X11R6/bin/xset: unable to open display ":0.0"
```

I've read in the forums that this may be solved by setting some xhost-values. But whenever I type something beginning with "xhost", I get: "xhost: unable to open display "" " At this point, I am really stucked and I don't know what to do. Maybe someone can give me good advice on this? I really hope so.  :Smile: 

One more thing: How can I turn off the "BEEP" when the laptop is going to sleep by pressing "FN+F4"?

----------

## lefou

The newest xorg-x11 ebuild merges under /usr/bin, so you have to check the path to X and xset.

This is my blank.sh script:

```

#!/bin/bash

export XAUTHORITY=`ps ax | grep /usr/bin/X | perl -n -e '/-auth (\S+)/ and print $1,"\n"'`

sync

/usr/bin/xset -display :0 dpms force off

```

If you have /usr/X11R6/bin where I have /usr/bin please change.

Hope this helps.

lefou

----------

## saturday

 *lefou wrote:*   

> Hope this helps.
> 
> 

 

Thanks, but I'm sorry it didn't  :Sad: 

I checked the path, but as there is an symbolic link, that should have been fine. Changed it anyway.

I also added the "export XAUTHORITY"-stuff to my script, but the error remains the same. I think I'm going to try it with the radeontool now, although that seems to me a bit like a dirty workaround.  :Wink: 

----------

## lefou

Do you have tried this command as normal user with X running?

```
xset dpms force off
```

If nothing will happen, then try radeontool. Otherwise, your script (executed as root) does not find your running X session. Maybe you have to alter the ps - grep - perl line.

What says 

```
ps ax
```

Do you see a line with "/usr/bin/X"?

----------

## saturday

 *lefou wrote:*   

> Do you have tried this command as normal user with X running?
> 
> ```
> xset dpms force off
> ```
> ...

 

I tried it as user and as root, made no difference. But I'm quite happy with radeontool now, it's much less complicated. Maybe the former problem is the well known problem with the Radeon 7500?

Suspend to Ram and Suspend to Disk are working now, but I still have this beep when I suspend to Ram (Fn+F4). Is it possible to disable that beep? Or is it indicating some kind of error? /var/log/acpid looks fine though...

----------

## lefou

When using radeontool, do you have to enable the display programmatically, or is a pressed key enought to enable the display?

I don't like the scenario, where I have disabled my display (and videocard) with radeontool, but have for some reason no chance to enable it, because there is no open root shell to tip in blindly the required command (and have to remenber this command, too).

----------

## saturday

I can re-enable the display by pressing Fn-F3 again. The relevant code (grabbed it from the forum somewhere) I use in the acpi-directory is:

```
rtool='/usr/bin/radeontool light'

(...)

# ibm-acpi events

        ibm)

                case "$action" in

                        # Fn+F# hotkey

                        hotkey)

                                case "$4" in

                                        # F3 - turn off lcd

                                        00001003)

                                                if [[ -e /tmp/.radeonlock ]]

                  then

                  $rtool on

                  rm /tmp/.radeonlock

                  else

                  $rtool off

                  touch /tmp/.radeonlock

                                                fi

                  ;;

```

----------

## hoschi

hi, i want to buy a thinkpad r52 with the new sonoma-chipsatz and intel-onboard graphic

i heared that xorg 6.8.3 will support the new onboard graphics, and the intel drivers are open-source (like xgi, via etc.).

and i will be also able to use these xorg-drivers for 3d?

is that true? how? is there a howto (is okay, if it is only written for the old intel-centrino-chipsets)?

----------

## pberndt

Since it's been a long time since the sleep-mode problem was last mentioned I hope for someone having found a way to solve that in the meantime  :Wink: 

With my 2.6.11.11-suspend2 kernel, putting the notebook into sleep mode (using "echo mem > /sys/power/state") works fine. But when I try to make it wake it up again it does nothing but doing a hard reset.

I already tried...

- To disable ACPI (-> As assumed it doesn't even go into sleep mode afterwards)

- To disable any framebuffer devices (-> After pressing the button I see the kernel's debug message saying that the system was successfully put into sleep mode for a sec, again, the reset follows)

- To add the acpi_sleep=s3_bios parameter mentioned in the other thread (-> The screen displays something similar to "inu" in large, friendly and very yellow letters; another reboot follows)

Since the system does a hard reset I can't get any debugging information.. at least I don't know how to get it  :Wink: 

Tia for any clues and solutions, pberndt

----------

## ekutay

 *pberndt wrote:*   

> .... acpi_sleep=s3_bios ...

 

got an x40 and for me 

```
acpi_sleep=s3_bios,s3_mode
```

 finally did the trick.

----------

## pberndt

Your hint led me to this sf page. Unfortunately, none of the clues (including your line) worked for me.

Using

```
acpi_sleep=s3_mode
```

combined with a minimal kernel configuration (i.e. no fb, no usb, etc.) gave me the kernels acpi debugging output after resuming, saying that the system was successfully put into sleep state. After a few seconds, the error with "lin" crashes the system again.

Strange  :Crying or Very sad: 

Thanks anyway.

(Berlin komm ick ooch her ^^)

----------

## ekutay

Does your system crash really or is the display unusable, more precisely stays dark? Btw. which thinkpad model do you use?

 (echt knorke kollege  :Smile:  ) 

----------

## pberndt

 *ekutay wrote:*   

> Does your system crash really or is the display unusable, more precisely stays dark? Btw. which thinkpad model do you use?

 

 *Quote:*   

> Since the system does a hard reset

 

It doesn't even output a kernel panic/oops. It just reboots.

----------

## djepi

I seem to remember that local APIC in the kernel created the very same problem on my own R51. it works fine now with this kernel config:

-----------

To be able to resume from sleep, it is recommended to disable local APIC support:

Processor type and features --->

    [ ] Local APIC support on uniprocessors (you want to unselect this by pressing N)

-----------

I have more information at:

http://www.jenny-and-jp.org/index.php?page=thinkpadr51&lang=english

the page is out of date quite a bit but I did get sleep to work fine with that setup.

i hope it helps

----------

## pberndt

Great  :Smile: 

After resuming the acpid initiates an shutdown immediately, but this should be a trivial problem  :Very Happy: 

Big thanks, it's working great now.

----------

## woutert

Well, finished writing my document on how to get everything working on my laptop. An IBM R51-K2G Type 2887. You can find the document here:

http://snakeshit.nl/documentatie/txt/IBM_R51_Configuration_Manual_Using_Gentoo_Linux.txt

----------

## tlippy01

Hi all, so I recently got an R52 notebook, and have two questions that hopefully someone here can help me with: first, while dma works on my harddrive, it doesn't work on my dvd drive (~2 mb/s).  I've tried every possible combination of kernel options for piix/libata/etc, including manual editing to #define options in piix.c and a patch for libata_piix, to no avail.  I've concluded that the ide interface (82801FB) is just not thoroughly supported yet.  Am I right on this?  No big deal, as I don't really use the dvd drive anyway, but everything else just works so well...

The other issue is the keyboard: on my old dell, I could hold down the Fn key and use the numpad, which was great for playing nethack and adom.  but on the ibm, it seems you have to enable numlock, which renders the numbered-keys pretty much useless in their original function.  Furthermore, the Fn key on the ibm doesn't seem to work like a mod-key (e.g. alt) so i cant simulate this behaviour with xhkeys.  urg.  is there no easy way around this??  thanks!

----------

## rand0minteg3r

Hi, could the author of the original posting please re-post the xorg.conf and other links somewhere?  The links are dead, and I could really benefit from seeing them... esp. xorg.conf

Thanks  :Smile: 

----------

## hagen_

I have a R51 and I'd like to setup my modem but I read the thinkwiki and I see there is a two types of modem 

#  CDC slot with one of the following:

    * IBM Integrated 56K Modem (MDC-2)

    * IBM Integrated Bluetooth III with 56K Modem (BMDC-2) 

My question is: How do I know what kind of modem I have?

----------

## eltech

Has anyone found a [up2date] nice guide to get going using at a minimum 2006 on an ibm r51 thinkpad? I want to do the install onto my r51 of 2006.1 since right now i dont need windows on it, but id like it to be as customized as this guided install is.. being in gentoo things move so fast i would doubt this guide is even as accurate as it once was ..

any ideas?

----------

## cajzell

Can anyone be so kind to tell me what kind of CPU loads they get with this machine, going with firefox to this site

www.aftonbladet.se

If you get anything below 50% (with the flash animations working and java enabled) I'd be interested. I don't know why firefox is so extremely CPU hungry these days...

----------

## cajzell

It would also be quite interesting if we could share or kernel configs here. Or should that be done on a separate page somewhere, would tend to be quite lengthy.

----------

