How to build Custom Kernel in LMDE

Write tutorials and howtos in here
More tutorials here
Forum rules
Do not start a support topic here please, Before you post please read this

How to build Custom Kernel in LMDE

Postby mmix on Sat Jul 06, 2013 11:20 pm

$ sudo apt-get install build-essential ncurses-base ncurses-dev fakeroot kernel-package

# download kernel source
$ wget ... .10.tar.xz

$ tar xf linux-3.10.tar.xz

$ cd linux-3.10

$ cp /boot/config-3.2.0-4-amd64 .config

$ make oldconfig

<hit "Enter" Key until meet the shell>

$ fakeroot make-kpkg clean

$ fakeroot make-kpkg --initrd kernel_image kernel_headers modules_image

$ cd ..

$ sudo dpkg -i linux-headers-3.10.0_3.10.0-10.00.Custom_amd64.deb

$ sudo dpkg -i linux-image-3.10.0_3.10.0-10.00.Custom_amd64.deb

Level 2
Level 2
Posts: 62
Joined: Tue Oct 09, 2012 11:02 am

Linux Mint is funded by ads and donations.

Re: How to build Custom Kernel in LMDE

Postby RJVB on Mon Jan 06, 2014 4:48 am


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.
Level 2
Level 2
Posts: 54
Joined: Tue Jul 03, 2012 1:50 pm

How to build Custom Kernel in LMDE

Postby romanyacik on Mon Feb 10, 2014 11:10 pm

These are good instructions! works in main edition as well, but I've known the process take a long time.
Level 1
Level 1
Posts: 9
Joined: Thu May 10, 2012 10:23 am

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 6 guests