Gentoo Logo
Gentoo Logo Side

Gentoo Linux 2004.0 IBM Thinkpad A31

Contents:

1. Hardware problem

UPDATE: I stopped using this machine and updated these note a last time. Have a look at my IBM Z61p notes instead... yummy ; ) After a bicycle crash the TFT was replaced. However, after 1 year the machine started going into a state where the screen showed horizontal garbled stuff and in console or at boot time blinking red blocks. On www.thinkwiki.org I found that this is a common problem with these models and probably due to a bad contact on the ATI graphics card. Meddling with the powersupply connector affected the behavior. Taking the batteries + powersupply out for 15 or more minutes and sometimes inserting or taking out the PCMCIA USB card brought the system into usual state. Then after few days it would reappear. Often during operation the network card would stop functioning and after reboot the system would be in this borked state. Also it would happen when I resumed from APM suspend to RAM or when the batteries would run out and the system would shut down.

2. Introduction

Code listing 2.1

	  14-06-04: switched to xorg and updated some ACPI info.
	  04-07-04: moved system and software tricks to separate page.
	

Ofcourse I did a stage1 install (i.e. build your system from scratch). I'm pretty sure I'm not fooling myself when I say this machine runs noticably faster and snappier than ever before. Factors are probably

  • Kernel 2.6
  • Gentoo default install = compile everyting tailored to your PC
  • Bootstrapped system: optimize compiler first before compiling system and software.
  • Prelink applications = prevent dynamic loading of libs for much used apps.
  • Cutting edge packages which are not flaky.

Enough advertisment. Problems which drove me crazy are: (1) Radeon 3D acceration [solved] (2) APM suspend [solved] (3) USB stick [solved, turned out to be a fried stick from the start].

3. Hardware Specifications

Machine type: IBM - A31 2652-M5G

Code listing 3.1

	  # some bios info
	  BIOS: 1.05 (1GET33WW)
	  2002-11-28
	  Embedded Controller 1.01
	  CPU Type Mobile Intel Pentium 4-M
	  CPU Speed 1.8 GHz
	  Memory 512 M
	  # output of lspci
	  00:00.0 Host bridge: Intel Corp. 82845 845 (Brookdale) Chipset Host Bridge (rev 04)
	  00:01.0 PCI bridge: Intel Corp. 82845 845 (Brookdale) Chipset AGP Bridge (rev 04)
	  00:1d.0 USB Controller: Intel Corp. 82801CA/CAM USB (Hub #1) (rev 02)
	  00:1d.1 USB Controller: Intel Corp. 82801CA/CAM USB (Hub #2) (rev 02)
	  00:1d.2 USB Controller: Intel Corp. 82801CA/CAM USB (Hub #3) (rev 02)
	  00:1e.0 PCI bridge: Intel Corp. 82801BAM/CAM PCI Bridge (rev 42)
	  00:1f.0 ISA bridge: Intel Corp. 82801CAM ISA Bridge (LPC) (rev 02)
	  00:1f.1 IDE interface: Intel Corp. 82801CAM IDE U100 (rev 02)
	  00:1f.3 SMBus: Intel Corp. 82801CA/CAM SMBus Controller (rev 02)
	  00:1f.5 Multimedia audio controller: Intel Corp. 82801CA/CAM AC'97 Audio Controller (rev 02)
	  00:1f.6 Modem: Intel Corp. 82801CA/CAM AC'97 Modem Controller (rev 02)
	  01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500]
	  02:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
	  02:00.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
	  02:02.0 Network controller: Intersil Corporation Prism 2.5 Wavelan chipset (rev 01)
	  02:08.0 Ethernet controller: Intel Corp. 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller (rev 42)
	  # AGP Chipset
	  82845 845 Brookdale Chipset AGP Bridge (rev 4)
	  with ICH I/O Controller Hub
	  # Grapics card
	  Radeon 7500 LW (Mobility M7) (rev0)
	  # Sound card
	  Intel i810
	  # Ethernet Intel pro network card
	  82801CAM (ich3) pro/100 VE (LOM) Ethernet Controller (rev66)
	  # WLAN Ethernet
	  0000:02:02.0 Network controller: Intersil Corporation Prism 2.5 Wavelan chipset (rev 01)
	  Subsystem: Actiontec Electronics Inc: Unknown device 0406
	  Flags: bus master, medium devsel, latency 64, IRQ 11
	  Memory at f8000000 (32-bit, prefetchable)
	  Capabilities: [dc] Power Management version 2
	  ???Harris Semicond. Prism 2.5 Wavelan chipset (rev1)
	  # ISA bridge
	  Probably only needed for the PCMCIA Cardbus???
	

4. Disk Layout

/dev/hda3 missing because I deleted this partition when /dev/hda4 was already there.

Code listing 4.1

	  Part    Type   Filesys Size OS
	  /dev/hda1 primary ntfs  10 GB winxp # Still can't do without ...
	  /dev/hda2 extended
	  /dev/hda5 logical linux 10 GB /home
	  /dev/hda6 logical linux 15 GB /
	  /dev/hda7 logical swap   1 GB swap
	  /dev/hda4 primary fat32  1 GB hidden #winxp restore partition # sucks, no winxp cd
	

5. Powermanagement - General

The excellent Gentoo Laptop Powermanagement docs make you (1) try APM first (2) beware of ACPI... So I use APM as good as possible and didn't try ACPI yet. Kernel configuration:

Code listing 5.1

	  [*] Power Management support
	  [ ] Software Suspend (EXPERIMENTAL)
	  [ ] Suspend-to-Disk Support
	  ACPI (Advanced Configuration and Power Interface) Support --->
	  APM (Advanced Power Management) BIOS Support --->
	  CPU Frequency scaling --->
	

6. CPU frequency scaling (Intel Speedstep) [partially solved]

laptop-mode-tools Applying laptop-mode-tools-1.11-cpu-governor.patch ... cpufreq-set -g convervative Error setting new values. Common errors: - Do you have proper administration rights? (super-user?) - Is the governor you requested available and modprobed? - Trying to set an invalid policy? - Trying to set a specific frequency, but userspace governor is not available, for example because of hardware which cannot be set to a specific frequency or because the userspace governor isn't loaded?

The Brookdale chip has the ICH3 I/O controller hub (requires some searching...). Kernel config:

Code listing 6.1

	  [*] CPU Frequency scaling
	  < > /proc/cpufreq interface (deprecated)
	  Default CPUFreq governor (userspace)--->
	  <*> 'performance' governor
	  <*> 'powersave' governor
	  --- 'userspace' governor for userspace frequency scaling
	  [ ] /proc/sys/cpu/ interface (2.4. / OLD)
	  <*> CPU frequency table helpers
	  --- CPUFreq processor drivers
	  < > AMD Mobile K6-2/K6-3 PowerNow!
	  < > AMD Mobile Athlon/Duron PowerNow!
	  < > AMD Opteron/Athlon64 PowerNow!
	  < > Cyrix MediaGX/NatSemi Geode Suspend Modulation
	  < > Intel Enhanced SpeedStep
	  <*> Intel Speedstep on ICH-M chipsets (ioport interface)
	  < > Intel SpeedStep on 440BX/ZX/MX chipsets (SMI interface)
	  < > Intel Pentium 4 clock modulation
	  < > Transmeta LongRun
	  < > VIA Cyrix III Longhaul
	

I emerged deamons cpufreq, cpudyn. CPUFreqd does not support using percentage frequencies on 2.6 kernels where sysfs is used instead. So I checked in my .config: # CONFIG_SYSV_FS is not set Strangely starting cpufreqd failed unless I configured (below) only absolute frequencies instead of percentages.

Warning: I didn't get automatic frequency stepping using cpufreq and cpudyn to work properly (worked at 1.2 Ghz for a week without noticing it... => Gentoo : ) ). Switching frequencies by hand (see Gentoo powermanagement HOWTO) works fine, but automatic stuff doesn't work properly here yet. I should try speedfreq deamon out later.

From Michael LeMay: Pentium 4-M 1.8GHz laptop, a vpr Matrix 110-185A5. I just upgraded to kernel 2.6.9, and tried out the "ondemand" cpufreq governor. It works automatically! It normally keeps my processor at 1.2GHz, but flips it up to 1.8GHz very soon after I start an intensive app.

Configuration files: /etc/cpufreqd.conf /etc/conf.d/cpudyn /etc/conf.d/speedfreq THIS ONE IS NOT IN USE

7. Disk spin-down / sleep [unsolved]

This is controlled by cpudyn also, see its configuration file above. In my case, I couldn't get/notice the disk to spin-down. Once had some strange behaviour (noise of disk) so I turned it off.

Important: To make this work one seems to have to ensure that deamons don't write to disc that often (otherwise disks never spin down) syslog-ng, vixie-cron, I am not sure if this advisable or not.

8. APM [solved]

APM info seems accessible (e.g. KDE KLaptop gives info) cat /proc/apm 1.16ac 1.2 0x03 0x01 0x00 0x01 100% -1 ? It should work since Suse 8.1 worked flawlessly with APM suspend (never hung up) Kernel config:

Code listing 8.1

	  <*> APM (Advanced Power Management) BIOS support
	  [ ] Ignore USER SUSPEND
	  [*] Enable PM at boot time
	  [*] Make CPU Idle calls when idle
	  [ ] Enable console blanking using APM
	  [ ] RTC stores time in GMT
	  [*] Allow interrupts during APM BIOS calls
	  [ ] Use real mode APM BIOS call to power off
	

PROBLEM: apmd init script doesn't start. Output from /etc/init.d/apmd start

Code listing 8.2

	  * Starting apmd...
	  /usr/sbin/apmd: unrecognized option `--proxy-timeout'
	  usage: apmd [-c seconds] [-P apmd_proxy] [-p percent] [-qVvW] [-w percen[ !! ]
	

This option comes from /etc/conf.d/apmd file:

Code listing 8.3

	  # Config file for /etc/init.d/apmd
	  APMD_OPTS="-P /etc/apm/apmd_proxy --proxy-timeout 30"
	

These options fed into /etc/init.d/apmd startup script containing line --startas /usr/sbin/apmd -- ${APMD_OPTS} However, from man apmd_proxy one finds there is no such option....

SOLUTION I just commented this line out and apm can start. Next up is....

Note: PROBLEM [SOLVED]: I was stuck with the problem that the Keyboard becomes unusable after suspend, both within X or in runlevel 3 and suspending from console. * Bootparameter noapic doesn't solve it. * Kernel config option CONFIG_APM_ALLOW_INTS==y doesn't help either I now run kernel gentoo-dev-sources-2.6.8-rc3 and suspend to RAM works (like before with Suse8.1). Both from console apm -s and using button and within X(org). I guess kernel 2.6 APM is now okay. Need to see how it holds out but looks good.

Boot options that I tried, in order to find out what may cause APM suspend to hang the machine:

  • acpi=off No acpi in kernel anyway...
  • nomce Already out of kernel since it doesn't affect performance. MCE=Machine Check Exception allows the processor to notify the kernel if it detects a problem (e.g. overheating, component failure). The action the kernel takes depends on the severity of the problem.
  • noapic APIC=Advanced Programmable Interrupt Controller is an integrated interrupt controller in the CPU. The local APIC supports CPU-generated self-interrupts (timer, performance counters), and the NMI watchdog which detects hard lockups.

Note: I still don't know what is the problem with APM suspend on this machine. See also APM section.

9. ACPI [unsolved]

As far as I understand a disturbing thing about ACPI (Advanced Configuration and Power Interface) is that manufacturers get away with buggy ACPI bioses because they use a Microsoft-compiler which doesn't stick to specifications... Read about it on http://acpi.sourceforge.net/. I will try out ACPI when I have found enough indications that it works with A31 and/or is better than APM.

The ACPI Specification defines the requirements for the DSDT (and everything else, for that matter) pretty explicitly. Intel's ASL compiler, iasl, used to compile the DSDT to AML from ASL, will throw errors and warnings if the underlying ASL is buggy. Unfortunately, Microsoft's ASL compiler allows many of these errors and warnings to sneak by. As a result, many OEMs write buggy DSDTs, and it turns out that Windows is very forgiving of bugs in the DSDT that get by Microsoft's compiler (not surprisingly).

For now, here is some information I gathered: ACPI in kernel configuration overrides APM (they can't work together). ACPI doesn't work with A31 at all at moment. The IBM A31 has indeed a MS-compiled DSDT. From From http://acpi.sourceforge.net:

Note: DSDT = Differentiated System Description Table. This table contains the Differentiated Definition Block, which supplies the information and configuration information about the base system. It is always inserted into the ACPI Namespace by the OS at boot time. Unfortunately, many hardware vendors and OEMs are not capable of supplying fully functional tables.

Here is some info on the original DSDT and the updated one (both from IBM) from http://acpi.sourceforge.net/dsdt/view.php

Code listing 9.1

	  # Original BIOS
	  Last Modified 2004-02-09 05:48 by x545 S4 Bios  	yes
	  Original 	yes	          SMP          	no
	  Bios Revision 	1.06 1GET34WW 	APIC Table 	no
	  Board Revision 	1GET41XXWW 	Boot Table 	no
	  DSDT Vendor 	IBM 	          C2 Latency 	0
	  DSDT Product 	A31 	          C3 Latency 	0
	  DSDT Revision 	2 	          Dutywidth 	0
	  Interpreter Fix
	  Features 	S1 S2 S3 S5
	  Supersedes 	none 	          Superseded By IBM A31 2652-M5G (next)

	  # Updated BIOS
	  http://acpi.sourceforge.net/dsdt/view.php?id=150
	  DSDT
	  IBM A31 2652-M5G
	  Last Modified 	2004-02-09 05:46 by x545 S4 Bios 	yes
	  Original 	yes	               SMP 	no
	  Bios Revision 	1.08 1GET34WW 	     APIC Table 	yes
	  Board Revision 	1GET41XXWW 	     Boot Table 	yes
	  DSDT Vendor 		               C2 Latency 	0
	  DSDT Product 	A31 	               C3 Latency 	0
	  DSDT Revision 	3 	               Dutywidth 	0
	  Interpreter Fix
	  Features 	S1 S2 S3 S4(bios) S5
	  Supersedes 	IBM A31 2652-M5G 	     Superseded By none
	

10. Ab-initio Gentoo Optimization

Configuration files: /etc/make.conf

Probably not the best choice (see below) but still. For my USE flags check my complete /etc/make.conf with comments explaining selections.

Code listing 10.1: Some lines from /etc/make.conf

	  CFLAGS="-O3 -march=pentium4 -pipe -funroll-loops -fomit-frame-pointer"
	  MAKEOPTS="-j2"
	  VIDEO_CARDS="radeon"
	  ALSA_CARDS="intel8x0"
	

I wanted some moderate compile options (CFLAGS), no to conservative (need4speed) and not to daring (need2work). See the usefull overview of gcc optimizations from gcc . Here are the ones I considered.

  • -O2 nearly all supported optimizations that do not involve a space-speed tradeoff
  • - O3 all optimizations specified by -O2 and also turns on the -finline-functions and -frename-registers option.
  • -frename-registers Attempt to avoid false dependencies in scheduled code by making use of registers left over after register allocation. This optimization will most benefit processors with lots of registers. It can, however, make debugging impossible, since variables will no longer stay in a "home register".
  • -finline-functions Integrate all simple functions into their callers. The compiler heuristically decides which functions are simple enough to be worth integrating in this way. If all calls to a given function are integrated, and the function is declared static, then the function is normally not output as assembler code in its own right.
  • -march= pentium4 Some people had problems with this but here all fine up2now
  • -pipe Established tweak
  • -funroll-loops Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop.
  • -funroll-loops implies both -fstrength-reduce and -frerun-cse-after-loop. This option makes code larger, and may or may not make it run faster.

Below some snippets from the nice guide by http://www.freehackers.org.

Note: Pentium 4 (Intel) CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer" CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer" The first thing you want to test are the following flags (don't forget to add -pipe -O3 -march=XXX -fomit-frame-pointer, which is the bare minimum) -fprefetch-loop-arrays -ffast-math -fforce-addr (-fforce-mem is implied by -O3) -falign-functions=4 -funroll-loops ( bigger exe, maybe faster, usually not worth it, I don't use it) The following flags have been reported to work with gentoo 1.4 (gcc-3.2). The CHOST is unrelated to compiler flags, you should use the exact same one as found on the safe flags page note : -fstrict-aliasing -fexpensive-optimizations -force-mem -frerun-loop-opt -frerun-cse-after-loop are implied by -O3, see the FAQ.

11. Kernel Configuration

Kernel 2.6.5 configuration file: /usr/src/linux/.config /etc/modules.autoload.d/kernel-2.6 Some points which I overlooked at first:

  • devfs compile it in otherwise you get error @ bootup (see )

Kernel options I still want to understand and check out

  • GMT timer in bios? Only one type of clock in BIOS, so what does kernel setting mean?
  • Graphics support / Framebuffer device .... actually I like the speed at which Gentoo flashes console messages during boot.... Some warn not to turn on radeon specific options?
  • CONFIG_BLK_DEV_IDESCSI. Does USB stick needs this? Don't think so but..
  • Supermount (pseudo filesystems)

12. Bootloader Configuration - GRUB

Nothing to it, just follow installation manual.

Here is some info on how to access the IBM windows restore partition using GRUB bootloader. I did'nt use it though. If this laptop was mine I'd ditch it right away.

13. Basic Xorg Configuration

I switched to the x-org X-windows server which is probably the future since xfree86 changed it's licence in not-so-free direction. Smooth transition with little downtime and complete backup possibilities: Build a package from the current running XFree: quickpgk xfree Build x-org without dependencies (or else ???): emerge --nodeps --buildpkgonly xorg-x11 Ditch Xfree: emerge unmerge xfree or even better:Removes all matching packages. emerge -C xfree Install X-org emerge --usepkg xorg-x11 Then env-update && source /etc/profile Then I merged most of my XFConfig into xorg.conf. Main change is font paths. Everything worked fine without any problems. Direct rendering is definitely smoother and fps gone up by say 5-10%. To prevent conflicts ??? /etc/portage/package.keywords das da: Code: x11-base/xorg-x11 ~x86 x11-terms/xterm ~x86 sys-apps/utempter ~x86 in /etc/portage/package.mask Code: >=x11-base/xfree-4.3.0 /etc/fonts/fonts.config anpassen muss, da die Schriften jetzt in /usr/share/fonts Due to inconsistencies in xorg-x11 vs xfree handling of glext.h a userspace * is necessary for you to use opengl-update-1.8; Please do the following * mv /usr/X11R6/include/GL/glext.h /usr/lib/opengl/xorg-x11/include * You may then remerge opengl-update-1.8 successfully It's easy: emerge --nodeps --buildpkg xorg-x11

14. Basic XFree86 Configuration

Configuration file: /etc/X11/XF86Config

Monitor refresh rates: found these in some posted XF86Config file... There is no online specs for the A31 oddly enough...

Warning: As always, these settings may kill a monitor with lesser capabilities!

Code listing 14.1

	  Identifier      "Generic Monitor"
	  HorizSync       31.5-90
	  VertRefresh     55-65
	  Option          "DPMS"
	

Configure 5 mouse buttons. The usual tricks: First, change config:

Code listing 14.2

	  Option "Protocol"     "IMPS/2"
	  Option "Buttons"      "7"
	  Option "ZAxisMapping" "6 7"
	

This interchanges mousewheel functions 4,5 and extra buttons 6,7 but buttons now work!

Next we reverse this back by putting the following line

Code listing 14.3

	  /usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"
	

in a a file which is executable by the windowmanager at startup. For the moment I put it in a file ~/.kde3.2/Autostart/mousebuttons.

Note: How do I put this in a system wide file which is executed by every windowmanager? Doesn't work with /etc/X11/xinit/.Xmodmap (exectuted by /etc/X11/xinit/xinitrc) nor /etc/X11/Sessions/kde-3.21.

15. 2D accelerated X-windows - Video playback and Video-Out

Kernel config:

Code listing 15.1

	  <M> Video For Linux
	  Video For Linux--->
	  Radio Adapters--->
	  Digital Video Broadcasting Devices--->
	

DVD and video plays smooooth with xine and ogle.

Important: Multiple screens: with some beamers there is a resolution maching problem which can make you nervous at important occations : (. Some of the top and bottom of the screen get cut off, even when I exactly match resolution of the beamer. Silly enough I found this problem is (almost) solved when I switch using the function buttons (Fn + TV button) to no output on LCD + output to external output. I have the feeling 2D stuff can be tweaked some more.

16. 3D accelerated X-windows and Why ATI should get it's *!(*#! act together

LAST UPDATE: 3D is running fine now using DRI drivers, the card (due to its 64MB memory) is not capable of 3D @ 32bpp @ 1400x1040 resolution. Switching to lower resolution of 16bpp it works.

Like my previous Radeon I found ATI drivers are still a nightmare at least for models prior to radeon 8500. Nvidia drivers for linux are such a breeze to install. Anyway...I fixed it after several hurdles. Ofcourse I followed the documentation.

Important: I use a 2.6 kernel so all DRI drivers are up to date in kernel sources. No need to get the special packages as for 2.4 kernels.

DRI fails to load at 32bpp color depth because memory (64Mb) is to small for this. At lower res or 16bpp it works. But 17MB should be available...?

Code listing 16.1

	  (EE) RADEON(0): Static buffer allocation failed.  Disabling DRI.
	  (EE) RADEON(0): At least 17325 kB of video memory needed at this resolution and depth.
	

THE PROBLEM Running glxinfo in X indicates that all the GLX extensions etc are there but it says:

Code listing 16.2

	  Direct Rendering: no
	

SOLUTION: I found many tips (some contradictory!) for solving this particular problem but in my case the essential point was to not to build the radeon driver into the kernel.

Important: If the radeon module gets loaded before the agpgart driver you get the error messages from dmesg mentioned below. The agp drivers (either as modules or in kernel) have to be preloaded!

I ran opengl-update xfree only once the first time (makes appropriate links to libraries) In all my efforts I rebooted into new kernel. Now dmesg output seems ok before I run X as user. Once X is running, then glxinfo indicates no direct rendering and dmesg shows

Code listing 16.3

	  [drm:radeon_cp_init] *ERROR* radeon_cp_init called without lock held
	

I tried alot to get rid of this, but alot of googlin' made clear that you have to make sure agpgart (and the chipset specific AGP module with a 2.6 kernel) is loaded before the radeon DRM. So much for high-tech... I checked the whole matrix of possibilities for drivers agpgart agp_intel radeon

  • all in kernel = NO
  • agpgart agp_intel module + radeon kernel = NO
  • all as modules = YES
  • radeon module + agpgart agp_intel kernel = YES

Important: The intel agp driver can only be built as a module (why?). Added to /etc/modules.autoload.d/kernel-2.6

Code listing 16.4

	  agpgart   # only if you don't compile this into kernel
	  intel_agp # only if you don't compile this into kernel
	  radeon    # ALWAYS A MODULE OR ELSE DRIVER GETS LOADED BEFORE AGP
	

Note: In XF86Config: What does Load "GLcore"? Are there ATI options for the hardware cursor?

Code listing 16.5

	  S3TC
	  http://forums.gentoo.org/viewtopic.php?t=154662&postdays=0&postorder=asc&highlight=s3tc+radeon&start=25
	  Code:
	  emerge -va xorg-x11

	  then ctrl+Z after "done with patching"
	  go to the mesa src dir in the xorg sources(find -iname mesa in /var/tmp/portage/xorg..)
	  Code:
	  wget http://homepage.hispeed.ch/rscheidegger/dri_experimental/mesa_dri_txc_cvs040716.diff.gz
	  gunzip mesa_dri_txc_cvs040716.diff.gz
	  patch -p0 --dry-run< mesa_dri_txc_cvs040716.diff
	  patch -p0 < mesa_dri_txc_cvs040716.diff
	  After that you can use it.
	  This means resume emerging by foregrounding application
	  fg.
	  This worked fine.
	  If you need the problematic parts also you can emerge them with this ebuild:
	  Code:
	  # Copyright 1999-2004 Gentoo Foundation
	  # Distributed under the terms of the GNU General Public License v2
	  # $Header: /var/cvsroot/gentoo-x86/x11-libs/libtxc_dxtn/libtxc_dxtn-040623.ebuild,v 1.13 2004/09/13 19:16:28 genstef Exp $

	  IUSE=""

	  MY_P=${PN}${PV}
	  S=${WORKDIR}/${PN}
	  DESCRIPTION="no"
	  SRC_URI="http://homepage.hispeed.ch/rscheidegger/dri_experimental/${MY_P}.tar.gz"
	  HOMEPAGE="http://homepage.hispeed.ch/rscheidegger/dri_experimental/s3tc_index.html"

	  DEPEND=""

	  SLOT=""
	  LICENSE="BSD"
	  KEYWORDS="~x86"

	  src_compile() {
	  emake || die "emake failed"
	  }

	  src_install() {
	  dolib.so libtxc_dxtn.so
	  }
	  From portage guide I figured out how to install this:
	  Make dir
	  /usr/local/portage/x11-libs/libtxc_dxtn
	  Have PORTAGE_OVERLAY set to /usr/local/portage in
	  /etc/make.conf
	  Save ebuild as specified in script
	  libtxc_dxtn-040623.ebuild
	   ebuild libtxc_dxtn-040623.ebuild digest
	   ebuild libtxc_dxtn-040623.ebuild unpack
	   ebuild libtxc_dxtn-040623.ebuild compile
	   ebuild libtxc_dxtn-040623.ebuild install
	   ebuild libtxc_dxtn-040623.ebuild qmerge
	  After this I got:
	  # glxinfo | grep S3
	  Mesa: software DXTn compression/decompression available
	  GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_S3_s3tc
	  ALso the driver now applies to far mor cards: intel integrated and r100/r200.
	  For more details see http://homepage.hispeed.ch/rscheidegger/dri_experimental/s3tc_index.html
	

17. Network card with cable-plugged detection

Selected i8x0 driver and worked without a hitch using DHCP. The network is usually added to the default runlevel during installation: rc-update add net.eth0 default

I noticed that when cable is unplugged many apps wait for some network stuff and all becomes slow. I enabled cable-plugged detection using ifplugd which works very fast and without a hitch. As usual, you need to get the options right: Remove the net from default runlevel rc-update add net.eth0 default Install the deamon ifplugd emerge ifplugd and the net-tools package (if not already installed) The trick with the eepro network card is to edit the config file /etc/conf.d/ifplugd and add options -a -m mii AUTO="no" -a | --auto API_MODE="mii" -m | --api-mode= This should do the trick. To test it, monitor log file, stop the net if still running and start ifplugd deamon: /etc/init.d/net.eth0 stop /etc/init.d/ifplugd start The log file should now show Link beat lost/detected messages and net goes up or down in 1 sec or so after plug/unplug.

18. USB

Had a problem wiht MS intellimouse explorer and APM sleepmode. Mouse would not revive (whereas rest of system would, X and the lot). Using Thinkpad USB mouse system would hang up. This occured when I switched to kernels > 2.6.10. Tried following: Removed EHCI support (USB 2.0)

19. USB Stick

Okay, I think I did everything right and that my USB stick was the problem from the start. It is probably broken and I'm gonna get it replaced...

Kernel config:

Code listing 19.1

	  <*> Support for Host-side USB
	  [ ] USB verbose debug messages
	  --- Miscellaneous USB options
	  [*] USB device filesystem
	  [ ] Enforce USB bandwidth allocation (EXPERIMENTAL)
	  [ ] Dynamic USB minor allocation (EXPERIMENTAL)
	  --- USB Host Controller Drivers
	  <*> EHCI HCD (USB 2.0) support
	  [ ] Full speed ISO transactions (EXPERIMENTAL)
	  < > OHCI HCD support
	  <*> UHCI HCD (most Intel and VIA) support
	  --- USB Device Class drivers
	  < > USB Audio support
	  < > USB Bluetooth TTY support
	  < > USB MIDI support
	  < > USB Modem (CDC ACM) support
	  <*> USB Printer support
	  <*> USB Mass Storage support
	  [ ] USB Mass Storage verbose debug
	  [ ] Datafab Compact Flash Reader support (EXPERIMENTAL)
	  [ ] Freecom USB/ATAPI Bridge support
	  [ ] ISD-200 USB/ATA Bridge support
	  [ ] Microtech/ZiO! CompactFlash/SmartMedia support
	  [ ] HP CD-Writer 82xx support (EXPERIMENTAL)
	  [ ] SanDisk SDDR-09 (and other SmartMedia) support (EXPERIMENTAL)
	  [ ] SanDisk SDDR-55 SmartMedia support (EXPERIMENTAL)
	  [ ] Lexar Jumpshot Compact Flash Reader (EXPERIMENTAL)
	  --- USB Human Interface Devices (HID)
	  <*> USB Human Interface Device (full HID) support
	  [*] HID input layer support
	

The stick is recognized by USB drivers. dmesg output:

Code listing 19.2

	  usb 2-1: new full speed USB device using address 6
	  usb 2-1: device not accepting address 6, error -71
	  usb 2-1: new full speed USB device using address 7
	  scsi0 : SCSI emulation for USB Mass Storage devices
	  Vendor: USB Model: Flash DiskRev: 2.00
	  Type: Direct-AccessANSI SCSI revision: 02
	  sda: Unit Not Ready, sense:
	  Current : sense = 706
	  ASC=28 ASCQ= 0
	  Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00
	  SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
	  sda: assuming Write Enabled
	  sda: assuming drive cache: write through
	  /dev/scsi/host0/bus0/target0/lun0: p1
	  Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
	  Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,type 0
	  USB Mass Storage device found at 7
	

THE PROBLEM mounting and then unmouting screws up partition table of USBstick. This happens under Windows as well! Strange behaviour: * fdisk => remove partitioins makesingle new one sda1 * mkdosfs -F 32 /dev/sda1 succesfull FAT32 system on disk * mount /mnt/usb => all fine, can copy stuff to it (or do nothing) * umount /mnt/usb * mount /mnt/usb => get error message Same problem with FAT16 In WinXP I can only format a single partition (made with fdisk) on the usbstick with FAT16 and not with FAT32 "Windows could not complete formatting" and stuff like that. Sometimes pulling out stick and re-injecting it is required to get it recognized.

Note: Supermount in kernel allows automounting but I don't know if this is still relevant?

Warning: Set mount option "noatime" to reduce wearout of your memory stick

Some snippet from an interesting article about memory sticks

Note: Now, some further elaboration of the mount command: # mount -o uid=1000,gid=1000,noatime -t vfat /dev/sda /mnt/fob/ The uid and gid mount options are those of my own login account to set file ownerships. More significant is the noatime, provided in order to eliminate unnecessary erase/write cycles. Don't forget, simply doing an ls on any directory will increment the files' atime (access time). Alert readers may be thinking: Wait, there's no atime on FAT filesystems! True. There's only a single timestamp field for each file or directory, but Linux deals with this by updating that single time value on any occasion it ordinarily would update atime, mtime or ctime. So, disabling atime still reduces the frequency of erase/write operations, even on FAT.All of those mount options can and should be put in /etc/fstab: /dev/sda /mnt/fob vfat uid=1000,gid=1000,user,noauto,noatime 0 0 One further oddity no matter what you do, the flash disk always mounts read-only: mount: block device /dev/sda is write-protected, mounting read-only This happens even if you specify rw among the mount options. However, you subsequently can enable write access after mounting the flash disk, by remounting with the rw option: # mount -o rw,remount /mnt/fob Exactly why /bin/mount insists that the flash disk is write-protected and must be mounted read-only is a genuine mystery. Although some flash disks' plastic casings reportedly sport write-protect switches, the Easy Disk's doesn't. My best guess is that mount is heeding a request from the Easy Disk's built-in controller chip, intended to minimise accidental device fatigue. And it works. As a side benefit, the read-only default seems to render harmless your unplugging of the device when, inevitably, you forget to unmount it first making it truly a hot-plug device.

20. Sound - ALSA

Code listing 20.1

	codec_write 0: semaphore is not ready for register 0x2
	codec_read 0: semaphore is not ready for register 0x2
      

find . -name '*.c' | xargs grep 'semaphore is not ready for register' ./sound/pci/intel8x0m.c: snd_printk(KERN_ERR "codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg); ./sound/pci/intel8x0m.c: snd_printk(KERN_ERR "codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg); ./sound/pci/intel8x0.c: snd_printk(KERN_ERR "codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg); ./sound/pci/intel8x0.c: snd_printk(KERN_ERR "codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);

I compiled alsa driver in kernel, so don't need alsa-driver module package. Kernel config:

Code listing 20.2

	  <*> Sound card support
	  Advanced Linux Sound Architecture--->
	  Open Sound System--->

	  <*> Advanced Linux Sound Architecture
	  <*> Sequencer support
	  < > Sequencer dummy client
	  <*> OSS Mixer API
	  <*> OSS PCM (digital audio) API
	  [*] OSS Sequencer API
	  [ ] Verbose printk
	  [ ] Debug
	  Generic devices--->
	  PCI devices--->
	  ALSA USB devices--->
	  PCMCIA devices--->

	  PCI devices--->
	  <*> Intel i8x0/MX440, SiS 7012; Ali 5455; NForce Audio; AMD768/8111
	

Note: I want to try the alsa-driver package maybe later if it promises miracles. If you use the alsa-driver module package you seem to need to recompile it after each kernel compile.

21. PCMCIA Cardbus

Note: I heard you need ISA PNP selected in your kernel for PCMCIA to work?. /etc/initd/pcmcia start seems screwed up! mkdir /mnt/pcmcia mount /dev/hde /mnt/pcmcia

22. Printing via CUPS

Installed cups and and started it with /etc/init.d/cupsd start and added it to default runlevel with rc-update add cupsd default. Network printers popped up in KDE printer utility. Easy. Later I took cups out of default runlevel keep the booting fast. I just (re)start cups @ first print job by hand using /etc/init.d/cupsd restart.

Note: I would like to have a script which starts cups the on-demand at first print job?

23. WLAN Network Card - Prism 2.5 Wavelan

A visit to a WLAN-equipped hotel convinced me to sort this out finally... Prism 2.5 Wavelan chipset (rev1) Added Hermes driver Wireless LAN( non-hamradio) ---> <M> Hermes chipset 802.11b support (Orinoco/Prism2/Symbol) x x < > Hermes in PLX9052 based PCI adaptor support (Netgear MA301 etc.) (EXPERIMENTAL) x x < > Hermes in TMD7160 based PCI adaptor support (EXPERIMENTAL) x x <M> Prism 2.5 PCI 802.11b adaptor support (EXPERIMENTAL) Added to /etc/modules.autoload.d/kernel-2.6 hermes After boot:

Code listing 23.1

	  #dmesg
	  orinoco 0.13e (David Gibson <hermes@gibson.dropbear.id.au>, Pavel Roskin <proski@gnu.org>, et al)
	      orinoco_pci 0.13e (Pavel Roskin <proski@gnu.org>, David Gibson <hermes@gibson.dropbear.id.au>  Jean Tourrilhes <jt@hpl.hp.com>)
		    PCI: Found IRQ 11 for device 0000:02:02.0
		    PCI: Sharing IRQ 11 with 0000:00:1d.2
		    PCI: Sharing IRQ 11 with 0000:00:1f.1
		    orinoco_pci: Detected Orinoco/Prism2 PCI device at 0000:02:02.0, mem:0xF8000000 to 0xF8000FFF -> 0xe0818000, irq:11
		    Reset done.........................................................................................................................................
		    .................................................................................................................;
		    Clear Reset........................................................................................................................................
		    ...................................................................................................................................................
		    ...................................................................................................................................................
		    ......................................................................;
		    pci_cor : reg = 0x0 - FFFB7773 - FFFB757F
		    eth1: Station identity 001f:0006:0001:0003
		    eth1: Looks like an Intersil firmware version 1.3.6
		    eth1: Ad-hoc demo mode supported
		    eth1: IEEE standard IBSS ad-hoc mode supported
		    eth1: WEP supported, 104-bit key
		    eth1: MAC address 00:20:E0:4D:12:67
		    eth1: Station name "Prism  I"
		    eth1: ready

		    #iwconfig
		    eth0      no wireless extensions.

		    lo        no wireless extensions.

		    eth1      IEEE 802.11-DS  ESSID:""  Nickname:"Prism  I"
		    Mode:Managed  Access Point: 00:00:00:00:00:00   Bit Rate:11 Mb/s
		    Tx-Power=15 dBm   Sensitivity:1/3
		    Retry min limit:8   RTS thr:off   Fragment thr:off
		    Encryption key:off
		    Power Management:off
		    Link Quality=0/92  Signal level=-68 dBm  Noise level=-122 dBm
		    Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
		    Tx excessive retries:0  Invalid misc:0   Missed
		    beacon:0
	

ESSID (aka wireless network name) (This sets the network name to "GentooNode") # iwconfig eth0 essid GentooNode #dmesg eth1: New link status: Connected (0001) Make a link to net device # cd /etc/init.d # ln -s net.eth0 net.eth1 # rc-update add net.eth1 default Didn't need to use a WEP or ASCII key yet. (This sets a hex WEP key) # iwconfig eth0 key 1234123412341234abcd (This sets an ASCII key - prefix it with "s:") # iwconfig eth0 key s:some-password WEP (wired equivalent privacy) is 802.11's optional encryption standard implemented in the MAC Layer that most radio network interface card (NIC) and access point vendors support. When deploying a wireless LAN, be sure to fully understand the ability of WEP to improve security. It's complicated, but here we go. If a user activates WEP, the NIC encrypts the payload (frame body and CRC) of each 802.11 frame before transmission using an RC4 stream cipher provided by RSA Security. The receiving station, such as an access point or another radio NIC, performs decryption upon arrival of the frame. As a result, 802.11 WEP only encrypts data between 802.11 stations. Once the frame enters the wired side of the network, such as between access points, WEP no longer applies. WEP is better than nothing WEP does a good job of keeping most people out,

24. Network - Fixed IP

IP, gateway: /etc/conf.d/net Name servers: /etc/resolv.conf nameserver ip



line
Updated Today
line
M. Wegewijs
Author

line
Summary:  I ditched Suse 8.1 because some stuff wasn't supported or causing me headaches (usb, dri, kde 3.0, yast etc). I also found it to sluggish to be true for a 1.8 GHz machine. When installing Gentoo.... well you..... learn alot. Gentoo documentation is excellent so I just followed that. Ample time for reading documentation while compiling from source. Below I just list some points which may ease the process for you and some specific trickery to get most of the wishtles and bells running on this laptop. DISCLAIMER: These are notes I for my own personal use, made available for your convenience. Use at your own risk.
line

Donate to support our development efforts.

line
The Gentoo Linux Store
line
php|architect

php|architect is the monthly magazine for PHP professionals, available worldwide in print and electronic format. A percentage of all the sales will be donated back into the Gentoo project.

line
Tek Alchemy

Tek Alchemy offers dedicated servers and other hosting solutions running Gentoo Linux.

line
DDR Memory at Crucial.com

Purchase RAM from Crucial.com and a percentage of your sale will go towards further Gentoo Linux development.

line
Win4Lin at NeTraverse

Win4Lin from NeTraverse lets you run Windows applications under Gentoo Linux at native speeds.

line
Copyright 2001-2003 Gentoo Technologies, Inc. Questions, Comments, Corrections? Email www@gentoo.org.