LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-26-2007, 11:33 AM   #1
charlweed
Member
 
Registered: Jan 2005
Posts: 46

Rep: Reputation: 15
How to preserve kernel patches over upgrades?


Hi!
I have FC 5, and I've patched my 2.6.18-1.2257 kernel in a few spots. Now, I'd like to download and build later kernel sources, but I don't want to loose my patches.
I know that if I maintain a separate source tree, can can just diff and patch, but that seems slow, storage intensive, and error prone. Is there some well established way to keep just the patches in a particular spot, where they are always incorporated into a kernel build?

Thanks!


Charlweed
 
Old 04-26-2007, 11:37 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Nope, and besides these patches may not work for newer kernels for a number of reasons.
 
Old 04-26-2007, 11:44 AM   #3
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
The only way to move patches from one kernel rev to another is via patch files, unless you want to retype them each time. What I do for alsa development work, is I make a copy of the file I'm getting ready to modify (not the entire tree). Then I can run diff -u on the two files to generate a unified patch file (i.e. diff -u foo.c.orig foo.c > foo.patch). This should either be done from the kernel source root directory, or the full patch from the kernel root should be added to the second line of the patch file (the line starting with +++ and the updated filename). Then this patch file can be moved around.

To build your patch into a new kernel rpm, you will need the src.rpm file. Install it into the rpm build area, copy your patch files into the SOURCES directory, then edit the SPECS/<kernel>.spec file to add your patch during the pre-build stage where appropriate. You can then rebuild the rpms with rpmbuild, and the new src.rpm that it generates will also have the patch files.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Upgrades for SuSE 10.0 CUCPSC_Geek SUSE / openSUSE 10 10-26-2005 10:28 AM
alsa and kernel upgrades linuxhippy Slackware 7 04-06-2005 07:03 PM
How to upgrade kernel but preserve configuration? Avatar Mandriva 8 12-30-2004 06:33 AM
APT--Kernel upgrades? Spotnik Red Hat 1 05-01-2004 10:01 AM
Kernel upgrades... Pyroknight Linux - General 4 02-07-2003 01:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:26 AM.

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