LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how do i patch the kernel with .patch (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-patch-the-kernel-with-patch-553502/)

bbmak 05-13-2007 03:48 AM

how do i patch the kernel with .patch
 
I download a patch from DriverLoader
I use dldrconfig --patch file.patch command
But it cannot patch the file. It pops up this error message, "Patching is currently only supported with the TAR package format."

What can I do ?????

titopoquito 05-13-2007 04:54 AM

A working command line is hard to give if you give no more information. I guess you downloaded patches from here (http://www.linuxant.com/driverloader...s-patches.php), and for the example I assume your patch file is named linux-2.6.18-16kstacks.patch.

View the patch file with any text editor. At the beginning you will see something like this:
Code:

diff -urN linux-2.6.18/arch/i386/Kconfig.debug linux-2.6.18-16kstacks/arch/i386/Kconfig.debug
--- linux-2.6.18/arch/i386/Kconfig.debug        2006-09-19 23:42:06.000000000 -0400
+++ linux-2.6.18-16kstacks/arch/i386/Kconfig.debug        2006-09-27 13:09:54.000000000 -0400
@@ -66,6 +66,14 @@

That's important info because to patch files it is important to know the relative paths they use. This line indicates what file will be patched (there might be others down the lines, but this one is the first to be patched). Example: If you go to your linux kernel's source folder now, usually /usr/src/linux, you will see that there is no folder named "linux-2.6.18". The first part of that path has to be stripped away, else the patch utility cannot find the file. That's what the -p option of "patch" is for.
So if you were in /usr/src/linux and wanted to add that patch file, you would have to do
Code:

patch -p1 < /path/whereyou/downloaded/linux-2.6.18-16kstacks.patch
patch is the command, -p1 will strip one folder hierarchy from the shown line and you need to give it the input the way I did above, you cannot just give the patch file name.

I hope you find it helpful, that's the way patches are applied most of the times.

P.S.: That's only the patch. To make it work you would have to do something with your kernel of course (or the driverloader program will do it)


All times are GMT -5. The time now is 12:26 AM.