[SOLVED] How to compile a new 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
chipps61

[SOLVED] How to compile a new kernel?

Post by chipps61 »

Didn't really know where to put this, but since I'm a 4 month newbie after years away from Linux... here seems appropriate.

I've spent the last several nights trying 5 different tutorials for how to compile and install the latest kernel from kernel.org, simply as a learning experience, not because I really need it. I know I could go to http://kernel.ubuntu.com/~kernel-ppa/mainline/ and just nab the most recent precompiled ubuntu kernels and save a few thousand steps, but the idea was to nab the source, use the config from my existing Mint 8 main edition install as a base, and do a custom compiled kernel that I could choose at boot time through Grub2, to have the option to boot into my Mint installation with one of the most recent kernels.

So that's the objective.

My first inclination was to just download the most recent stable source from kernel.org and then find something online to help me through it, so I tried that first and found several tutorials for that very thing, but all were sufficiently outdated to the point of near uselessness, and the readme included with the source is sufficently generic to not be of any real use to someone at my skill level.

I had various levels of success with the online tutorials I found, but to date nothing has gotten me anything usable. Tonight I got the closest... by following this guide: (https://wiki.ubuntu.com/KernelTeam/GitKernelBuild) I got as far as actually getting everything compiled, and failure only happened while attempting to make the .debs for install.

The error at the end after a couple of hours of compiling was (captured from the terminal window):

Code: Select all

====== making target debian/stamp/install/linux-image-2.6.34-rc5-custom [new prereqs: ]======
This is kernel package version 11.015.
echo "The UTS Release version in include/linux/version.h"; echo "	   \"\" "; echo "does not match current version:"; echo "	   \"2.6.34-rc5-custom\" "; echo "Please correct this."; exit 2
The UTS Release version in include/linux/version.h
	   "" 
does not match current version:
	   "2.6.34-rc5-custom" 
Please correct this.
make[1]: *** [debian/stamp/install/linux-image-2.6.34-rc5-custom] Error 2
make[1]: Leaving directory `/home/chip/linux-2.6'
make: *** [kernel_image] Error 2
If that's too much to follow, pretty much anything someone's found for step by step on compiling/installing to grub2 that actually works would be helpful... and thanks for looking. :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
vrkalak

Re: How to compile a new kernel?

Post by vrkalak »

You might try checking out these Forums topics on this same subject, first.

http://forums.linuxmint.com/viewtopic.p ... el#p268618
http://forums.linuxmint.com/viewtopic.p ... el#p266162

They are very helpful.

*The way you were doing it, just makes it more complicated than it needs to be.

I upgraded my Linux Kernel, too.
chipps61

Re: How to compile a new kernel?

Post by chipps61 »

Thanks, read both those threads (and several others) before posting in the first place. Will keep at it.
piratesmack

Re: How to compile a new kernel?

Post by piratesmack »

I've edited my post that vrkalak linked to above.
It's now more of a step-by-step guide, you may want to re-read it.
chipps61

Re: How to compile a new kernel?

Post by chipps61 »

piratesmack wrote:I've edited my post that vrkalak linked to above.
It's now more of a step-by-step guide, you may want to re-read it.
Your post here was very helpful: http://forums.linuxmint.com/viewtopic.php?f=90&t=46595 and the installation was successful from the partially completed work I'd already done with 2.6.34-rc5. Thank you very much, marked as solved, and the above link duly bookmarked.
Locked

Return to “Beginner Questions”