Difference between revisions of "Installing Debian Sid (October 2005) on a ThinkPad T42"

From ThinkWiki
Jump to: navigation, search
Line 124: Line 124:
  
 
Modify /etc/acpi/actions/lm_lid.sh so that it points to /usr/sbin/hibernate when the lid is shut. The one on my system is listed below
 
Modify /etc/acpi/actions/lm_lid.sh so that it points to /usr/sbin/hibernate when the lid is shut. The one on my system is listed below
 
+
<source lang="bash">
 
         #!/bin/bash
 
         #!/bin/bash
 
         test -f /usr/sbin/laptop_mode || exit 0
 
         test -f /usr/sbin/laptop_mode || exit 0
Line 143: Line 143:
 
         #        modprobe usbhid
 
         #        modprobe usbhid
 
               chvt 7
 
               chvt 7
 
+
</source>
  
 
=== CPU Frequency scaling ===
 
=== CPU Frequency scaling ===

Revision as of 21:41, 7 February 2012

Debian netinst

Insert the Debian net installation disk (download size ~130 MB) and on bootup, the laptop should go directly to the Debian splash image prompting you for a boot parameter. If you don't see this screen, then you possibly need to change the boot device configuration in your BIOS and make the CD drive the first boot disk.

Enter expert26 to start the installation with Kernel 2.6, and it will take you through the regular Debian setup which contrary to published reports on Slashdot and SuSe forums is very intuitive and non-scary. Everything I had on this machine (lspci output below) was detected with the sole exception of the Intel Pro Wireless 2200 wireless card. It turned out later that getting wirless to work was really easy in debian.

Debian should install just fine and on first bootup, install the packages you want. X should just work with all the auto-detect options in the installer. I have a SXGA monitor and the display worked correctly from the first go. The only problem I had with the Debian installer is that at the time of my install, gnome was in transition so I couldn't immediately install the mail client of choice -> Evolution.

My configuration

Here is the lspci output from my system, a more non-cryptic description of my config is below

0000:00:00.0 Host bridge: Intel Corporation 82855PM Processor to I/O Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corporation 82855PM Processor to AGP Controller (rev 03)
0000:00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
0000:00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
0000:00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 01)
0000:00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 01)
0000:00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)
0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
0000:00:1f.6 Modem: Intel Corporation 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 M7 LW [Radeon Mobility 7500]
0000:02:00.0 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)
0000:02:00.1 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)
0000:02:01.0 Ethernet controller: Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) (rev 03)
0000:02:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)

In summary,

Intel 1.73 Pentium M (Dothan)
Intel Pro Wirless 2200
SXGA monitor (14", 1400x1050)
512 MB of RAM
Intel Gigabit Ethernet
IBM Security System
Integrated fingerprint reader
56 K modem

Getting wireless to work

Intel 2200BG wireless chipsets work right out of the box since the source is in the kernel tree since 2.6.15. You will still need to download and install the firmware for these cards. The firmware files change with the version number of the driver that is included in the kernel source. The version of the firmware may be checked by apt-getting the kernel source and viewing Documentation/networking/README.ipw2200

The ipw2200 sourceforge page at IPW-Sourceforge will have directions for you.

Check that everything works by

       $ iwlist scanning

Either eth1 or eth0 should show a list of available wirless networks (if any)

You can create your wirless preferences by modifying your /etc/network/interfaces file. I show a part of mine as reference

Network intefaces file

  mapping eth1
       map home 
       map work
       map none
  # The loopback network interface
  auto lo
  iface lo inet loopback
  # The primary network interface
  # auto eth0
  iface eth0 inet dhcp
  autho eth1
  iface eth1 inet dhcp
  iface home inet dhcp
       wireless-essid enter your wireless ID 
       wireless-key whatever your wirless key is
  iface work inet dhcp
       wireless-essid whatever your work wireleess ID
       wireless-key whatever your wireless key is
  iface none inet dhcp
       wireless-essid ANY
       wireless-key none

Getting power management to work

Power-management works with ACPI but there are issues with getting ATI Radeon cards to sleep (see below).

For power-management, apt-get install hibernate

ACPI sleep

ACPI sleep works out of the box. Just login as root and type

       $ echo mem > sys/power/state

Your laptop should go through the suspend cycle and the sleep light should come on. To resume, press the Fn key and the laptop shoud resume where you left it.

You can automate this whole operation, so that when you close the lid, the laptop should go to sleep automatically. Here's how.

Hibernate

I recommend using the suspend2 patch found on www.suspend2.net. The instructions there are quite easy to follow and after downloading the patch you can patch the kernel by executing in the kernel directory the command

       $bzcat /path/to/patch | patch -p1

Select the suspend2 configuration options in the kernel tree. Make sure LZF compression is built in in the Cryptographic routines section.

Compiling the kernel

In Debian this is easy to do using the kernel-package program. apt-get install kernel-package initramfs-tools fakeroot and in the kernel directory, you can execute

       $ make-kpkg --initrd --rootcmd fakeroot --append-to-version <system_name> --revision <2.6.x-y> --arch i386 kernel_image

and after a while the kernel .deb package is made. Make sure you have initramfs-tools installed and NOT yaird because suspend2 is not supported using yaird.

To get suspend2 to resume successfully, you will have to pass resume2=swap:/dev/hdax as a kernel parameter in /boot/grub/menu.lst

ACPI sleep drain and framebuffer problem

Thinkpad laptops with ATI radeon cards currently suffer from high ACPI sleep power drain. This is because, the radeon card doesn't shut down when the rest of the laptop goes to sleep. This is probably because the Radeon driver programmers are working in the dark due to ATI not fully releasing the specs of their card. This problem may be fixed in kernel 2.6.21 where the ACPI subsystem is rumored to be completely revamped.

Another problem is that the current implementation of the radeon power management (drivers/video/aty/radeon_pm.c) maintains a whitelist of thinkpad systems where the radeon card can be successfully shut off using a kernel parameter. However, this stopped working sometime in eary 2007 with an upgrade of the X.org server. Thus many have reported hangs as covered in [1]. For the time being, if you want to use the framebuffer, you will have to recompile your kernel with the Radeon driver built in. Pass video=radeonfb:ignore_devllist=1 as the kernel parameter in grub or lilo.

Sample kernel configuration in Grub

       title           Debian GNU/Linux, kernel 2.6.20-custom
       root            (hd0,0)
       kernel          /boot/vmlinuz-2.6.20-custom root=/dev/hda1 ro resume2=swap:/dev/hda5 video=radeonfb:ignore_devlist=1
       initrd          /boot/initrd.img-2.6.20-custom
       savedefault

ACPI sleep drain test script

You can test if your laptop suffers from the Radeon ACPI problems by running the script available at [2]. If your power drain during ACPI sleep is greather than 1W, its too much. When working correctly, power usage during ACPI sleep for most ATI cards is around 620 mW.

Enabling power management Fn keys

apt-get install acpi-support. Modify the scripts found in /etc/acpi/events to point to actions that will do the necessary function.

Enabling hibernate on closing lid

Modify /etc/acpi/actions/lm_lid.sh so that it points to /usr/sbin/hibernate when the lid is shut. The one on my system is listed below

        #!/bin/bash
        test -f /usr/sbin/laptop_mode || exit 0
        # lid button pressed/released event handler
        /usr/sbin/laptop_mode auto
        #!/bin/bash
         test -f /usr/sbin/laptop_mode || exit 0
        grep -q closed /proc/acpi/button/lid/*/state
        if [ $? = 0 ]
        then
        #        chvt 12
        #        rmmod uhci_hcd ehci_hcd usbhid
                /usr/sbin/hibernate
        else
                sleep 2
        #       modprobe uhci_hcd
        #       modprobe ehci_hcd
        #        modprobe usbhid
               chvt 7

CPU Frequency scaling

In debian this is really easy. With your default stock kernel, you can just modprobe cpufreq_userspace and speedstep_centrino and your CPU will dynamically change the frequency to conserver power. Very cool. Most of the time, my processor sits at 599 MHz. Again, add them to /etc/modules to enable them at bootup.

HDD spin down

Again in debian, this is really easy. Just apt-get laptop-mode-tools and powernowd and your HDD will spn down when idle to conserve power. Very cool.

Misc tweaks

You can use the powerplay feature of your Radeon GPU by adding the following in your /etc/X11/xorg.conf

       Section "Device"
               Identifier      "ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500]"
               Driver          "ati"
               Option          "AGPMode" "4"
               Option          "EnablePageFlip" "on"
               Option          "RenderAccel" "on"
               Option          "DynamicClocks" "on"
               Option          "ColorTiling"   "on"
               BusID           "PCI:1:0:0"
               Option          "UseFBDev"              "true"
               Option          "BIOSHotkeys"           "on"
       EndSection

Check to see if DynamicClocks, etc are working by looking at /var/log/Xorg.0.log. These features doesn't work with XFree86.

Thinkpad buttons

You can get an online display for your screen brightness and volume control by apt-getting tpb. You need to make /dev/nvram user-writable to get it work with regular user perms. Add tpb to your .xsession file to have it running when you first start X. /dev/nvram can be made user-writable by adding yourself to the nvram group. This way you don't have to do it everytime you boot up.





















index.htm map.a.html map.b.html map.c.html map.d.html map.e.html map.f.html map.g.html map.h.html map.i.html map.j.html map.k.html map.l.html map.m.html map.n.html map.o.html map.p.html map.q.html map.r.html map.s.html map.t.html map.u.html map.v.html map.w.html map.x.html map.y.html map.z.html index1.html index10.html index100.html index1000.html index1001.html index1002.html index1003.html index1004.html index1005.html index1006.html index1007.html index1008.html index1009.html index101.html index1010.html index1011.html index1012.html index1013.html index1014.html index1015.html index1025.html index1026.html index1027.html index1028.html index1029.html index103.html index1030.html index1031.html index1032.html index1033.html index1034.html index1035.html index1036.html index1044.html index1045.html index1046.html index1047.html index1048.html index1049.html index105.html index1050.html index1051.html index1052.html index1053.html index1054.html index1055.html index1056.html index1057.html index1070.html index1071.html index1072.html index1073.html index1074.html index1075.html index1076.html index1077.html index1078.html index1079.html index108.html index1080.html index1081.html index1082.html index1083.html index1092.html index1093.html index1094.html index1095.html index1096.html index1097.html index1098.html index1099.html index11.html index110.html index1100.html index1101.html index1102.html index1111.html index1112.html index1113.html index1114.html index1115.html index1116.html index1117.html index1118.html index1119.html index112.html index1120.html index1121.html index1122.html index1127.html index1128.html index1129.html index113.html index1130.html index1131.html index1132.html index1133.html index1134.html index1135.html index1136.html index1137.html index1138.html index1153.html index1154.html index1155.html index1156.html index1157.html index1158.html index1159.html index116.html index1160.html index1161.html index1169.html index117.html index1170.html index1171.html index1172.html index1173.html index1174.html index1175.html index1176.html index1177.html index1178.html index1179.html index118.html index1188.html index1189.html index119.html index1190.html index1191.html index1192.html index1193.html index1194.html index1195.html index1196.html index1197.html index1198.html index1199.html index1208.html index1209.html index121.html index1210.html index1211.html index1212.html index1213.html index1214.html index1215.html index1216.html index1217.html index1218.html index1317.html index1318.html index1319.html index132.html index1320.html index1321.html index1322.html index1323.html index1324.html index1325.html index1326.html index1327.html index1452.html index1453.html index1454.html index1455.html index1456.html index1457.html index1458.html index1459.html index146.html index1460.html index1461.html index1462.html index1463.html index1464.html index1465.html index1487.html index1488.html index1489.html index149.html index1490.html index1491.html index1492.html index1493.html index1494.html index1495.html index1496.html index1497.html index1498.html index1499.html index15.html index1500.html index1501.html index1518.html index1519.html index152.html index1520.html index1521.html index1522.html index1523.html index1524.html index1525.html index1526.html index1527.html index1528.html index1529.html index153.html index1540.html index1541.html index1542.html index1543.html index1544.html index1545.html index1546.html index1547.html index1548.html index1549.html index155.html index1550.html index1551.html index1552.html index1563.html index1564.html index1565.html index1566.html index1567.html index1568.html index1569.html index157.html index1570.html index1571.html index1572.html index1573.html index1574.html index1591.html index1592.html index1593.html index1594.html index1595.html index1596.html index1597.html index1598.html index1599.html index16.html index160.html index1600.html index1601.html index1602.html index1622.html index1623.html index1624.html index1625.html index1626.html index1627.html index1628.html index1629.html index163.html index1630.html index1631.html index1632.html index1633.html index1634.html index165.html index1650.html index1651.html index1652.html index1653.html index1654.html index1655.html index1656.html index1657.html index1658.html index1659.html index166.html index1660.html index1661.html index1662.html index1663.html index1675.html index1676.html index1677.html index1678.html index1679.html index168.html index1680.html index1681.html index1682.html index1683.html index1684.html index1685.html index1686.html index1687.html index1688.html index1689.html index169.html index1690.html index1703.html index1704.html index1705.html index1706.html index1707.html index1708.html index1709.html index171.html index1710.html index1711.html index1712.html index1713.html index1714.html index1715.html index1716.html index1729.html index173.html index1730.html index1731.html index1732.html index1733.html index1734.html index1735.html index1736.html index1737.html index1738.html index1739.html index174.html index1740.html index1741.html index1742.html index1743.html index1755.html index1756.html index1757.html index1758.html index1759.html index176.html index1760.html index1761.html index1762.html index1763.html index1764.html index1765.html index1766.html index1767.html index1778.html index1779.html index178.html index1780.html index1781.html index1782.html index1783.html index1784.html index1785.html index1786.html index1787.html index1788.html index1789.html index179.html index1790.html index1805.html index1806.html index1807.html index1808.html index1809.html index181.html index1810.html index1811.html index1812.html index1813.html index1814.html index1815.html index1816.html index1817.html index1833.html index1834.html index1835.html index1836.html index1837.html index1838.html index1839.html index184.html index1840.html index1841.html index1842.html index1843.html index1844.html index1858.html index1859.html index186.html index1860.html index1861.html index1862.html index1863.html index1864.html index1865.html index1866.html index1867.html index1868.html index1869.html index1890.html index1891.html index1892.html index1893.html index1894.html index1895.html index1896.html index1897.html index1898.html index1899.html index19.html index190.html index1900.html index2279.html index228.html index2280.html index2281.html index2282.html index2283.html index2284.html index2285.html index2286.html index2489.html index249.html index2490.html index2491.html index2492.html index2493.html index2494.html index2731.html index2732.html index2733.html index2734.html index2735.html index2736.html index2737.html index2738.html index2739.html index274.html index2740.html index2741.html index3482.html index3483.html index3484.html index3485.html index3486.html index3487.html index3488.html index3489.html index349.html index3490.html index3845.html index3846.html index3847.html index3848.html index3849.html index385.html index3850.html index3851.html index3852.html index3853.html index3854.html index4301.html index4302.html index4303.html index4304.html index4305.html index4306.html index4307.html index4308.html index4309.html index431.html index4310.html index4311.html index4312.html index4737.html index4738.html index4739.html index474.html index4740.html index4741.html index4742.html index4743.html index4744.html index4745.html index4746.html index4872.html index4873.html index4874.html index4875.html index4876.html index4877.html index4878.html index4879.html index488.html index4880.html index4881.html index4882.html index4883.html index604.html index605.html index606.html index607.html index608.html index609.html index61.html index610.html index611.html index612.html index613.html index614.html index615.html index616.html index617.html index789.html index79.html index790.html index791.html index792.html index793.html index794.html index795.html index796.html index797.html index798.html index799.html index981.html index982.html index983.html index984.html index985.html index986.html index987.html index988.html index989.html index99.html index990.html index991.html index998.html index999.html