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
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?

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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.
Cron is one of the most popular and basic utilities found on Unix systems. Combined with other tools, cron makes it exceptionally easy to automate a broad range of tasks on your server.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

612 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