LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 03-23-2008, 08:10 PM   #1
sidholland
LQ Newbie
 
Registered: Feb 2006
Location: Vancouver, Canada
Distribution: ubuntu 8.1, 9.04, Mint 6, Debian 5
Posts: 14

Rep: Reputation: 0
Having trouble applying kernel patch.


Hi Folks,

I've spent the better part of a week attempting to get wireless networking working on my CentOS 5.1 box. Since my card (a D-LINK DWL-G510) is not directly supported, I first installed NDISwrapper, which I've used before on my openSUSE 10.3 installation and works fine.

I first hit a snag when I attempted to set the ssid with iwconfig using
Code:
# iwconfig wlan0 essid tartarus
with the result that the machine instantly hangs and I have to do a hardware reset.

I know that wlan0 exists since a call to iwconfig with no options shows it to be there.

Having looked around at anyone with a similar problem, the general consensus seems to be that a patch to set the stack size to 16K should solve the problem. So I downloaded one and attempted to apply the patch and this (eventually) is the problem with which I am now faced. I first copy the patch file to /usr/src as instructed. I then use the following command to apply the patch
Code:
# patch -p1 < /usr/src/linux-2.6.18-16kstacks.patch --dry-run
which results in the following output:

Code:
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN linux-2.6.18/arch/i386/Kconfig.debug linux-2.6.18-16kstacks/arch/i386/Kconfig.debug
|--- linux-2.6.18/arch/i386/Kconfig.debug       2006-09-19 23:42:06.000000000 -0400
|+++ linux-2.6.18-16kstacks/arch/i386/Kconfig.debug     2006-09-27 13:09:54.000000000 -0400
--------------------------
File to patch:
All instructions I've seen say to move to the directory /usr/src/linux but I do not have one. All I have in the /usr/src directory (aside from the patch) are the directories "kernels" and "redhat".

So, my questions are:
Should I have a "linux" directory?
If so, any idea why I don't?
How do I get this patch applied?

I'm running CentOS 5.1 with kernel 2.6.18-53.1.14.

If anyone has an alternative suggestion as to how to get wireless networking to work I'd be very grateful to hear it.

Thanks to all in advance,
Sid.
 
Old 03-23-2008, 08:27 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,127

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
You need to load the full kernel source tree - the Centos (Redhat) patched tree. You need to be at the top level (of that source tree) to apply your patch.
/usr/src/linux is just a convention - a soft link to the current source tree.

Last edited by syg00; 03-23-2008 at 09:01 PM. Reason: typo
 
Old 03-23-2008, 08:56 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,999
Blog Entries: 54

Rep: Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745
More precisely if you installed the kernel-source package for your current running kernel it should be in /usr/src/kernels/$VERSION (the source tree can also be found following /lib/modules/`uname -r`/build/).
 
Old 03-23-2008, 10:30 PM   #4
sidholland
LQ Newbie
 
Registered: Feb 2006
Location: Vancouver, Canada
Distribution: ubuntu 8.1, 9.04, Mint 6, Debian 5
Posts: 14

Original Poster
Rep: Reputation: 0
OK, thanks for the advice. That got me part of the way. Now the patch is failing at another point in the script:

Code:
patching file arch/i386/Kconfig.debug
can't find file to patch at input line 22
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN linux-2.6.18/arch/i386/defconfig linux-2.6.18-16kstacks/arch/i386/defconfig
|--- linux-2.6.18/arch/i386/defconfig   2006-09-19 23:42:06.000000000 -0400
|+++ linux-2.6.18-16kstacks/arch/i386/defconfig 2006-09-27 13:09:54.000000000 -0400
--------------------------
File to patch:
Any ideas?

Cheers,
Sid.
 
Old 03-25-2008, 11:46 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,999
Blog Entries: 54

Rep: Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745
Like it says you'll have to play with "-p [number]", stripping a [number] of dir prefixes according to your location wrt the target dir. If unsure just add the "--dryrun" switch and it'll tell you waht it thinks it should be doing.
 
Old 04-05-2008, 05:37 PM   #6
sidholland
LQ Newbie
 
Registered: Feb 2006
Location: Vancouver, Canada
Distribution: ubuntu 8.1, 9.04, Mint 6, Debian 5
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for the help folks.

Unfortunately I simply could not get the patch to work, so I went for the option of recompiling the kernel and configuring it to solve the problem, but more about that in a different thread.

Cheers,
Sid.
 
  


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
Applying Kernel Patch browser Linux - Software 2 08-31-2005 06:18 AM
Applying a kernel patch.. RoaCh Of DisCor Linux - Software 2 05-07-2005 07:41 PM
applying kernel patch pirozzi Debian 1 12-01-2004 07:47 AM
applying ck kernel patch Abe_the_Man Linux - General 1 01-29-2004 11:43 AM
kernel compilation; applying patch h/w Linux - Software 11 07-23-2003 10:23 AM


All times are GMT -5. The time now is 08:04 PM.

Main Menu
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