How To Compile a Kernel on Debian Linux

Video Notes:

This video was sponsored by:
Karl Arvid
John Tedesco –
Vinay Sud

For help:

Intro Video by Milan Ristic

16 thoughts on “How To Compile a Kernel on Debian Linux

  1. You really should use "make olddefconfig" or "make silentoldconfig". These options take your current .config file and add the new kernel options to them as well. "make oldconfig" will add all new kernel options and set them to a recommended default setting, while "make silentoldconfig" will go through each new option and ask which you want, well also recommending a default value.

  2. Pls help me to fix this error after when I enter the command make after all the configuration done for kernel I get this error

    In file included from arch/x86/kernel/cpu/proc.c:5:0:
    include/linux/cpufreq.h:657:57: error: ‘struct pid_namespace’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
    int proc_time_in_state_show(struct seq_file *m, struct pid_namespace *ns,
    cc1: all warnings being treated as errors
    scripts/ recipe for target 'arch/x86/kernel/cpu/proc.o' failed
    make[3]: * [arch/x86/kernel/cpu/proc.o] Error 1
    scripts/ recipe for target 'arch/x86/kernel/cpu' failed
    make[2]: * [arch/x86/kernel/cpu] Error 2
    scripts/ recipe for target 'arch/x86/kernel' failed
    make[1]: * [arch/x86/kernel] Error 2
    Makefile:964: recipe for target 'arch/x86' failed
    make: * [arch/x86] Error 2

  3. Awesome video Kris. Just out of curiosity I have some questions. Currently on a project of compiling my own kernel for debian.. for a laptop that is very difficult to get linux on.. So how would you compile a custom kernal , wrap it with a DE, and make a .iso , if one were so inclined? For a lenovo idepad 11IBY. 64 bit arch, 32 bit UEFI….

  4. Very good guide.
    Worked for me, i updated the raspberry pi desktop kernel from 3.16 to 4.13. And i think i also managed to improve performance because there was (NEW) settings that had support for intel during compilation.

  5. after i did make clean && make mrproper
    it prompt me something about /etc/kernel-img.conf.ucf-new /etc/kernel-img.conf
    i kept both files. and compare them. file on my system had removed all descriptions
    and only 1 line was new in new conf. should i need it?
    i currently compiling my first kernel ever and didnt get any JIPEE feeling.
    didnt find any cool stuff on menuconfig. like wireless adapter that i have
    everything else is like. what is this ?do i need it? LOL

    what is command i can run that scan my hardware and make .config based on that??

     this is part where linux sucks. i dont want commands create files on difrent part of system when i dont even know what difrent parts are used for. after i remove my kernel source files. system has many files that i not know!?!
    why it can be make all in same directory and after delete all gone,
    but new kernel and headers are there unless uninstall and sure dont want if it works lol

    now if i build kernel on my chroot enviroment. what i can remove that not need to run SMALL system
    that would be easy just remove sources,but it had todo something else OMG
    and only need kernel and header file

  6. Hi nice video.
    I have a few suggestions / comments. 
    The make menuconfig step is not necessary as it always grabs the .config file in the kernel sources directory automatically. 
    When switching from an older kernel sometimes it also asks on the compiling process to activate new features or deactivate them. It also gives a default suggestion. 
    When it comes to compiling I would recommend using the -j switch aswell and a number for the threads it should use for compiling. 
    So if you have a dual-core processor you can safely go with -j3 which uses 3 threads and should then compile the kernel actually a lot faster than only using one thread. (which it does by default hence the long compile time) 
    On my machine for example with 6 cores it compiles in about 10-15 minutes. (of course depending on the kernel configuration and how much you compile in or as module) 

Leave a Reply

Your email address will not be published.