The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
telnet idle timeout on Redhat kernel 2.4.35.4 jing han Red Hat 0 05-12-2008 03:59 PM
RedHat: Important: kernel security and bug fix update iBot Security Advisories (RSS) 0 05-07-2008 09:10 AM
compile a new kernel in RHEL 5 vikas027 UNIX for Advanced & Expert Users 1 02-05-2008 05:14 AM
Dual Xeon 2.6, RedHat EL 4 ES, up to latest release version. 2.6.9 kernel Garp Linux Benchmarks 2 08-01-2005 10:01 AM
compile C under linux? ctchung High Level Programming 2 09-20-2001 10:26 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-21-2008
bhattbonny bhattbonny is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 2
how to compile linux kernel on redhat

Hello,
Please let me know how to compile a linux kernel on redhat. I am relatively new in this area so please be a little patient with me. Here is the file I was consulting with the following details:
Compiling the Linux Kernel on Redhat 7.1

This page describes how to install the latest Linux version 2.4 kernel on Redhat 7.1. In particular, it describes how to compile the official kernel sources with Redhat's default configuration.
Motivation

It can be quite tricky for a typical Linux user to configure the official linux kernel source from www.kernel.org to work with Redhat. For example, I once compiled a kernel that didn't work with my sound card. The best way to avoid such headaches is to get the kernel source config file from the Redhat source RPM, and to use this config with the official kernel source from kernel.org. The following instructions outline how this can be done. I suggest using this guide as a supplement to the usual documentation, not as a replacement.
Download the Sources


  • Download latest stable kernel source from kernel.org. Don't try to compile the same version that you are already using unless you know what you are doing, or you risk messing up your kernel modules. You can figure out what kernel you are already running with $ uname -r
  • Unpack the sources. Older versions had to be unpacked in /usr/src, but now days you are probably better off compiling the source in your own home directory logged in as a normal user. $ tar xzf linux-2.4.3.tar.gz
  • You can get the config files from the kernel source RPM. Unfortunately, this implies installing over 100 MB of kernel source just to get a single 30 kB file. Be aware that there are two different source RPMs, i.e. kernel-xxx.xxx.srpm and kernel-source.xxx.xxx.rpm. Once you have these files, it is probably possible to uninstall the source RPM to save disk space. To save you the time and hassle, here are the config files for kernel 2.4.2, as shipped with the Redhat 7.1 source RPM. $ tar xzf configs.tar.gz
Configure


  • In top directory of your kernel source from kernel.org, run $ make mrproper
  • Copy the most appropriate config file for your system into .config in the top directory of the kernel source. $ cp configs/kernel-2.4.2-i586.config linux-2.4.3/.config
  • Your config file is for an older version of the kernel, and so must be updated. The following command will only ask questions about new features. Most of the time you can safely leave out these new features unless they specifically interest you. $ make oldconfig
  • As configured, your kernel and modules will support a huge variety of hardware and features that you don't need. You might want to turn off some of things to speed up the compile and save disk space. Or you may want to enable some feature that was turned off in the default. To do so, run $ make xconfig
  • Make a backup copy of .config. $ cp .config ~/backup-kernel-config
Compile the kernel and modules


  • This part is easy. You'll have plenty of time to go get a cup of coffee.... $ make dep
    $ make bzImage
    $ make modules
Install your new kernel


  • Up to now, you have hopefully been logged in as a normal user. Now you'll need to become root. $ su
  • Copy the kernel into its final destination. Don't overwrite your working kernel!!! # cp ~user/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.4.3
  • Install the modules. # make modules_install
  • Edit /etc/lilo.conf so that you can boot the new kernel. Don't take out the lines for your working kernel until you have booted the new one!!! In the following example, you'll probably have to change the location of the root partition. image=/boot/vmlinuz-2.4.3
    label=linux-2.4.3
    read-only
    root=/dev/hdc2
  • Run lilo # /sbin/lilo
  • If you want a rescue disk, do $ make bzdisk
continued: I went to the kernel.org site downloaded the the latest stable version of linux, untarred the file, I also downloaded configs.tar.gz and untarred it. i am now confused, what to do next? Thanks in advance. What is the top directory of my kernel source, getting a bit confused from hereon. Please explain or you can explain the whole process from the beginning. Also I am not working with linux 7.1, but with Linux 4.0, however, i am hoping they would be same. Thanks!
 

Bookmarks

Tags
linux download, solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:38 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0