LinuxQuestions.org
Help answer threads with 0 replies.
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 01-25-2008, 08:05 AM   #1
bookie
Member
 
Registered: Nov 2006
Location: Sweden
Distribution: Testing just about everything.....Debian still a favourite and now Dreamlinux!!
Posts: 320

Rep: Reputation: 30
Smile patching the kernel


Hi again, YES i know that patching the kernel has been written about in depth around the forums, but there are so many different ideas about how one should patch the kernel.

In this instance I am working with Debian and have just installed the 2.6.23 kernel.

I would like to patch it for one reason - to learn how it works!!

Now the latest stable kernel is 2.6.24 as I write this. I can if I want download and install the latest without patching.

(Please don't forget this is a learning exercise and not of being worried that I might break something)

I would like to add the patches after 2.6.23 up to 2.16.24 If I have understood correctly I can't patch after 2.6.23.9 because that is a new version of the kernel.

So for arguments sake I want to apply the patches 1-9. I know they have to be installed consecutively otherwise errors will occur.

Do the patches have to be in the 2.6.23 folder when I issue the command #patch -p1 < patch-2.6.23.1? This is where the info is a bit conflicting. Some say YES the patches must be in the kernel folder to be patched and No if you give the path to them?

I can not seem to get passed the first patch without getting the following error:

Quote:

Reversed (or previously applied) patch detected! Assume -R? [n]

If I enter "Y" then I get a number of questions to answer yes no to? I just assumed that I would install without problems and then move onto the compiling!!


Is there something I am missing that I haven't thought of?

bookie
 
Old 01-25-2008, 08:34 AM   #2
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
I always download the full kernel for each new release version

Your patching method is sound, you didn't notice however that the "< patch-version" part is a fully qualified filename, ie:
Code:
patch -p1 < /home/username/patches/patch-version
will also work if your new patch file is in /home/username/patches/
 
Old 01-25-2008, 08:38 AM   #3
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
ps. I always use the patch-version.tar.bz2 file, then use this command to patch:

Code:
cd /usr/src/linux-version/
bunzip2 -dc ~/patches/patch-version.tar.bz2 | sudo patch -p1
as a normal user ie not root

sudo allows a normal user to temporarily perform administrative tasks

Last edited by Tuttle; 01-25-2008 at 08:40 AM.
 
Old 01-25-2008, 08:44 AM   #4
bookie
Member
 
Registered: Nov 2006
Location: Sweden
Distribution: Testing just about everything.....Debian still a favourite and now Dreamlinux!!
Posts: 320

Original Poster
Rep: Reputation: 30
update

Hi Tuttle, I thank you for coming by, but I am afraid I don't have a clue what you are trying to say?

bookie
 
Old 01-25-2008, 11:55 AM   #5
bookie
Member
 
Registered: Nov 2006
Location: Sweden
Distribution: Testing just about everything.....Debian still a favourite and now Dreamlinux!!
Posts: 320

Original Poster
Rep: Reputation: 30
update

Well, it would seem it isn't acceptable that one doesn't understand what someone else is saying?!

Seems to be the story of my life lately!! I think it is better to be honest than mislead someone?!

I will not waste anyone else's precious time!! The reason we ask is because we don't know. Beginning to think it is better not knowing than asking!!

bookie
 
Old 01-28-2008, 11:06 AM   #6
bookie
Member
 
Registered: Nov 2006
Location: Sweden
Distribution: Testing just about everything.....Debian still a favourite and now Dreamlinux!!
Posts: 320

Original Poster
Rep: Reputation: 30
update

I am at a loss to believe that no one knows how to patch a kernel the Debian way?

Hasn't anyone patched a kernel?

bookie
 
Old 01-29-2008, 09:22 AM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
A 'patch' is basically a diff output between the old and new versions of a particular set of files. (Any version-control system can produce one.)

If you wish to explore patches, I strongly recommend that you commit your source-tree to a version control system, such as CVS or SubVersion or (pick one), and use that to apply the patches ... this gives you full before-and-after views of what happened. The patches should be applied to create a "vendor branch" and should be applied to the previous "vendor branch." If you are doing your own development-branches, you'll need to then do a merge.

Except as an exercise, full source-directory replacements are usually the preferred system ... these are completely reliable since they are completely separate. But, they're not suitable if you're doing your own local source-changes.

I agree that this is a useful, albeit advanced, skill to master. Of course, always do it on a copy, with a tested and known-good "escape strategy" well in hand.
 
Old 01-30-2008, 09:18 PM   #8
bookie
Member
 
Registered: Nov 2006
Location: Sweden
Distribution: Testing just about everything.....Debian still a favourite and now Dreamlinux!!
Posts: 320

Original Poster
Rep: Reputation: 30
Hi sundialsvcs

This is the second time of replying to your post. I must have forgot to submit last time.

Anyway, I am sorry for my last post. I wasn't being exactly friendly!! I have had so many problems with back pain and then I go and break my ankle which has led to more back pain!!

So I do understand about the diff and patches in general just can't seem to patch consecutively without errors?

I have followed the info gathered on the NET to the letter but nada.

I was just wondering if one should run the code all at the same time. I mean having a comma between the different patches or something?

This is also an apology to Tuttle. I don't excuse my attitude. I think it stinks at times. I do hope that you believe me when I say it is the pain that is affecting my temperament!!

I get angry with myself for being in pain?!!

Thanks for your posts guys!!

YOU ARE APPRECIATED!!

bookie
 
  


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
error while patching Rtlinux 3.1 kernel using kernel linux-2.4.29 dolreich_c Linux - General 1 02-06-2018 06:48 AM
Error while patching RTLinux 2.6.9 kernel using kernel linux-2.6.9 krishna_karne Linux - Software 1 11-16-2007 10:36 PM
patching Debian Stock Kernel with prepatch from kernel.org kushalkoolwal Debian 10 08-25-2007 01:05 PM
powerpc: kernel patching... but which kernel source? parent's_basement Ubuntu 2 01-15-2007 01:46 PM
Patching a 2.6 kernel with a 2.4 kernel keyboard driver..possible? dxx Linux - Laptop and Netbook 3 11-18-2004 04:18 AM

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

All times are GMT -5. The time now is 01:42 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