Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


2 red hat 7.1 compiling kernel source questions.

Posted on 2001-08-27
Medium Priority
Last Modified: 2010-04-21
 I am using red hat 7.1 and for some kind reason I have to recompile the kernel source. the original kernel version is 2.4.2-2. but after I finish the compile and put the bzImage in the another linux PC's /boot directory(redhat 7.1 too) then add a entry in the lilo.conf and excute lilo and reboot that new linux PC system with this new kernel. I found the kernel version become 2.4.2.  It is not 2.4.2-2 now.

question 1:
why it will be this way? why it won't be 2.4.2-2?

question 2:
I also did another test. I get the kernel source from redhat 7.1 CD3. and put it in my  directory say "/usr/src" and use rpm to install it. it will put the source into /usr/src/redhat/SOURCES. there is a tar file looks like the source tar ball and also many patch files for kernel. I use tar -xzvf to uncompress and extract it. and a linux source tree generated. I move this tree under the /usr/src/.
So now under /usr/src/linux already got a new source tree.
then I get in there excute
make menuconfig
make dep
make clean
make bzImage

make modules
make modules_install
then move the bzImage to /boot. modify and add a entry in /etc/lilo.conf. excute lilo
then I reboot system. I found the new kernel which I just compiled version is 2.4.2 too. it is not original 2.4.2-2.
I doubt that is becoz I didn't run all those kernel patch files so it won't become the latest version 2.4.2-2?
is that correct? if so then how to run all that patch files?
Question by:netskywalker
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +1

Expert Comment

ID: 6449208
I don't know much about Red Hat, but I have heard before that the Linux source tree that comes with it is not the source that was used to build the kernel that comes with it.  Not without extra work on your part, anyway.

I assume your authority for what version of the kernel you have is the "uname" program.

You can quickly tell for what kernel version your source tree is by looking at the first few lines of the file "Makefile" in the top Linux source directory.  There are variables there that set the "2.4.2" or "2.4.2-2" or whatever.  If you don't see what you want, don't waste your time compiling the kernel!

Maybe you don't really want 2.4.2-2, though.  As long as you're rebuilding, maybe something like 2.4.8 would work as well or better (get various Linux kernels from  

Expert Comment

ID: 6450595
1. there are two different packages my friends.
one is kernel-source.i???.rpm and then there is kernel2.4???.src.rpm
if you install the kernel-source one, you don't need to do anything elese, if you install the other one, little should be done.  All *.src.rpm packages will install but not patch until you run "rpm -bp *.spec" under /usr/src/redhat/SPEC directory.  that will take the tar ball, and patch it with all the patches and create your directory under /usr/src/redhat/BUILD.
all you need it the kernel-source-2.4.???.rpm.
then build.
Your build procedure is okay except your should "make mrproper" first before menuconfig.
1.1.  to make an image for another box, check with the INSTALL document.
1.2.  you just can't copy the  bzImage to another pc, there are modules that are loaded for that specific kernel, usually under /lib/modules
2. you can make your kernel say whatever you want. My advice is to rename it until you fully test it.
edit the Makefile and you will see EXTRAEXTENTION, add your name to it, 43for simple any letters.
so if you kernel is 2.4.2 and you add NtSkW you image will be 2.2.4NtSkW and so your modules directory under /lib/module


Author Comment

ID: 6459414
to bryanh:
I didn't see the verion inside the Makefile.
but I did see the 2.4.2-2 under the /usr/src/linux-2.4.2/version.h

to garboua:
I did as you told me. and I got the kernel-source.i???.rpm
from souce CD. and run the rpm patch program as you told me. everything work fine but the final version is 2.4.2-ac3. I also see the "2.4.2-ac3" appear in the version.h under the /usr/src/linux-new/ directory.

can I just change it to the version number in version.h as
I want and compile it again?
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.


Expert Comment

ID: 6460666
in /usr/src/linux-2.4.2, edit the EXTRAVERSION line in the Makefile.  The beginning of the Makefile look like this:


Change the EXTRAVERSION line to something like this (don't add any spaces):
Then your version would be 2.4.2-2-mine

After reboot you can do a "uname -r" which will show you the name of your kernel.

Hope this helps!

Expert Comment

ID: 6460906
Are you sure that's what you want to do?  Changing EXTRAVERSION doesn't change the version of the kernel - it changes the name of the version.  You can make 'uname' say 2.4.2-2, but it will still be 2.4.2-ac3.

But again, it isn't clear that you need 2.4.2-2.  2.4.2-ac3 may be just fine.

Expert Comment

ID: 6461253
I think you got kernel-2.4.2.src.rpm and not kernel-source.

the kernel source should not be in the source CD rom.
this version should be fine and as diamond 1 said by changing the extraversion u could fix that.  
I sugges you look for kernel-source, it should end with .i386.rpm
the kernel with ac is a result of a patch by I think "alan cole" to fix the large file system issue.  

you can go and Download the latest kernel for the REDHAT release (Roswell) which is 2.4.7-2

Author Comment

ID: 6462285
to garboua:
  sorry for my mistake! you are right what I really got the kernel-2.4.1.src.rpm.
  I will get the  kernel-source.i???.rpm from the ftp site later.
  but I still feel strange why the souce CD can not compile a kernel binary eaual to the binary kernel ship with CD? I prefer to use the source come with CD just because I will feel more safe. do you know that the 2.4.2-2-ac3 version and 2.4.2-2 version really make any difference?
If I just change EXTRAVERSION=-ac3 to "EXTRAVERSION=-2" then will it be working like the original runing kernel without any problem?

Expert Comment

ID: 6462762
Are you sure that's what you want to do?  Changing EXTRAVERSION doesn't change the version of the kernel - it changes the name of the version.  You can make 'uname' say 2.4.2-2, but it will still be 2.4.2-ac3.

But again, it isn't clear that you need 2.4.2-2.  2.4.2-ac3 may be just fine.

Accepted Solution

garboua earned 600 total points
ID: 6464029
if you want you can use the rpm command "rpm --rebuild kernel-2.4.1.src.rpm" and that will actually unpack the package, patch it and build it.  it will put the product under /usr/src/redhat/RPMS/i386
the other package IS available @ your CD 1 .

Author Comment

ID: 6471746
to:bryanh and arboua
you both give me some useful help. but I just can give one person the point. if I can decide I will give bryanh 35% and arboua 65%.because arboua give me more detail informatio. but I can not separate that points..
so I will give 200 whole points to arboua. is that ok?

Expert Comment

ID: 6472959
Sounds fair to me.

Expert Comment

ID: 6488045
sorry it took me a while getting back to the net, we had to move and restore all our system after what happend in NYC.
thank U netskywalker and for next time, if you desire to split point, create two new questions and point the people to them, and delete current one.  
As I said, sorry I could not be on to suggest this @ that time.  

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA:…
Suggested Courses

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question