LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-10-2008, 08:32 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
Creating a Kernel patch after our own customizations


Hi,

I downloaded 2.6.24 kernel and I made the following changes:
Code:
1. Changes to /usr/src/linux/drivers/video/Makefile
2. Changes to /usr/src/linux/drivers/video/Kconfig
3. Created a new directory /usr/src/linux/drivers/video/via and added some new files there.
Now I would like to create a patch which my users can use after they install the 2.6.24 kernel. How can I create a patch which incorporate changes such as adding a entire new directory like "via" in this case.

Thanks
 
Old 03-11-2008, 03:19 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
1. Make sure your additions are GPLv2 compliant.
2. Make sure that what you want to do and how you are going about it match.
http://kernelnewbies.org/Drivers
http://www.linuxchix.org/content/cou...acking/lesson9

To make a patch - cd into the top of the modified source tree and use diff with the recursive flag... i.e.

cd /usr/src
diff --unified --recursive --new-file linux-2.6.22 linux > patch-2.6.22
gzip patch-2.6.22

Note the pattern: diff -options oldfile newfile > patch
So - oldfile = the old linux source tree, here it's the /usr/src/linux-2.6.22 directory and all the new goodness is in /usr/src/linux

You user applies the patch by cd-ing into the unpatched kernel tree and using zcat and patch:

cd /usr/src
zcat patch-2.6.22.gz | patch -p0 -E
 
Old 03-11-2008, 03:26 AM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Awesome!!! No wonder you are called Guru.

Quote:
Originally Posted by Simon Bridge View Post
1. Make sure your additions are GPLv2 compliant.
When you say GPLv2 compliant, are you referring to the coding style or the licensing issues related to releasing the source code and all that?
 
Old 03-11-2008, 04:55 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
License issues.
http://www.gnu.org/licenses/gpl-faq.html
Using only gpl code avoids them.

As well, applying a proprietary patch "taints" the kernel. This makes it difficult to get outside help should things go wrong. Like - don't go running to the kernel mailing lists.

You will be distributing it, so you need to give serious thought to how you will be licensing your patch. You also need to make sure the recipients understand how this works. It's a pain at first, but you get used to it - also, you end up more aware of the chains that proprietary vendors put on you, often without realizing it. Next thing you know, you're free... it's a slippery slope.

Oh: and "guru" just means I've made x-number of posts. I could as easily be "LQ Addict" but that's less cool
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Red Hat kernel customizations compared to vanilla kernel Z98 Red Hat 1 09-16-2007 02:27 PM
Creating patch file which options to use? cranium2004 Linux - Newbie 1 03-13-2005 04:35 AM
Creating patch file which options to use? cranium2004 Programming 1 03-11-2005 09:56 PM
debian-patch-debianlogo w/2.6.5 kernel-patch-lpp Outabux Debian 11 05-20-2004 01:21 PM
INFO: creating a special secured kernel (grsecurity kernel patch) w sysctl config markus1982 Linux - Security 0 05-25-2003 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration