I would like to patch my kernel so that it would do zerocopy. I found this nice repo on github but i'm not too sure how to go about doing it.


it says on the wiki that only drivers/usb/core/devio.c needs to be modified. To patch the kernel, do i simply overwrite the original with the new drivers/usb/core/devio.c and build a new kernel?

Edit: I found https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel which tells me how to build my own kernel. However, it's unclear how i can merge this with my current system (ubuntu 14.04). I was able to find my kernel source directory at /usr/src and I was able to find drivers/usb/core directory. However, i wasn't able to find devio.c. Only files I found were Kconfig and Makefile. I'm not sure how to go about copying devio.c from the repo and building the kernel again.

  • Is there a .patch file anywhere? – fosslinux Jun 8 '16 at 22:24

By looking at the GitHub repo, it seemed it is the kernel source. If only that file is modified, copy that file into the source and recompile.

| improve this answer | |
  • So it seems like the linux source codes are located in /usr/src/linux-headers-3.10.67-g458d45c but when i go to driver/usb/core/ , i don't see devio.c . I only see Kconfig and Makefile. My questions are 1. do i simply copy that file to driver/usb/core/ and 2. build it by fakeroot debian/rules clean and fakeroot debian/rules binary-headers binary-generic – MoneyBall Jun 9 '16 at 18:21

Assuming you want to patch an Ubuntu kernel (since this is askubuntu.com). You can easily patch your kernel by following this wiki: https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel

To take a patch from another Linux repo you should find the differences that repo and the Ubuntu one and merge those changes. Since both are maintained in git you can use merging or cherry-picking to accomplish this.

So in summary:

  1. Download sources to Ubuntu kernel repo
  2. Merge changes
  3. Build and install new kernel package
| improve this answer | |
  • yes, i do want to patch ubuntu 14.04, but the repo doens't seem to be ubuntu. the repo says it only modified drivers/usb/core/devio.c which makes me wonder if i could simply copy that to ubuntu and try building the kernel – MoneyBall Jun 9 '16 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.