LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 06-13-2008, 07:14 AM   #1
storkus
Member
 
Registered: Jun 2008
Posts: 310

Rep: Reputation: 45
Kernel Patching Weirdness


I'm not a Linux n00b by a long shot, but usually I just install a new
kernel from full-source and forget it. My laptop is fairly new and I'm
using some heavy-activity drivers so I'm looking at doing incremental
patching, which I haven't done in a long time.

To make a long story short, I'm seeing some weirdness I don't remember ever
having seen before: trying to patch 2.6.25.4 to 2.6.25.5 I'm seeing the
first hunk (on the parent Makefile) fail, a bunch of subsequent files
claiming to be reverse-patched, and then, when I spec'd "-R" on the
command line, later files claim to be forward-patched! I just can't win
here. Is this normal with current-generation kernel patches or am I doing
something wrong? Should I specify "-t"?

My command line is (from within /usr/src/linux):

patch --dry-run -p1 < /path/to/patch-2.6.25.5 | most #see what's going on

(--dry-run because I don't trust myself after not having used "patch" for
so long!)

Mike
 
Old 06-14-2008, 08:11 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,743
Blog Entries: 54

Rep: Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972
Unpatched vanilla kernels should patch cleanly to then next minor version AFAIK. I'm wondering if you patched things in between? If you're feeling adventurous you could just patch it with some --fuzz, check the discarded chunks against the source and see if you can fit them in ;-p else why not just download http://www.kernel.org/pub/linux/kern...6.25.6.tar.bz2 ? Yes, it's moving that fast... And IMHO using --dry-run isn't about "trusting yourself" it is common sense.
 
Old 06-15-2008, 09:16 AM   #3
storkus
Member
 
Registered: Jun 2008
Posts: 310

Original Poster
Rep: Reputation: 45
Thanks for the comment on "--dry-run", I appreciate it!

On patching to 2.6.25.6: I thought you couldn't jump 2 revisions like
that: you have to patch to .5 then .6. Am I missing something here?

It's an interesting idea on "--fuzz", I'll give it a shot.

Worst case scenario, I just jump to 2.6.26 and live with any beta
weirdness (AFAIK, rc's usually don't break with the kernel...<knock knock
knock>)

Thanks again!

Mike
 
Old 06-15-2008, 04:50 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,743
Blog Entries: 54

Rep: Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972
You're right, you shouldn't skip patches, but the link is not to a patch but the full source (as in skip beating the level boss and move to the next level anyway ;-p )
 
Old 06-15-2008, 06:40 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,497

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Kernel patches aren't built that way - revert the 2.6.25.4 patch, then apply the 2.6.25.5.
See ../Documentation/applying-patches.txt
 
Old 06-23-2008, 05:24 AM   #6
storkus
Member
 
Registered: Jun 2008
Posts: 310

Original Poster
Rep: Reputation: 45
But what if, like me, you download the already patched kernel: the
2.6.25.4 version is what I downloaded originally. So how can I revert
all the way back to 2.6.25? If what you're telling me is true, then I
need to just download 2.6.25 and then add and remove each 4th-numbered
(I can't for the life of me remember what that 4th number is called) as a
new one comes out. Is that correct?

Mike
 
Old 06-23-2008, 07:52 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,497

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
If you downloaded 2.6.25.4 as a stable (i.e. full source), you can't patch it like that. You'll have to go get the baseline and apply the 2.6.25.5 patch to that.

If you are going to be actively patching, you need to get the applicable base plus the patch(es), rather than full source - patches are cumulative, and need to be reversed prior to applying a later patch. Else pull the (later) full source as released/needed.
 
Old 06-23-2008, 08:01 AM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,049

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Quote:
Originally Posted by storkus View Post
But what if, like me, you download the already patched kernel: the
2.6.25.4 version is what I downloaded originally. So how can I revert
all the way back to 2.6.25? If what you're telling me is true, then I
need to just download 2.6.25 and then add and remove each 4th-numbered
(I can't for the life of me remember what that 4th number is called) as a
new one comes out. Is that correct?

Mike
It's the same. You can revert one patchlevel. That the kernel originally was 2.6.25 or 2.6.25.4 is not relevant.

You revert to .25, then you patch the next patchlevel. It's just the way it works. In other words, if you have a 2.6.25.4 kernel, you need to download this:

http://www.eu.kernel.org/pub/linux/k...h-2.6.25.4.bz2

Then you revert this patch with -R. Then you download:

http://www.eu.kernel.org/pub/linux/k...h-2.6.25.5.bz2

Or better, the latest today:

http://www.eu.kernel.org/pub/linux/k...h-2.6.25.8.bz2

And apply it.

Last edited by i92guboj; 06-23-2008 at 08:03 AM.
 
Old 06-23-2008, 08:46 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,497

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
True - i92guboj is correct.
You can reverse the .4 if you have it (as a patch). No need to (re-)go get the baseline as I suggested.

Too late at night ... sorry.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Error while patching RTLinux 2.6.9 kernel using kernel linux-2.6.9 krishna_karne Linux - Software 1 11-16-2007 11:36 PM
patching Debian Stock Kernel with prepatch from kernel.org kushalkoolwal Debian 10 08-25-2007 02:05 PM
error while patching Rtlinux 3.1 kernel using kernel linux-2.4.29 dolreich_c Linux - General 0 08-10-2006 04:33 AM
Mandrake 10.1 - kernel weirdness Malibyte Mandriva 5 03-16-2005 09:50 PM
Kernel makeconfig weirdness gamehack Slackware 2 09-25-2004 09:35 AM


All times are GMT -5. The time now is 08:02 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration