Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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?).
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.