I want to make changes to the kernel files /linux/net/ipv4/ip_output.c in my case. I want to add a script to be run that changes the payload of the data whenever a packet passes through the IP_LOCAL_OUTPUT hook. Now when I add that script, how do I recompile the kernel that make the changes operable.

  • This guide may help you: linux.com/learn/tutorials/… – Radu Rădeanu Mar 30 '14 at 8:49
  • I'll look into it and report back, Thanx – user263533 Mar 30 '14 at 9:18
  • I get this error when i do make oldcofig while i am in the directory where source code is present, its linux-3.9 in my case. What can be the problem? Makefile:497: /home/ip-center/linux-3.9/arch//Makefile: No such file or directory make: *** No rule to make target `/home/ip-center/linux-3.9/arch//Makefile'. Stop. – user263533 Mar 30 '14 at 9:42

Ubuntu and Debian have thier own way to rebuild kernel. Methods from other distros DO NOT apply. Here is the right procedure, follow the apt-src way.

  • P.S. If you remove modules from menuconfig while using this way, it will not compile. I believe there is a config line for this case. – Barafu Albino Mar 30 '14 at 10:04
  • When shall i make changes to the files i want as i mentioned in linux/net/ipv4/ip_output.c file? Shall I change it after the first step of getting the source code using apt-get source linux-image-$(uname -r). and then go ahead with next steps? Sorry if this is a silly question to ask – user263533 Mar 30 '14 at 10:49
  • Yes, exactly this moment, before you run menuconfig. – Barafu Albino Mar 30 '14 at 11:26

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