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! |
If you what to learn a lot about the linux kerenel you could always look at Understanding the Linux Kernel
|
here you go
i wrote this guide in the most simplistic manner known, and thats about how basic as its going to get. |
:( i guess that would involve buying that book :study: ... oh well must eat first :rolleyes:
there's gotta be links on the net that have some good info... ?:confused: |
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 |
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 :D 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 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. |
thanks guys >.<
this info is awesome! |
All times are GMT -5. The time now is 07:24 AM. |