miércoles, 9 de enero de 2008

Cómo parchear el kernel 2.6.X

Unos apuntes sobre cómo parchear el kernel de la serie 2.6.x de Linux. Siempre es bueno tener esta info a mano.Visto en Usenet

I hope somebody else here can minimise my logic; I think the verbosity isnecessary to completely explain the "patch nightmare" to everybody concerned.

I'm getting warnings about "Reversed (or previously applied) patch detected!" when I attempt to patch to an -rc, -mm or -stable kernel. How should this be done?

*Terms*

A Linus mainline "release" kernel is given an x.y.z version number (e.g. 2.6.14). A -stable kernel is given an x.y.z.a version number (e.g., 2.6.14.3).

*Patching*

New -stable or -rc patches are to be applied to Linus's mainline "release" kernels, not -stable, -rc or -mm kernel versions.

New -mm patches are to be applied either to the "release" kernel, or the applicable -rc kernel (whichever is newer), which are given an x.y.z-rcN version number (e.g. 2.6.15-rc2).

-If you are on a -stable kernel, you need to revert the -stable patch before applying either an -rc, a new -stable, or new Linus "release" patch.

-If you are on an -rc kernel, you need to revert the -rc patch if you want to apply another -rc patch, a -stable patch, or a new Linus "release" patch.

-If you are on an -mm kernel, you need to revert the -mm patch and the -rc patch (if applicable), before applying either an -rc, -stable or new Linus "release" patch.


*Patch Process*

For example, to patch to 2.6.14-rc3-mm3, when you were previously on 2.6.13.4, you would need to:

-Download the full Linux 2.6.13 "release" tarball, or reverse the 2.6.13.4 -stable patch.

tar jxvf linux-2.6.13.tar.bz2 OR bzip2 -cd ../patch-2.6.13.4.bz2 | patch -Rp1 (whilst in linux directory).

-Apply the 2.6.14-rc3 patch.

bzip2 -cd ../patch-2.6.14-rc3.bz2 | patch -Np1 (whilst in linux directory).

-Apply the 2.6.14-rc3-mm3 patch.

bzip2 -cd ../2.6.14-rc3-mm3.bz2 | patch -Np1 (whilst in linux directory).

Most users will be confused by running a -stable kernel, and not being able to patch to the latest Linus "release" kernel. If you are on 2.6.13.4, and you want to go to 2.6.14, all you need to do is:

-Download the full Linux 2.6.14 "release" tarball. Done.

tar jxvf linux-2.6.14.tar.bz2

-OR, Reverse the 2.6.13.4 patch from your existing tree. This will return you to Linus "release" 2.6.13.

bzip2 -cd ../patch-2.6.13.4.bz2 | patch -Rp1 (whilst in linux directory).

-Apply the 2.6.14 patch.

bzip2 -cd ../patch-2.6.14.bz2 | patch -Np1 (whilst in linux directory).

No hay comentarios: