To compile your own kernel, follow these steps:

Prepare the sources

tar -cjf linux-2.6.x.tar.bz2

cd linux-2.6.x

bzcat ../tuxonice-3.x-for-linux-2.6.x.patch.bz2 | patch -p1 -b

You should see something like:

nigel@nigel:/usr/src/check$ bzcat ../tuxonice-3.0-rc2-for-2.6.24-rc3.patch.bz2 | patch -p1 -b
patching file Documentation/kernel-parameters.txt
patching file Documentation/power/TuxOnIce-Changelog.txt
patching file Documentation/power/TuxOnIce-internals.txt
patching file Documentation/power/TuxOnIce.txt
patching file MAINTAINERS
...

If you see any messages saying parts Failed to apply, don't continue. Instead, check that you have the right patch for your kernel version.

Configure the kernel

Next, we need to configure the kernel. How you configure the kernel will depend on the hardware you have, so you'll want to first examine the output of commands like lspci and lsusb to get the gory details.

Having done that, you'll run one of the kernel configuration utilities:

make xconfig
make menuconfig
make config

These utilities have varying requirements themselves. Xconfig runs in X. Menuconfig uses an ncurses interface. Make config provides asks each option in turn; it's not recommended for an initial configuration.

Once you've made your configuration, be sure to back it up somewhere. You'll probably make some modifications over time (eg for new hardware), and doing this more than once is painful!

Key things to remember while doing your configuration: - Where possible, build things as modules, unless they're required for getting the kernel to boot. In other words, don't compile your hard drive support as modules! The reason for doing this is that some drivers lack power management support at the moment, and may need to be unloaded while you're suspending to disk to work around those issues. - TuxOnIce is found in the Power Management section. It won't hurt to select both the swap allocator and file allocator if you aren't sure which you'll need. You might also want to enable the power management debugging option (PM_DEBUG); this will enable support for debugging that you may want if you run into trouble with a driver later. - The more options you select, the longer the kernel will take to compile. If you have a fast computer, you might not care about selecting things you won't use, but if your computer is slower, this could be a concern.

Build the kernel and modules

Having configured the kernel, you next want to build it.

make

That was easy. All going well, it should build without problems. If you do have a compilation failure that looks like it's related to TuxOnIce, please report it to the lists. (See http://tuxonice.net for the mailing list info.

Install the kernel

The last step is installing the kernel.

First, the modules:

make modules_install

Then the kernel:

What to do here depends on your bootloader. Here are instructions for:

Back

None: Compile your own kernel. (last edited 2007-11-28 01:59:07 by NigelCunningham)