Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Linux on the IBM ThinkPad R51 (and compatible models)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Mon Aug 02, 2004 11:55 am    Post subject: HOWTO: Linux on the IBM ThinkPad R51 (and compatible models) Reply with quote

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. :) 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:

Code:
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:

Code:
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.

Code:
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.

Code:
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:

Code:
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.

Code:
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):

Code:
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:

Code:
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. :)

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.

Code:
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).

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


Now download the ebuild and install it.

Code:
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

Code:
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:

Code:
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.

Code:
emerge ifplugd


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

Code:
INTERFACES="eth0"
AUTO="yes"


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

Code:
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.

Code:
/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.

Code:
echo ipw2100 >> /etc/hotplug/blacklist


Once you are done, make ifplugd start by default.

Code:
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. :)

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.

Code:
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:

Code:
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.

Code:
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:

Code:
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/:

Code:
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
Back to top
View user's profile Send private message
scott_b
n00b
n00b


Joined: 28 Jun 2004
Posts: 19

PostPosted: Mon Aug 02, 2004 2:05 pm    Post subject: Reply with quote

wonderful. you just answered a ton of my questions.

thanks a lot.
Back to top
View user's profile Send private message
schmobag
Tux's lil' helper
Tux's lil' helper


Joined: 17 Feb 2004
Posts: 91
Location: Los Angeles

PostPosted: Mon Aug 02, 2004 3:01 pm    Post subject: same thinkpad, but different Reply with quote

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.
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Mon Aug 02, 2004 4:29 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6420
Location: Blighty

PostPosted: Mon Aug 02, 2004 4:32 pm    Post subject: Reply with quote

wireless-config isn't in portage - you need todo a manual install
Click link in my siggy for instructions :)
_________________
Use dhcpcd for all your automated network configuration needs
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Mon Aug 02, 2004 4:35 pm    Post subject: Reply with quote

UberLord, I've taken the freedom to copy your installation guide to my howto :)
Back to top
View user's profile Send private message
schmobag
Tux's lil' helper
Tux's lil' helper


Joined: 17 Feb 2004
Posts: 91
Location: Los Angeles

PostPosted: Mon Aug 02, 2004 5:28 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Mon Aug 02, 2004 5:31 pm    Post subject: Reply with quote

I don't know about the lockups with APM, since I have not really used it. No lockups in ACPI though.
Back to top
View user's profile Send private message
scott_b
n00b
n00b


Joined: 28 Jun 2004
Posts: 19

PostPosted: Wed Aug 04, 2004 3:52 am    Post subject: Standby irritations Reply with quote

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.?
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Wed Aug 04, 2004 5:55 am    Post subject: Reply with quote

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

Code:
   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

Code:
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:

Code:

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.
Back to top
View user's profile Send private message
PMT
Apprentice
Apprentice


Joined: 19 Jan 2004
Posts: 212

PostPosted: Wed Aug 04, 2004 7:29 am    Post subject: Reply with quote

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?
_________________
moo
Back to top
View user's profile Send private message
sburnett
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jun 2002
Posts: 79
Location: USA

PostPosted: Wed Aug 04, 2004 3:15 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
schmobag
Tux's lil' helper
Tux's lil' helper


Joined: 17 Feb 2004
Posts: 91
Location: Los Angeles

PostPosted: Wed Aug 04, 2004 3:20 pm    Post subject: same keyboard problem Reply with quote

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.
Back to top
View user's profile Send private message
PMT
Apprentice
Apprentice


Joined: 19 Jan 2004
Posts: 212

PostPosted: Wed Aug 04, 2004 4:53 pm    Post subject: Reply with quote

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.
_________________
moo
Back to top
View user's profile Send private message
scott_b
n00b
n00b


Joined: 28 Jun 2004
Posts: 19

PostPosted: Thu Aug 05, 2004 1:13 am    Post subject: Reply with quote

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):

Code:
   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

Code:
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:

Code:

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.


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?
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Thu Aug 05, 2004 4:51 am    Post subject: Reply with quote

The line

Code:
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

Code:
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

Code:
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.

Code:
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:

Code:
modprobe ehci-hcd
Back to top
View user's profile Send private message
scott_b
n00b
n00b


Joined: 28 Jun 2004
Posts: 19

PostPosted: Thu Aug 05, 2004 2:23 pm    Post subject: getting warmer Reply with quote

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?
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Thu Aug 05, 2004 2:35 pm    Post subject: Reply with quote

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.)
Back to top
View user's profile Send private message
objectswitch
n00b
n00b


Joined: 17 Jun 2004
Posts: 11

PostPosted: Thu Aug 05, 2004 7:21 pm    Post subject: ifplugd not starting wireless if no eth0 Reply with quote

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
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Thu Aug 05, 2004 8:04 pm    Post subject: Reply with quote

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

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

Code:
/usr/sbin/ifplugd.action eth0 down


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

To install the patch do:

Code:
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.
Back to top
View user's profile Send private message
objectswitch
n00b
n00b


Joined: 17 Jun 2004
Posts: 11

PostPosted: Thu Aug 05, 2004 10:37 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Fri Aug 06, 2004 11:20 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
chk
n00b
n00b


Joined: 08 Feb 2003
Posts: 15

PostPosted: Sun Aug 08, 2004 11:36 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
nomad-
n00b
n00b


Joined: 02 Aug 2004
Posts: 13

PostPosted: Sun Aug 08, 2004 12:15 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
scott_b
n00b
n00b


Joined: 28 Jun 2004
Posts: 19

PostPosted: Wed Aug 11, 2004 3:39 am    Post subject: nvram? Reply with quote

how do i get /dev/nvram support?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4, 5, 6  Next
Page 1 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum