Question

Cannot patch linux kernel on CentOS 5.3 (Can't find file to patch at input line)

Asked by: yami_rider

I am trying to patch a Linux kernel (2.6.18 <-- 2.6.29) on CentOS. However I am getting the error message "Can't find file to patch at input line".

Steps: (CentOS 5.3)
1. Downloaded from kernel.org the patch-2.6.29 and placed this file at /usr/src/kernels
2. Performed gunzip to uncompress patch.
3. Currently there are two folders within /usr/src/kernels named (2.6.18-128.1.10.el5-i686 and 2.6.18-128.el5-i686)
4. Next I change directories into one of the above subfolders (cd 2.6.18-128.el5-i686)
5. I issue the command patch -p1 < ../patch2-6.29 and I receive an error message stating

"Can't find file to patch at input line"
The text leading up to this was:
------------------------------------
|diff --git a/,mailmap b/mailmap
|index 97f7b4f..a62e6a8 100644
|--- a/.mailmap
|+++ b/.mailmap
------------------------------------
File to patch:


I have tried this from the other folder as well. I have also reviewed most of the HOWTO faq's on the internet regarding how to patch the kernel.

Is there something that I am missing here or is the patch simply not working? Any help would be greatly appreciated.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-05-18 at 09:16:25ID24418059
Tags

CentOS patch kernel error

Topics

Linux Administration

,

Red Hat Linux

,

Linux Programming

Participating Experts
3
Points
500
Comments
7

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. CentOS
    I use CentOS. I have it installed and if I do not hit enter on the boot screen, it starts loading automatically and then I get this error: Call Trace: Code: Bad EIP value Kernel panic: Fatal exception ln idle task -- not syncing If I hit enter on the screen it boots just...
  2. Centos 4.4 Won't Boot SMP Kernel with Athlon 64 x2
    I have had a long standing problem with my Centos 4.4 box. I have never been able to boot it up the Multi-Processor Kernel. When I try it just stops and hangs during boot up. Has anyone else had this problem and do they know how to fix it?
  3. Kernel Source on CentOS 4.4
    Hi, I need to get the kernel source for CentOS 4.4 to compile a driver. Would anyone give me a step by step to this process? I have tried various things online, but I always get nasty error messages complaining about something or other. Any assistance is much appreciated, Max
  4. CentOS 5 Kernel Source
    I am installing vmware on CentOS 5. While running vmware-config.pl, the server asks what is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include] I did not install the kernel from source so I do not have the source files, h...
  5. Centos 4.5 linux panic - unable to handle kernel paging …
    Hi, this panic happened on a IBM i386 system that has been running for nearly a month with no problems. I am looking for any clues from the panic trace (below) that would point me to the cause. The OS is CENTOS linux 4.5 (RHEL 4.5 clone) Thank You. [root@support log]# cat...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: KeremEPosted on 2009-05-18 at 10:08:21ID: 24414081

You can't directly apply patches for whateverversion you have to whatever version you want. If you'll go with pathces you need to get sources from the same source and also you need to apply all the patches. You need to apply pattch 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23 up t1o 2.6.29.  

Apart from that the patches are for the standard kernels. But you have kernel patched by Red-HAT. So  even if your patch was for the 2.6.19 it would not work. You need to get a kernel source from kernel.org and go with the patches from there too. Otherwise you can not succeed.

So instead of trying to patch the kernel get the sources from the kernel.org then set compilte time oprtions before make. if you want get the configuration from your Red-HAT sources directory and issue:

make oldconfig
make
make modles

If you need make initrd and you're ready to go.

Cheers,
K.

 

by: TintinPosted on 2009-05-18 at 12:29:17ID: 24415605

Ouch!  Patching kernels manually is not to be done lightly unless you are very familiar with what you are doing.

Why do you want to patch your kernel?  Is there something specific a CentOS update doesn't cover?

 

by: ravenplPosted on 2009-05-18 at 12:34:14ID: 24415646

Why will not You get the linux-2.6.29 sources tarball - why patch?
Anyway, centos kernel(RH in fact) is heavily patched already, so applying patch-2.6.19 and next will surely fail.

 

by: yami_riderPosted on 2009-05-18 at 13:59:16ID: 24416408

The system I am working on is a test system and I am for learning purposes trying to wrap my head around the kernel.

So this is merely an excercise, but from what I can see a general rule of thumb (at least for CentOS) is that there is no need to patch the kernel.

My next question would be:

1. Assuming that you need to update your kernel, what is the best method, use the source tarball files or apply a patch?
1. When should you recompile the kernel, what scenarios would prompt someone to have to recompile the kernel?
2. Along those same lines, with respect to patching, when is it a good idea to patch your kernel?  Our mainsteam distributions (i.e. CentOS, RedHat, SuSE, etc) well maintained and therefore there is no need to tinker with applying kernel patches?

 

by: KeremEPosted on 2009-05-18 at 14:38:57ID: 24416699

You might need to update the kernel. But RedHAT kernel is highly modified form the standard. UIt is why it takes a while to be available a bit later than  the kernel sources published.

When you need to build your kernels the best practice for RedHAT is either compile the available version in that RedHAT makes available both executable and sources available. so if you need to add something you just go add and recompile.

But it you need a kernel newere than RedHAT prresents you need to go grab the kernel sources. Patches are only for people already have the previous kernel and don't have so much badwith to download again. In the end  an 2.6.20 kernel and kernel 2-6-19 and applied 2-6-10 patches ate the same thing. So patches are not add some functionality they re what makes a kernel the next release. When it comes to RedHAT you really need to know waht you're doing since they are heavily patching the kernel instead og using a stock kernel. So you need to know what the system needs this is why I'd suggested the make oldconfig to be at least compiled with same options.

Wen it comes to when to compile a kernel is some time when you need an option but it is not available as a module. For instance if you need a kernel with a higher frequency to use in hi res time processing you need to compile kernel because the only wat to modify the interrupt processing is through compiling. But when you add a new hardware you'll only need a module for the drive.

As I told earlier to patch the kernel generally means an older version into a newer version. so you need to patch the kernel when you have oledr version of sources and to add the newer functionality. There are some other cases where patches are to modify some porperties of the jkernel but they are special pathced not kernel version patches. At least none of the patches you want ot deal with in your question was of this nature.

Distro maintainers apply the patches and makes modifications so that they prepare newer versions over time so generally yeah you don't need to build your own kernel for most of the time.

 

by: KeremEPosted on 2009-05-18 at 15:10:39ID: 24416898

oops there are some typos on my previous post. First of all when I'm talking about 2.6.20 kernel and 2.6.19 kernel with patch-2.6.20 is the same thing. So in standard kernel jargon a patch means some part of code that modifies the previous version so that it updates the previous version to be the current version. So this is why if you have the spruces for 2.6.19 and you need 2.6.21 you fest apply the 2.6.20 patch to 2.6.19 and change it into 2.6.20. Then you'll apply patch 2.6.21. Another alternative to that is go and download the kernel-2.621 directly instead of struggling with patches. In both methods you'll end up with exactly the version kernel sources.

Nowadays you rarely need to compile your kernel. Because all major distros have their maintainers and they are following the changes day-by-day and they make the necessary modifications to their kernels over time. Since they are doing this for you so you won't need to do it on your own and when you need some specific things you'd better go with Distro supplied default sources not to break its integrity.

If you want to go beyond it is still ok but it takes you to turn into a kernel  developer yourself.

 

by: yami_riderPosted on 2009-05-18 at 17:27:14ID: 31582655

Thank you that answered my question.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...