Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I browsed this file and I guess some parts of it was garbage so I am really not sure if it was the command that does work, or the file isn't just working.
I am using an embedded linux distribution: MontaVista Linux Professional Edition kernel version 2.6.10.
I have seen that parts of the patch file was for 2.4.xx and parts of it was for 2.6.xx.
I have verified that the kernel source really does not have the corresponding gcov files that this patch was supposed to patch, but I guess that this patch will create those files if they do not exist. I am really not sure.
I hope someone can help me on how to use this patch file.
I went ahead and d/l the file from the url you provided. It contains patches for kernels 2.4.21and 2.4.25 for the 2.4 series and for 2.6.4, 2.6.5, 2.6.14-2.6.22 for the 2.6 series.
So unfortunately your kernel (2.6.10) does not match any of the above. Either you upgrade your kernel to one of the supported versions, or you can try to use the patch for 2.6.14 to see if it works. To do so copy the patch in /usr/src and create a symlink to your kernel:
I wouldn't recommend patching a kernel that the patch isn't made for; if it's possible, rather upgrade to a kernel that the patch is meant for. Less trouble that way.
If you wanted to apply a patch for a 2.6.14 kernel and you're running 2.6.10, that means you'll need to patch your kernel to become 2.6.14 before applying this patch. That means you'd have to download the 2.6.11, 2.6.12, 2.6.13 and then 2.6.14 and patch them in order.
In those cases, it's just easier to download the whole kernel, 2.6.14 and recompile with the patch if needed. Or you could possibly download a even later version that includes this patch.
Why are you patching anyways? Is it something specific to add support for hardware? I mean, you say you ran across a patch file but is there a reason or did you just happen to run across it and think you need it?
Thanks for your suggestion guys! Sorry for the late reply.
Basically I need to patch my kernel to have the gcov application. I would like to run coverage tests on my kernel modules, which can be done by this patch.
I have tried bathory's suggestion, but I encountered an error while loading my modules. It says something like disagrees with the version of struct_module, and invalid module symbol. My module is working properly before I tried the 2.6.14 patch. When I also tried to apply the patch, I expected that the gcov module will be loaded automatically, but it does not. It says on my book that for a module to be loaded, it has to have the ".ko" extension, but object files produced on the drivers/gcov/ folder are just ".o".
Ah so does it mean, if I have to upgrade my kernel to 2.6.18, I have to apply the patches from 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17.... Do I have to compile the kernel in every patch? (execute "make menuconfig" then "make", is this correct?) This can take half a day... :-(
No, only download patches how trickykid said. They apply of top of the previous one for 2.6.X
As soon as they have all passed without reject file, you can build.
If you have a good bandwidth, dl directly the 2.6.14, patch it with your patch and build.
Yeah, never patch if you need to go up more than 2 versions. Just download the version you need, the full and complete source, then apply your separate patch, then recompile. No reason to apply a dozen patches when you can do it with one download, one patch and one recompile.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.