Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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!
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...
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.