Red Hat custom Kernel compilation mini-How-To for Red Hat 8-9
Red HatThis forum is for the discussion of Red Hat Linux.
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 have some additional questions regarding the difference between kernel modules and compiling into kernel. For example: should the different ACPI modeules like processor, fan and battery be compiled into kernel or should those be set as modules and is there some kind of a referance document which specifies the correct setting for difftent options or is it just a “personal preferance” whether something will be a modele or part of the kernel.
And thank you for the great guide to comiling the kernel. I am firly new to linux and without this guide I would probably never attempt to compile my own kernel.
It is most adviseable to compile as many things as you can as modules, in that way, you can stop execution of that particular kernel code at run-time, by simply un-loading such a module, whereas compiled directly into the kernel, if the module fails, you most probably would have to re-boot your computer in order to get your system back to normality.
As for documentation, I''ve been unable to find more than that supplied by the kernel itself, either in the form of Help tid bits, or in the Dcumentation directory (which is, needless to say, adviseable for you to read).
Regarding your question about ACPI, compile just as modules... remember to keep your core kernel as light as possible.
Thanks man...to remove the kernel I used the script you made on that other thread and it was easy as nothing... then I edited the grub.conf and now it's back to normality... btw, what do you advice redhat users to do when it comes to compiling or patching the kernel? should we just stick to the kernel available thru up2date (for some reason redhat upgrades kernels realllly slowly) and just compile any features we want onto the current kernel?
As a matter of fact, I only would recommnd any Red Hat user to compile their own Vanilla Kernel in the event that there are problems with the current official Red Hat kernel, you have either a device that is not working or it's working un-properly, or simply if you are (like me) a hard core gamer, who wants the most out of your system, and you simply like Red Hat way of things (you could always try another distributions, like Gentoo, for instance).
I really compile my own kernel due to two things: Some of my hardware works best with the most recent kernel drivers (needless to say that two versions behind wont help much), and because there are known issues with official Red Hat kernels and some gaming situations, most noticeably WineX and some old DXdraw games (StarCraft, WarCraft II, even Diablo; or Monkey Island 3, etc, etc); and you come to the conclusion it is because of a kernel problem that lags these processes and gives them less priority. Again Red Hat sacrifices speed for stability (which for most enterprise/Home users is OK, just not for gamers). That is why I compile my own kernels
Well i haven't try it all ready (it's too lait and in a few hours a have a school to go to) but, i can assure you i will make a kernel compilation next thing after school. I had a couple of failed recompilation of kernel my self (no sound, no 3d hardware acceleration, no 32 bit colour depth).
In short: YEAH, WE NEED THIS KIND OF POSTS! AND THANK YOU!
I've tried while logged in as root as well as my normal user and I'm recompiling under redhat 9. I've search around on google and alittle on this forum but I'm pretty new to recompiling so my apologies if I overlooked the answer already.
I'd say to check your installation. Especially the tools tk/tcl, needed by the GUI when building with make xconfig. Depending on your istribution you may have or not a GUI tool for this:
On Red Hat 7x GnoRPM
on Red Hat 8-9 redhat-config-packages
You may also need to re-install those packages. To me the error is due to a misconfigured or not installed tk/tcl.
I finally had a first succes on compiling a kernel and i'm so very happy! Thank you Thetargos! I had many problems, even after reading all the things you said, but i finally managed to do it after i logged in as root from the begining, and compilled the kernel in the /usr/src directory. In any other combination... i failed (... and offcourse... that was the last one i tryied ). Was it the fact that i keep my users partition on different partition than the root one? I started to believe it is so. Maybe you could give me an answer, cause i got none other than this one. And ... come on... i gave the same commands every time (nobody can be that stupid...).
After many many hours off hard work and reading i managed to succesfully compile my kernel and include sound and after that to finally listen some music. If tommorow i manage to have my linux play some movies...then... a 60 GB partition goes to Linux.
Thank you all ( even if i have not mentioned you... i learned a lot by just reading your posts.)
Originally posted by under I finally had a first succes on compiling a kernel and i'm so very happy! Thank you Thetargos! I had many problems, even after reading all the things you said, but i finally managed to do it after i logged in as root from the begining, and compilled the kernel in the /usr/src directory. In any other combination... i failed (... and offcourse... that was the last one i tryied ). Was it the fact that i keep my users partition on different partition than the root one? I started to believe it is so. Maybe you could give me an answer, cause i got none other than this one. And ... come on... i gave the same commands every time (nobody can be that stupid...).
After many many hours off hard work and reading i managed to succesfully compile my kernel and include sound and after that to finally listen some music. If tommorow i manage to have my linux play some movies...then... a 60 GB partition goes to Linux.
Thank you all ( even if i have not mentioned you... i learned a lot by just reading your posts.)
You are welcome. And regarding you question, I also have my home partition appart from the main root (/) partition, and every attempt I have made to compile from there succeded... the problem to me is that you were taking all steps at the same time, so ofcourse the installation would fail, because it would need root priviledges to write into the /boot partition. In a future kernel build, you may try to compile just the modules (without installation) as a user and then just as root:
Code:
make modules_install install
Because both methods require writting to restricted sections (/boot and /lib/modules), I think that is why you were unable to compile as user
Thought about it... not the case. Maybe even worse for an experienced linux administrator, i made all the steps as root (normal user then su ). Could this be becouse my everyday account is a normal one and doesn't have any special privileges (as your personal normal user might have). It's just a theory... i know i don't have the knowledges to have too much fait in what i'm thinking, so please reply one more time.
Originally posted by under Thought about it... not the case. Maybe even worse for an experienced linux administrator, i made all the steps as root (normal user then su ). Could this be becouse my everyday account is a normal one and doesn't have any special privileges (as your personal normal user might have). It's just a theory... i know i don't have the knowledges to have too much fait in what i'm thinking, so please reply one more time.
Thanks.
I don't think so... but I would normally do this (from my home directory):
Code:
$ cd Kernel/linux-2.4.22
$ make xconfig
$ make [clean] dep modules bzImage
$ su
password:
# make modules_install install
# reboot
As I stated in the guide depends on what I'm doing if I clean the source tree or not, so assuming I'm re-compiling a currently running kernel, I'd alway clean the source tree (even though normally I would also clean it after installing the kernel), but since I most likely won't remember, I re-clean As a normal user that is how I do it. There were times when I had trouble by doing this, and instead of having the kernel in my home directory, I would simply download as user and then copy the .tar.bz2 to /usr/src and then re-do all as pure root (i.e ctrl+alt+F1, login as root, init 3, cd /usr/src/, tar-jxvf ..., cd ..., make menuconfig, etc, etc).
Anyway... now i have sound, i have movies, i have true color ... so ...bye bye win xp!The next step for me is to make another kernel compilation, one that would soothe my needs. So i'll keep what you said in mind.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.