Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Can I compile a kernel from kernel.org and later install it on another PC?
Do I lose some advantage this way?
or, kernel I compile for my computer is valid only for my computer?
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
You must download the source to the usual place, then build the kernel. The result is a .deb file which you can install on any machine. Provided of course you have not excluded any modules needed for that other computer, but those chances are slight.
And when I start compile a kernel, before compile I can add or remove modules with makegconfig.
If I dont change anything, will be compiled as the default kernels that I have in debian.org?
I have to add modules always?
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
You can exclude loadable modules. As a matter of fact, over 90% of the compiled modules are not needed for a particular machine. The trick is to determine which modules you don't need. Both lsmod and lspci do not give you a one-to-one relationship between hardware, module name on one side and the config name on the other side. It is easy to exclude the wrong modules from compiling.
On the other hand, compiled loadable modules only use disk space and compiler time. They are not loaded at boot time.
This is different for compiled-in modules, which make the kernel larger and make the kernel longer to load.
However you must have good reasons to want to exclude compiled-in modules and really know what you are doing.
So, thats not bad idea to select modules as "m"
So, if someday you need one, you can just enable it.
Because if you dont have it, you must compile your kernel again, is that right?
I mean, if you miss some modul, you cannot just add it, if before, at least you havenot marked it as "m"
Is that correct?
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
If you did not include a module you must recompile your kernel. However, I believe that only the missing module is compiled. All other modules are already compiled and if you have not changed anything else, the kernel make process might decide it only has to compile the added module. So only the missing modules are compiled and a new .deb file is produced.
That is how it should work. I do recall however that in the past I have seen the entire tree was recompiled after I added a module. I don't recall if I did something stupid or that the Debian tools recompile everything by default.
The name of the kernel can be altered in "General Setup" near the very start of the configuration. Enter a string for LOCAL_VERSION and that will be the internal name of the kernel.
As for a manual, there probably is one, or probably MANY of them, but I don't have a good link to give you unfortunately. I usually use "make xconfig" and just go with the documentation that this provides built-in. Also, there is LOADS of documentation inside the /Documentation folder inside the kernel source, and it is probably most current with whatever kernel version you are working with.
And yes, you can use whatever name you like in that LOCAL_VERSION thing. I usually use a combination of the kernel version, plus a build version.
After installing the new kernel, do I have to delete the folder, in which I extracted the kernel from kernel.org?
I mean, I downloaded the sources from kernel.org and extracted in /home/miros/kernel
After compiling the kernel, can I delete folder /home/miros/kernel?
I need to keep it?
Uhhhh.. Well, if the kernel you made is for another machine anyhow, and on that other machine, nothing will be compiled against the kernel sources, then yes, you can delete it.
However, I feel I should mention that, usually, the kernel sources are KEPT after compiling, for the reason mentioned: you will need it to compile anything against the kernel (such as nvidia driver or whatever).
In short: copy the new kernel image, and the modules directory, over to the destination machine. And delete the sources off your build machine.
EDIT: Or, copy the sources over to the other machine too, just incase
Last edited by GrapefruiTgirl; 01-27-2010 at 03:38 PM.
Good info.
i use to install nvidia driver.
And if I copy the source to other PC, how this other mashine will know where I copied the source?
I need to put it somewhere?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.