开发者

How to patch the Linux kernel?

开发者 https://www.devze.com 2023-01-25 06:51 出处:网络
I am having a serious problem. What i have in my hand : 开发者_如何学Python Linux Kernel 2.6.29 with Android Eclair patches and some board specific patches(as .patch files).

I am having a serious problem.

What i have in my hand :

开发者_如何学Python
  • Linux Kernel 2.6.29 with Android Eclair patches and some board specific patches(as .patch files).
  • Linux Kernel 2.6.32 with Android Froyo patches.

What i want to achieve :

  • I want to merge the board specific patches to my Linux Kernel 2.6.32 with Android Froyo patches.

I am not able to get an idea on how to do that. I tried applying the Board specific patches directly on to the 2.6.32 kernel, but it failed with many errors.

Please guide me with some valuable pointers.

Thanks,

Sen


Without seeing the specific errors, it's hard to determine.

Patch will give you a ".rej" file for each file/patch which shows you what it was trying to do and what it found, causing the failure. It will generally tell you that it created these files so you can fix them.

What you may be running into is something more primitive - in that patch is not even finding the correct files in the first place.

This if most often caused by the fact that the paths are layed out differently in the patchfiles as they are how you are running it. (I'll try to give an example).

If you look at each file entry for each file being patched, it will have a "source" and "destination" filename, like:

/original/src/drivers/mydriver.c /destination/src/drivers/mydriver.c

This would mean that - say for example your project was in a directory called "project". Your current working directory would be "project", and the file you were patching would be:

/project/src/drivers/mydriver.c

This patch would work.

Let's say for example, you ran the same patch, but your current working directory was:

/project/src

When you ran patch, it would be looking for a file called:

/project/src/src/drivers/mydriver.c

And nothing would work.

There are two remedies:

  1. Make sure you are running patch from the proper directory level.

  2. Use the "-p{num}" flag in patch - which essentially tells it to ignore a certan amount of directories at the beginning of each filename in the patchfile.

You could also post some of the errors you are getting for more help...

0

精彩评论

暂无评论...
验证码 换一张
取 消