Compile your own Linux Kernel ?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
scottjge
Level 4
Level 4
Posts: 250
Joined: Sun Sep 13, 2009 8:17 pm

Compile your own Linux Kernel ?

Post by scottjge »

I have a question for the Linux gods ! I am thinking about compiling the Linux kernel on my Mint 8 laptop. I am not having any problems with my laptop and everything is working fine. I thought that I would like to try compiling just to learn more about the kernel and how it works. Am I crazy or what? Should I just leave well enough alone and find something else to explore ? I am not a computer wizard yet as you can see, I am more or less a newbie yet, but I am learning and trying to become self sufficient Linux user. I have come a long ways since Windows and am striving to get better.

Would you recommend re-compiling the kernel or should I just leave well enough alone ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rich_roast

Re: Compile your own Linux Kernel ?

Post by rich_roast »

The OP will find plenty of tutorials on compiling the Linux kernel on the Internet, so this just stands as a user's personal experience of doing the same thing. There is a level of mysticism and an air of extreme technicality which seems (or has seemed to me) to surround compiling a homebrew kernel, and yet whenever I've encountered the task it's tended to go quite smoothly. The compile, and particularly the make menuconfig stage, is obviously a bit more involved than for most builds because of the level of customization that may be brought to the kernel, but then, that's sort of the point of the exercise. It would be advisable to be online so you can look up help on the Internet for any options you don't understand at this time. But other than the actual configuration stage, in my experience the mainline kernel has always built without problem, and you can install it alongside your current kernel so that you can just go back to the old one if your new one doesn't work out for some reason (caveat lector: I'd have no idea about doing this with grub2, but presumably it's doable).

I think the single greatest advantage that customizing a kernel brings is making it lighter: while the kernel supplied with a distro like Ubuntu or Mint needs to work on as many hardware configurations as possible, building your own means that you can strip out whatever you don't need, thus reducing the kernel size, its footprint and boot time. Of course, you'll want to have a fairly intimate understanding of your computer hardware before you begin.

I'd say go for it, just take your time and know what you are doing at each stage.
scottjge
Level 4
Level 4
Posts: 250
Joined: Sun Sep 13, 2009 8:17 pm

Re: Compile your own Linux Kernel ?

Post by scottjge »

Thank you both for the advise and instructions. Most of all thank you for the encouragement ! I think I will go for it. What is the worse that could happen ? If all else fails and crashes, just put the LiveCd back in start over.

Thanks again,
Glenn
Kendall

Re: Compile your own Linux Kernel ?

Post by Kendall »

scotthge wrote:Thank you both for the advise and instructions. Most of all thank you for the encouragement ! I think I will go for it. What is the worse that could happen ? If all else fails and crashes, just put the LiveCd back in start over.
Just make sure to keep the old kernel installed, so if the new one doesn't play nice you can always boot into the old one.
vrkalak

Re: Compile your own Linux Kernel ?

Post by vrkalak »

I have been using Linux-based distros for a while now ... and I have not met anyone that 'had to' compile a kernel?

Not to say 'we' haven't done it. To say, the least, it is a grand learning experience.

But, keep in mind . . . that "if it ain't broken - don't fix it."
Or as those of us, that live on the bleeding edge of Linux/Open Source, so proudly say, "if it ain't broken - I'm not trying hard enough." :lol:

When I did my share of compiling kernels, repositories and making new OS distros, last year ... I thought my computer was gonna explode. :cry:
I royally b0rked then entire system -- the Operating System, main menu, the Kernel, repositories and a few of the Apps. I did a good job. :P

Before you attempt to compile and truly learn about how Linux works, keep a few things in mind:
1. Back-up everything. Sometimes make a new back-up CD daily.
2. Keep detailed logs of what you did. You wouldn't believe my 'bookmarks' library. That you you can always back-track and correct, if you make a noticeable mistake.
3. I keep all my files/data on a separate /home partition. So 'if' I break the 'testing' OS - I've not really lost anything.

What I did was keep the Base/Core/Main Linux OS -- for me, it's LinuxMint-8, on it's own partition and have smaller 'testing' partitions with several different Linux OS installed.
Make another partition with your 'testing' OS installed -- whichever distro you choose, if it's Mint-8 make a 'testing' partition.
Have Mint-8 installed twice, if need be, no harm in that. My testing OS is: Debian Squeeze 'testing' with Xfce.

As you said, if you break the kernel and the OS -- it just takes a little time to re-install the OS from a LiveCD. And to tweak it back to where you want it.

Have fun!! :P
scottjge
Level 4
Level 4
Posts: 250
Joined: Sun Sep 13, 2009 8:17 pm

Re: Compile your own Linux Kernel ?

Post by scottjge »

Thank you for the insight, I will heed your warnings !

Thanks,
Glenn
Locked

Return to “Beginner Questions”