Download a fresh kernel from www.kernel.org. You need to make sure you get a full kernel. Find the "latest stable version of the Linux kernel" and click on F for FULL. Wait patiently. A bzipped kernel is about 26M. If you're feeling particularly geeky you could also wget http://kernel.org/pub/linux/kernel/v2.4/linux-<version>.tar.bz2.
![]() | You may or may not want the latest stable version. For more information read the Section 6.1 section of this document. If you decide to use a version of the kernel that is not published on the front page, use the /pub/linux/kernel directory on the kernel.org site to find the kernel you'd like. |
While you're waiting, grab a copy of the patch as well. For the 2.4.20 kernel use the 2.4.20 patch. It's dated 2002.12.12. You'll need to know that number later when we check to make sure the patch worked. If you are using a different kernel version make sure you take note of the date of your patch. Your numbers will differ slightly from the one I use later on.
Once you've got those two files (the kernel and the patch) unpack them and patch the kernel.
First we're going to set the stage to patch the kernel. We need to unpack the bz2 file (bzip2) and shuffle the directories around a bit. /usr/src/linux probably points to your current kernel. We need it to point to the new kernel, so we'll do that as well.
cd /usr/src
mkdir kernel-source-<version> (use an alternate name if you already have a version of this kernel installed)
cp linux.<version>.tar.bz2 /usr/src/kernel-source-<version>
cd /usr/src/kernel-source-<version>
tar xjfv linux.<version>.tar.bz2
mv linux.<version> /usr/src/linux-<version>
rm linux (assuming that's a link to your old kernel)
ln -s /usr/src/linux-<version> linux
Now we're going to actually patch the kernel. I take one extra step from the instructions at ACPI4Linux. Instead of gunzipping and patching in the same line, I use two lines. This is purely a matter of preference. When you patch the kernel you want to make sure there are no error messages. (There is no "yay" line, instead look for the absence of errors.)
cd /usr/src/linux
cp acpi-20021212-2.4.20.diff.gz /usr/src/linux/. (Your patch filename will be different if you're not using the 2.4.20 kernel.)
gunzip acpi-20021212-2.4.20.diff.gz
patch -p1 < acpi-20021212-2.4.20.diff (this is the actual patching part)