LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-31-2003, 12:13 PM   #1
figmentium
Member
 
Registered: Mar 2002
Location: Alberta, Canada
Distribution: Debian 4.0 Etch
Posts: 64

Rep: Reputation: 15
need info about compiling


Hi,

I've been trying to dig up documentation and links to find somewhere that actually explains fairly well about compiling a kernel.

I really don't understand it, how it works or why you have to do it.

I'm learning and doing fairly well in progressing in the world of linux and I administer two boxes, one at home with RedHat 7.3 and one remotely with RedHat 8.

I'm running counter-strike servers on the box with RedHat 8, and some of the hlds updates say compiling would help with CPU usage.

I really have no clue about compiling. If anyone has any links for documentation on what it means and how it works, it'd be greatly appreciated... even if you could explain here that'd be even better... ;D

Thanks muchly!
 
Old 07-31-2003, 12:23 PM   #2
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Rep: Reputation: 45
If you what to learn a lot about the linux kerenel you could always look at Understanding the Linux Kernel
 
Old 07-31-2003, 01:00 PM   #3
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
here you go
i wrote this guide in the most simplistic manner known, and thats about how basic as its going to get.
 
Old 07-31-2003, 01:02 PM   #4
figmentium
Member
 
Registered: Mar 2002
Location: Alberta, Canada
Distribution: Debian 4.0 Etch
Posts: 64

Original Poster
Rep: Reputation: 15
i guess that would involve buying that book ... oh well must eat first

there's gotta be links on the net that have some good info... ?
 
Old 07-31-2003, 06:45 PM   #5
figmentium
Member
 
Registered: Mar 2002
Location: Alberta, Canada
Distribution: Debian 4.0 Etch
Posts: 64

Original Poster
Rep: Reputation: 15
thanks Drozz, but does that support RedHat 8?
because it looks like its slackware oriented??

and how safe is it to do this when i'm not near the machine and its like a few thousand miles away?

otherwise your post looks awesome
i hope i can try it without blowing up my server box! ;D
 
Old 07-31-2003, 10:45 PM   #6
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
its not one bit in no way in any fashion slackware oriented, i actually wrote that step by step while compiling a kernel on redhat 8, so that seems like it will suit you just fine enjoy!
 
Old 07-31-2003, 11:05 PM   #7
figmentium
Member
 
Registered: Mar 2002
Location: Alberta, Canada
Distribution: Debian 4.0 Etch
Posts: 64

Original Poster
Rep: Reputation: 15
i was browsing thru and started getting skittish when i started seeing words like slackware :P

but that's great, i'll try it out this weekend
thanks muchly Drozz!

and i guess i'll have to get that book or find a site that explains WHY one has to do this... to "optimize" (if that's the right word).. their kernel...
 
Old 07-31-2003, 11:48 PM   #8
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
you'll find numerous threads on this site that talk about this very thing, you will find answers on how you might see a slight performance boost, and you'll find some that say it doesn't make all that much of a difference, and you'll read things such as if you have a kernel that is patched with the latest updates then there is not much need to re-compile....you'll see various point of views, so just give a search on this site, and i am sure you'll find some answers.
 
Old 08-01-2003, 01:35 AM   #9
haobaba1
Member
 
Registered: Jul 2003
Location: VA Tech
Distribution: Mandrake 9.1
Posts: 73

Rep: Reputation: 15
here are the instuctions given to our class last semester where we were required to install a new kernel and modify it. It took me several tries but went off without a hitch(meaning I didn't blow up my hard drive). If you decide you don't want the new kernel and want to revert back then you can remove the entry from the lilo configuration and delete the new kernel.:

CS 3204: Operating Systems - Spring 2003
Kernel Configuration
You should try compiling the kernel and booting your machine from it as the first step before you start modifying the kernel code. Doing this should indicate to you the time required for compiling the kernel on your machine.

You can download the entire kernel source code from here. Use the 2.4.19 source code for this project. This is a stable version of the Linux kernel. Once you have downloaded this file, unzip and untar it in some directory. Assume that this directory is /src. A subdirectory with the name linux-2.4.19 should be created for you within this directory. Follow the steps given next to create/configure a new kernel from these source files and then install it on the LILO bootloader to be able to boot your machine using it.

1. You need to configure the kernel before compilation based on your hardware setting. You have several options to perform this. You can do use
*

make config

This option presents you with command-line based line-by-line configuration options. You have to select the appropriate options based on your hardware.
*

make menuconfig

This is ncurses based configuration.
*

make xconfig

This is based on TCL/TK X-windows.
2. After performing the configuration, set the dependencies using

make dep

3. Now compile the kernel and compress it using

make bzImage

This process typically can take upto an hour depending on the speed of your machine.
4. After you are done with this step, make any driver modules that you might have selected in the earlier step using

make modules

5. Install the modules using

make modules_install

6. Install the new kernel by doing

cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.19-os
cp System.map /boot/System.map-2.4.19-os

7. Edit the /etc/lilo.conf file to add the following lines. The label=os line is necessary to identify the kernel to be selected when the machine boots up.

image=/boot/vmlinuz-2.4.19-os
label=os
root=/dev/sda1 ******* WARNING: COPY THE PREVIOUS ENTRIES FOR "ROOT=" IS DEPENDENT ON THE NAMES OF YOUR PARTITIONS. DON'T PUT THE WARNING IN THE FILE.

append="quiet devfs=nomount"
read-only

After adding these lines, my /etc/lilo.conf file looks like this

boot=/dev/sda
map=/boot/map
install=/boot/boot.b
vga=normal
default=linux
keytable=/boot/us.klt
lba32
prompt
nowarn
timeout=50
message=/boot/message
menu-scheme=wb:bw:wb:bw
other=/dev/fd0
label=floppy
unsafe
image=/boot/vmlinuz
label=linux
root=/dev/sda1 WARNING: COPY THE PREVIOUS ENTRIES HERE THIS IS DEPENDENT ON THE NAMES OF YOUR PARTITIONS.
initrd=/boot/initrd.img
append="quiet devfs=mount"
vga=788
read-only
image=/boot/vmlinuz
label=linux-nonfb
root=/dev/sda1
initrd=/boot/initrd.img
append="devfs=mount"
read-only
image=/boot/vmlinuz
label=failsafe
root=/dev/sda1
initrd=/boot/initrd.img
append="failsafe devfs=nomount"
read-only
image=/boot/vmlinuz-2.4.19-os
label=os
root=/dev/sda1
append="quiet devfs=nomount"
read-only

The previous three images were from previous installations of Linux. I added the last image.
8. Run /sbin/lilo to initialize the LILO bootloader with your kernel.
9. You need to reboot your machine now. During the process of booting up, Mandrake will prompt you to select one image to select from the list that you specify in /etc/lilo.conf. Select os as your choice and your machine should boot up with your newly installed kernel!
10. Important note 1: Do not delete the lines that already exist in the /etc/lilo.conf file. That way, if something goes wrong with your kernel image, you always have the option of rebooting your machine and selecting a previous working version of the kernel.
11. Important note 2: Do not delete the versions of the kernel that you already have on your machine. These files typically reside on your machine in the /boot directory. The kernel image files typically start with the name vmlinuz.
 
Old 08-01-2003, 01:44 AM   #10
figmentium
Member
 
Registered: Mar 2002
Location: Alberta, Canada
Distribution: Debian 4.0 Etch
Posts: 64

Original Poster
Rep: Reputation: 15
thanks guys >.<

this info is awesome!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert an info file(bash.info.gz) to a single html file Darwish Linux - Software 2 09-24-2005 06:51 AM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM
Compiling in ACPI support on Compaq 2135CA (system crashes while compiling) Dag Linux - Laptop and Netbook 20 07-30-2004 07:56 PM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM
Just info ..... c0rk3y *BSD 1 05-03-2002 05:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration