Redhat Linux 7.3 Kernel Compilation

Posted on 2003-02-24
Medium Priority
Last Modified: 2010-04-20
Does anyone here know how to compile a kernel?  i'm trying to compile a kernel that running on less storage capacity.  please tell me the steps involved.
Question by:bubuchacha
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
LVL 10

Expert Comment

ID: 8015111
The kernel source tree is usually installed in /usr/src/linux (which is a symlink to the kernel version).
The kernel uses the Makefile system, so all you have to do is make config, make dep, make modules & make modules_install

Read the HOW-TO on Linux Documentation Project.

Good luck.
LVL 17

Expert Comment

ID: 8015742
"kernel that can run on less storage capcity"
Do you mean you are trying to compile a very small kernel so it will fit on a floppy or maybe even smaller?
I'm not sure what the smallest kernel is that you could possibly compile, but here are some pointers.

a) You need the kernel source installed on you system before you can do anything. On a RedHat system, you can install the kernel sources from the distribution cd, or you can download the latest kernel source from www.kernel.org.

You should install/unpack it to the /usr/src folder, and update either your linux or linux-2.4 symlink to point to the new folder which will be called something like: "linux-2.4.18-24.8.0" or whatever version you downloaded.

b) cd into that folder and then run make menuconfig, make config or easiest make xconfig.

Now, in order to keep your kernel to the minimum:
ONLY select the stuff that you really need, and for those that you really need, compile as much as possible as modules.

Now do make dep
make clean
make modules
make modules_install
make bzImage

This will build your new kernel into the /usr/src/linux-2.4.xx/arch/i386/
boot and it will be called bzImage.

Now you need to copy the bzImage file (which is your kernel) to the /boot partition and you need to make changes to your grub/lilo config to boot it.

You will also probably need to make a new ramdisk for this kernel, specially if you have scsi controllers etc that need to be loaded before the filesystems are mounted.
You can check the man pages for mkinitrd to read more on this.
You can also read the man pages for mkbootdisk in order to write your kernel to a bootfloppy.

Author Comment

ID: 8039890
thanks for the compilation steps mail by psimation and elfbin.

my requirement for the new linux kernel capacity will be as low as possible. (i heard it can be boot from 64KB)

and hopefully it can be boot from USB flash storage.  does it need any extra modules, or the linux kernel 2.4.x already have the module that allow the kernel to be boot from USB flash storage.

if it does need extra module, does anyone know what module it is?
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

LVL 10

Expert Comment

ID: 8040652
I'd suspect, you'll at the very least need the the USB modules, like usb-uhci etc.....

Best of luck.

Expert Comment

ID: 9087872
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
LVL 12

Expert Comment

ID: 9259905
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is to:

Be PAQ'd/Points No Refunded

Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Accepted Solution

RomMod earned 0 total points
ID: 9325438
Finalized per recommendation.

Community Support Moderator

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to moveā€¦
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

800 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