LinuxQuestions.org
Visit Jeremy's Blog.
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 07-13-2009, 02:41 PM   #1
geek.ksa
Member
 
Registered: Jan 2009
Location: Dhahran, Saudi Arabia
Distribution: RHEL 5
Posts: 42

Rep: Reputation: 17
Problems with Patch command


Hey guys,

I have an RHEL 5 distro with kernel 2.6.18

I went to kernel to org and downloaded the latest patch, and then I took almost half an hour reading the man page for the patch command, i was super frustrated at how poorly documented it is.


any way, after some googling, i copied the patch to /usr/src, and then ran the patch command:
Code:
patch -p0 < patch-2.6.30.1
I got below error message which i think is caused by the p0 option:

Code:
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
|index c302ddf..5236573 100644
|--- a/Documentation/sysctl/vm.txt
|+++ b/Documentation/sysctl/vm.txt
--------------------------
File to patch:
it prompts for the file to patch, but i don't know what to input! there is no file number or something like that. I tried running the command with no p option but got same result.

Please help me figure out what is wrong with this.
 
Old 07-13-2009, 03:57 PM   #2
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
As a rule of thumb: if patch prompts you for input, there's something wrong.
Maybe you're in the wrong directory, you should adjust the '-p' option, or you applying the patch to the wrong kernel version.
Anyway, I do like this:
$> cd /usr/src/my_kernel
$> patch -p1 < my_patch

And that's it. Using -p1 makes the patch command ignore the first part of the path.

To go further, maybe a howto can help you better than me and the man page:
http://www.linuxdocs.org/HOWTOs/Kernel-HOWTO-6.html
 
Old 07-13-2009, 04:02 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by geek.ksa View Post
Hey guys,

I have an RHEL 5 distro with kernel 2.6.18

I went to kernel to org and downloaded the latest patch, and then I took almost half an hour reading the man page for the patch command, i was super frustrated at how poorly documented it is.


any way, after some googling, i copied the patch to /usr/src, and then ran the patch command:
Code:
patch -p0 < patch-2.6.30.1
I got below error message which i think is caused by the p0 option:

Code:
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
|index c302ddf..5236573 100644
|--- a/Documentation/sysctl/vm.txt
|+++ b/Documentation/sysctl/vm.txt
--------------------------
File to patch:
it prompts for the file to patch, but i don't know what to input! there is no file number or something like that. I tried running the command with no p option but got same result.

Please help me figure out what is wrong with this.
Couple of things...

a) With RHEL you *shouldn't* try to use vanilla kernel patches; stick
with what RHEL throws your way.
b) A patch for 2.6.30.1 will almost certainly NOT work with a 2.6.18 kernel.



Cheers,
Tink
 
  


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
how to patch using command line xyleo Linux - Security 5 04-04-2006 11:19 PM
patch -p1 x.diff but no patch command!? pyenos Linux - Hardware 1 03-04-2005 03:10 PM
No patch command ?? bush Linux - Newbie 1 05-20-2003 08:48 AM
No patch command ?? bush Linux - General 1 05-20-2003 08:46 AM
help with patch command linux_newbie Linux - General 2 11-17-2001 03:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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