Now here is a clean thread,
1. You have a target device, for argument sake, you need to change some of the kernel driver files to accommodate those hardware various, or even just you fancy ideas of changing Linux itself. After all, that's what you are expecting from open source OS, isn't it?
2. In parallel, you wanted to patch your existing Linux source distribution with some other third party addon, such as RTAI or Xenomai.
In my case, I had a problem that both of them require changes in xxx_gpio.c file, and same lines! The third requirement is, I do not want to manually do the file copy thing or scripted file copying thing every time when I rebuild the whole lot. After a nice lunch time beer, this is what I have done.
Step 1. file_ver0.c => Apply third party changes (only because they are normally dumber!) => file_ver1.c
Step 2. file_ver1.c => Apply your changes on top of third party changes => file_ver2.c
Step 3. Do a diff -u file_ver0.c file_ver2.c > diff.txt
Step 4. Replace the patch section of this file in the original .patch file with content in diff.txt.
Step 5. Or create your own patch file and do patch -p1 < whatever.patch
Ok, this is done once for all.
No comments:
Post a Comment