First I installed the necessary packages to build the kernel from source with
apt-get install gcc make ncurses-dev
Then I downloaded the source code of kernel 2.6.12.3 from the Linux Kernel Archives. (at first I was using 2.6.12.2, but at the time of writing I already did the small maintainance upgrade to 2.6.12.3)
After extracting the compressed tar archive and studying the ThinkWiki a bit, I also applied the trackpoint patch, a patch relevant to get powermanagement for the SATA harddisk so it plays nice with suspend-to-ram and another to make sure the infrared device is detected (both available at http://shamrock.dyndns.org/~ln/linux/). (note: the last 2 patches are attached to this page for completeness sake only, in case the current download URL vanishes)
I also decided to use Software Suspend 2 (version 2.1.9.5 for kernel 2.6.12) because I used it on various other notebooks in the past with good results.
I used the menu configuration of the kernel via
in the kernel source tree. Important settings to change are:
- in "Processor type and features" select "Pentium M" for the processor familiy to optimize for the Pentium-M
- in "Power management options (ACPI, APM)" enable ACPI (I don't use APM) and Software Suspend 2. Note: to use a newer version of the "IBM ThinkPad Laptop Extras" you have to compile it as module so it can be easily replaced later on.
- enable CPU frequency scaling, select scaling governors ("ondemand" and "conservative" are the ones I use, but be sure to also select "userspace" if you want some external program like cpufreqd to do the frequency scaling) and enabe the processor driver for Centrino ("Intel Enhanced SpeedStep")
- for the harddisk SCSI has to be enabled and in the low-level SCSI drivers section Serial ATA and "Intel PIIX/ICH SATA support" need to be selected
- to get the kernel to recognize the CD-RW/DVD-RW I also needed to enable ACPI Plug'n'Play support (and of course the ATAPI/IDE CD-ROM driver)
My currently used kernel configuration is attached at the bottom of this page. Afterwards I compilied the kernel by issuing
and after switching to the root account I installed the kernel modules, the System.map file and the kernel image with
make modules_install
cp System.map /boot/System.map-2.6.12.3
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.12.3
Then I added a new entry in the GRUB menu file in /boot/grub/menu.lst:
title Debian GNU/Linux, kernel 2.6.12.3
root (hd0,5)
kernel /boot/vmlinuz-2.6.12.3 root=/dev/sda6 ro video=vesafb,nomtrr,ywrap vga=836 acpi_sleep=s3_bios resume2=swap:/dev/sda5 processor.max_cstate=2 elevator=cfq
Note: not all of the kernel parameters are necessary, video and vga give a higher resolution in the text consoles (if the vesa framebuffer driver is compiled into the kernel), resume2 is for Software Resume 2, elevator=cfq selects a different scheduling mechanism more suitable for desktop use, acpi_sleep is needed to circumvent a problem with suspend-to-ram.
Since switching to SCSI-SATA also meant that the harddisk would be called /dev/sda after the reboot, I also changed all occurences of "/dev/hda" to "/dev/sda" in /etc/fstab.
One
later and I was running the shiny new kernel.
失败了3次了,编译和patch都没有问题,难道是分区格式?我用的ext2可能太老了,总之就是一种折磨阿
看来还要多学习。