custom kernel compile

Suggestions and feedback for Linux Mint and the forums
Forum rules
Do not post support questions here. Before you post read: Where to post ideas & feature requests
Post Reply
kneedragon1962

custom kernel compile

Post by kneedragon1962 »

I've got the very fuzzy early stages of an idea. Or, more accurately, I want to do something, but I'm not quite smart enough to do it myself.

What I'd like to do, is download an install ISO, let's say Mint, or Ubuntu or something, and run the install, get it working, and then do the heavy-duty optimise. I want to get a complete linux kernel source, either the source for the generic kernel that the installer grabbed, or maybe download the most recent stable edition from kernel.org, and then fire up my rocket-science tool and compile a custom kernel. My beautiful assistant will now make a list of all the hardware she can see in this computer, now, and add to that list anything which just should be there in any and all working Linux kernels, and prepare a .config file to suit. It would warn the user that if she wanted to add some other stray piece of equipment, like that old Canon printer, then now would be a real good time to plug it in... So maybe next it would make a kernel from the source that included drivers and modules for pretty much everything, and install that, and prompt her to shut down and restart, and then it would go through all the modules and drivers and stuff it had, and tick off the ones it found equipment for, and remove anything that it saw no trace of. The trick, the catch, is knowing what you can take out and knowing what has to be there or the machine (any machine) is simply not going to run. Then it could write a new, leaner meaner .config file, and go through the build process again, and give you a custom kernel that has all the bits and bods for your computer, and leaves out all the weird & wonderful stuff that's still there, because some people still use PS2 mice...

I want a tool that walks you through making a custom kernel, using recent source, but removing all the stuff you don't need. Then maybe helps you install it, in case you forget or can't read or something...

There are a number of good arguments against this, starting with the idea that if your machine has the computational horsepower and resources to compile a custom kernel, perhaps twice, then it has the resources to install and use a generic kernel and don't be a goose doing this stuff... You are introducing 37 different points where you may break things, for a build that is going to have to re-done anyway, the first time they plug in a different mouse...

The expert part of this, is knowing what to take out and what to leave in.... The Linux kernel is like any other piece of software - it's subject to bloat. There is a way around that, but it requires real expertise to use it properly. I want to simplify the process, and guide chumps like myself through it so they don't chop their left foot off with the axe...

Menuconfig is a nightmare. It was a nightmare in 1998 the first time I tried (and failed) to use it, and it has been a nightmare ever since.
Windows does this kind of stuff more or less automatically. (Kind-a, anyway) and Windows sucks. But doing this in Linux, now, requires real expertise....
The concept, is start with a generic kernel that has drivers & modules for pretty much everything, all the stuff that's reasonably common anyway. Then sort through and mark everything that doesn't get used. Then remove it, and build the kernel again, with only the things it needs. Now make that a whole lot easier to do...
deepakdeshp
Level 20
Level 20
Posts: 12337
Joined: Sun Aug 09, 2015 10:00 am

Re: custom kernel compile

Post by deepakdeshp »

We get more and more powerful computers with powerful CPUs and larger and larger memory.
So why would one remove the so called bloatware when the hardware is perfectly capable of handling it
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: custom kernel compile

Post by jimallyn »

You could probably find some useful information at these two sites:

https://gentoo.org/

http://www.linuxfromscratch.org/index.html
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: custom kernel compile

Post by catweazel »

kneedragon1962 wrote: Tue Jun 05, 2018 11:05 am Menuconfig is a nightmare.
Welcome to compiling your own kernel. The only other way is to edit the .config yourself with a text editor.
Windows does this kind of stuff more or less automatically. (Kind-a, anyway)
Nonsense. With Windwoes you get what you're given.
But doing this in Linux, now, requires real expertise....
Yes, real expertise in simple, everyday reading of the information displayed by menuconfig, and expertise in making simple, everyday yes/no decisions.
The concept, is start with a generic kernel that has drivers & modules for pretty much everything, all the stuff that's reasonably common anyway. Then sort through and mark everything that doesn't get used. Then remove it, and build the kernel again, with only the things it needs.
That's what menuconfig is used for. Copying the existing kernel's .config being the first step.
Now make that a whole lot easier to do...
Linux is open source so there's nothing stopping you from pulling the menuconfig code and working out how it treats the kernel .config and writing your own GUI.

It seems all this boils down to you not wanting to use menuconfig, so my vote is -1.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
kneedragon1962

Re: custom kernel compile

Post by kneedragon1962 »

Catweazel, these are all fair criticisms, and I can't point to a singe fault. I can't argue with you.
In 1985, I was using DOS and looking to get Windows for Workgroups. It's not that I liked them, they were simply what we had. What we have now, 30+ years later, is much better.
In 1998, I had my first go at compiling a custom kernel, using pretty much exactly the tools we have now. I tried for 5 days and failed, miserably.
About 3 months ago, I had another go at it. This time, I didn't try to edit or change or customise anything, I simply copied the config for the current kernel, and then opened it with menuconfig, saved it, and left again. That does work.
What I'm requesting, as an old doofus, is something to hold my hand and whisper soft reassurance in my ear, while it leads me through that dark paths of Mordor...
It doesn't need to be GUI, it just needs to be slightly easier to use than the menuconfig, which doesn't look to me as if it's changed in any way in the last 20 years...
I could still be using DOS and Win-3.11, but thankfully I'm not.... We've seen change and evolution and improvement, and things have gotten a whole lot better.
kneedragon1962

Re: custom kernel compile

Post by kneedragon1962 »

jimallyn wrote: Wed Jun 06, 2018 2:58 am You could probably find some useful information at these two sites:
https://gentoo.org/
http://www.linuxfromscratch.org/index.html
Thank you Jim.
LOL - You're the second person who's pointed me at Linux From Scratch in the last year... If I hadn't proven to be quite such a digital & technical idiot, I might try it... I am perhaps ready to lance a blister, and maybe use a makeshift splint to get someone back to civilisation, make an assault on an ingrown toenail. I'm not ready to scrub up and perform surgery. That's a little bit over my head.
Post Reply

Return to “Suggestions & Feedback”