s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
6. Patching the kernel
6.1 Applying a patch
Incremental upgrades of the kernel are distributed as patches. For
example, if you have version 1.1.45, and you notice that there's a
`
So, continuing with the example above, let's suppose that
you have ` find . -name '*.rej' -printprints all files who live in the current directory or any subdirectories with a .rej extension to the standard output.
If everything went right, do a `
There are quite a few options to the
6.2 If something goes wrong
(Note: this section refers mostly to quite old kernels)
The most frequent problem that used to arise was when a patch modified
a file called ` patch -p0 < config.in.rejand if it reports that it succeeded (no fails), then you can continue on with a configuration and compilation. The config.in.rej file will remain, but you can get
delete it.
If you encounter further problems, you might have installed a patch out
of order. If patch says `
To back out (unapply) a patch, use `
The best thing to do when patches really turn out wrong is to start over
again with a clean, out-of-the-box source tree (for example, from one
of the
6.3 Getting rid of the .orig files
After just a few patches, the find . -name '*.orig' -exec rm -f {} ';'will take care of it for you. Versions of patch which use
# for rejects use a tilde instead of .orig .
There are better ways to get rid of the find . -name '*.orig' | xargs rmor the ``quite secure but a little more verbose'' method: find . -name '*.orig' -print0 | xargs --null rm --
6.4 Other patches
There are other patches (I'll call them ``nonstandard'') than the ones Linus distributes. If you apply these, Linus' patches may not work correctly and you'll have to either back them out, fix the source or the patch, install a new source tree, or a combination of the above. This can become very frustrating, so if you do not want to modify the source (with the possibility of a very bad outcome), back out the nonstandard patches before applying Linus', or just install a new tree. Then, you can see if the nonstandard patches still work. If they don't, you are either stuck with an old kernel, playing with the patch or source to get it to work, or waiting (possibly begging) for a new version of the patch to come out.
How common are the patches not in the standard distribution? You will probably hear of them. I used to use the noblink patch for my virtual consoles because I hate blinking cursors (This patch is (or at least was) frequently updated for new kernel releases.). With most newer device drivers being developed as loadable modules, though, the frequecy of ``nonstandard'' patches is decreasing significantly.
Next Previous Contents |