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 05-22-2006, 11:51 PM   #1
jnutt
LQ Newbie
 
Registered: May 2006
Location: Monrovia, CA, USA
Distribution: Fedora Core 5, RH8
Posts: 2

Rep: Reputation: 0
patch problem - can't find file to patch


Hello,

I have been unsuccessfully trying to patch my kernel, mainly to reconfiguring it to add support necessary for FORCEDETH. After several attempts and failures, I know that there must be something basics to the patch process that are eluding me, and hoped that someone here could please enlighten me.

My system is a Gateway dual processor system (also dual-boot with XP, using GRUB)running Fedora Core 5: current system info from uname -a is given below:
# uname -a

Linux plum.fruits.net 2.6.15-1.2054_FC5 #1 SMP Tue Mar 14 15:48:20 EST 2006 x86_64 x86_64 x86_64 GNU/Linux

With this information in hand, I decided that I needed the kernel source for 2.6.15, and the patch-2.6.15.1 (to be able to patch from 2.6.15 to 2.6.15.1)

I used /usr/src as a staging area for future operations on the kernel src (unpacking, etc)

so I have:

# cd /usr/src
# ls
linux-2.6.15.tar.bz2 patch-2.6.15.1.bz2

Q#1: Can I just get the linux-2.6.15.1.tar.bz2 kernel source and not apply incremental patches? If so, what are the disadvantages of doing it that way?

Next step was to 'unpack' the files to produce source directories:
# bunzip2 linux-2.6.15.tar.bz2
# bunzip2 patch-2.6.15.1.bz2

linux is a link to the current source tree in /usr/src: get rid of the old one if there was one:
# rm linux
# tar -xvf linux-2.6.15.tar
# ln -s linux-2.6.15 linux

After this process, the /usr/src directory looks like:

total 64
drwxr-xr-x 19 root root 4096 Jan 2 19:21 linux-2.6.15
drwxr-xr-x 7 root root 4096 Apr 30 01:20 redhat
drwxrwxrwx 21 root root 4096 May 20 15:59 linux-2.6.15.1
-rwxr-xr-x 1 root root 21515 May 20 23:08 patch-2.6.15.1
lrwxrwxrwx 1 root root 12 May 20 23:38 linux -> linux-2.6.15
drwxr-xr-x 19 root root 4096 May 21 13:06 linux-2.6.15.bkp

(The file linux-2.6.15.bkp is a copy of the source tree I made before trying to apply the patch).

For general information, here is what the first few lines of the "patch-2.6.15.1" file look like

diff --git a/Makefile b/Makefile
index 497884d..bbaa2fb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 15
-EXTRAVERSION =
+EXTRAVERSION = .1
NAME=Sliding Snow Leopard

# *DOCUMENTATION*
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index f3e9c53..9533f8d 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -190,6 +190,8 @@ boot-$(CONFIG_REDWOOD_5) += embed_config
boot-$(CONFIG_REDWOOD_6) += embed_config.o
boot-$(CONFIG_8xx) += embed_config.o
boot-$(CONFIG_8260) += embed_config.o
+boot-$(CONFIG_EP405) += embed_config.o
+boot-$(CONFIG_XILINX_ML300) += embed_config.o
boot-$(CONFIG_BSEIP) += iic.o
boot-$(CONFIG_MBX) += iic.o pci.o qspan_pci.o
boot-$(CONFIG_MV64X60) += misc-mv64x60.o

Q#2: What does the "--git" option on the diff do to the diff?

From looking at this file, it seemed to me that the patch should be applied as follows:

# patch -p1 <patch-2.6.15.1


but when I do this I get a series of errors such as:

can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/Makefile b/Makefile
|index 497884d..bbaa2fb 100644
|--- a/Makefile
|+++ b/Makefile
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 18
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
|index f3e9c53..9533f8d 100644
|--- a/arch/ppc/boot/simple/Makefile
|+++ b/arch/ppc/boot/simple/Makefile
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 31
Perhaps you should have used the -p or --strip option?
.
.
.

I chose patch num 1 instead of 0 to get rid of the a/ & b/ in the path names presented to the diff; taking that into account, the files actually exist in my /usr/src/linux directory (current source tree), so:

Q#3: How does 'patch' determine what source tree it is to be applied to (or is it just a collective effort on the part of the patch being applied to a set of files?).

My system also has a 'build' path :

# ls -l /lib/modules/2.6.15-1.2054_FC5/build

lrwxrwxrwx 1 root root 22 May 19 18:15 /lib/modules/2.6.15-1.2054_FC5/build -> ../../../usr/src/linux

that used to be a broken link, but now appears to be correctly to be pointing to the current kernel source tree.

I would very much appreciate everyone's clearing up my misunderstandings of the patch process.

TIA,
jnutt
 
Old 05-23-2006, 03:09 AM   #2
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
Did you read the '/usr/src/linux/Documentation/applying-patches.txt' file ?
Everything about patches and how to apply them is explained there.
From what I see, you should be in your '/usr/scr/linux-2.6.15' directory before doing 'patch -p1 <../patch-2.6.15.1', then you go to /usr/src and you rename the 'linux-2.6.15' directory into 'linux-2.6.15.1', and recreate the '/usr/src/linux' soft link to point to 'linux-2.6.15.1'.
But read the documentation file to get more details (particularly the "The 2.6.x.y kernels" part).
Good luck.

Last edited by berbae; 05-23-2006 at 03:56 PM.
 
Old 05-23-2006, 06:04 PM   #3
jnutt
LQ Newbie
 
Registered: May 2006
Location: Monrovia, CA, USA
Distribution: Fedora Core 5, RH8
Posts: 2

Original Poster
Rep: Reputation: 0
patch problem - can't find file to patch

Thanks, berbae for ponting me to the Documentation on applying_patches. With your help, I've been able to apply the patch, and am proceeding with reconfiguration for forcedeth (which is what brought me here in the first place.

jnutt
 
Old 02-10-2010, 03:45 PM   #4
mtm88
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by jnutt View Post
Thanks, berbae for ponting me to the Documentation on applying_patches. With your help, I've been able to apply the patch, and am proceeding with reconfiguration for forcedeth (which is what brought me here in the first place.

jnutt
Hi Jnutt please l need your help; l am working on the same thing now but can't find the way out of this problem of "File to patch". Here are the last sentences of the error message :

File to patch:
Skip this patch? [y] y
Skipping patch.
3 out of 3 hunks ignored
can't find file to patch at input line 6661
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Nru a/include/linux/ipv6.h b/include/linux/ipv6.h
|--- a/include/linux/ipv6.h 2006-06-14 10:51:22 +03:00
|+++ b/include/linux/ipv6.h 2006-06-14 10:51:22 +03:00


what should l do ????
 
  


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
Unable to patch 2.6.11.7 kernel with Reiser4 mm patch SlackwareInAZ Slackware 9 04-26-2005 06:33 AM
Patch-o-matic TTL Patch Knopper Fedora 1 02-02-2005 10:27 AM
How to Install patch-o-matic(a iptables patch) on redhat 9? itebooks Linux - Security 1 07-23-2004 08:51 AM
debian-patch-debianlogo w/2.6.5 kernel-patch-lpp Outabux Debian 11 05-20-2004 01:21 PM
How to Apply patch for Mass Storage device to work? (uss725-2.4.20-rc2.patch) cevjr Linux - Hardware 3 04-20-2004 11:14 PM

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

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