How to build Custom Kernel in LMDE

Archived topics about LMDE 1 and LMDE 2
Locked
RJVB

Re: How to build Custom Kernel in LMDE

Post by RJVB »

Hello,

This worked (almost) like a treat, except that there's one difference with the "official" Mint packages. The official kernel headers are installed in separate /usr/src/*-common and /usr/src/*-amd64 trees, with /lib/modules/3.10*/source pointing to the former and /lib/modules/3.10*/build pointing to the latter. In my custom built packages, all headers are installed in a single tree in /usr/src. I presume that might be OK, but the modules source and build point both to the real kernel source directory in which I did the build. Somewhere I consider that an error because IMHO the whole point with packages is that they ought to be standalone, and not depend on the build context ...

Could it be that dpkg is "clever" to detect the presence of the full build tree and link to that instead of to the installed headers (as it would when the full build tree is not present)?

I should add that during the installation of the headers package, dpkg did complain that the corresponding /lib/modules tree was not available. Curiously I did not see this message when I installed the linux-headers-3.10-all package from the server, when it installed the rt headers (I don't have the rt kernel installed).

Another issue: somehow make-kpkg did not catch the presence of "illegal" (uppercase ...) characters in the local version string BEFORE spending hours compiling the whole thing, but only when it started to create the packages. Not fun if you have no idea that this might happen, esp. since changing the local version string requires rebuilding a significant portion of the tree (I'd say about 1/7th, around 14%). I seem to have understood from googling that this ought to have been caught at the start, any ideas why that didn't happen?

One thing that I do appreciate is that update-initramfs now takes an acceptable time. When I followed the traditional route (make xconfig && make && make modules_install install), generating the initramfs took about 30 minutes (!) on this netbook, mostly spent compressing a huge file. Size and thus generation time are now down to what they are for the distribution kernels.
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.
romanyacik

How to build Custom Kernel in LMDE

Post by romanyacik »

These are good instructions! works in main edition as well, but I've known the process take a long time.
jamaica

Re: How to build Custom Kernel in LMDE

Post by jamaica »

romanyacik wrote:These are good instructions! works in main edition as well, but I've known the process take a long time.
Try to add the -j <jobs> option to make-kpkg. Replace <jobs> by the number of cpu-cores + 1. This should speed up the build process by doing multiple jobs (makefile tasks) parallel.
Example (with 2 cpu-cores):
$ fakeroot make-kpkg -j 3 --initrd kernel_image kernel_headers modules_image
apemanx

Re: How to build Custom Kernel in LMDE

Post by apemanx »

So, just to make sure before I jump in and try this (Always wanted to).
If I build this custom kernel to its .deb format, i simply install it. Good.

Then, will there be updates in the future that I have to avoid? Or should I rebuild every time - (I wouldn't mind doing it).

how do I make sure that RJVB's comments/suggestions are included into mmix's instructions?

Thanks! Looks great this!
apemanx

Re: How to build Custom Kernel in LMDE

Post by apemanx »

Found this... 9th August post

Can anyone verify the correctness? It looks good enough for me to try?
http://www.tecmint.com/install-kernel-3-16-in-debian/
Locked

Return to “LMDE Archive”