Custom Kernels on Debian

You may also like...

9 Responses

  1. James Johnson says:

    You might also be interested in ulatencyd. It’s a daemon that controls how the kernel spends it’s resources. I’m using it with the stock Ubuntu 10.10 kernel (2.6.35-25-generic) with good results.


  2. Note that by doing things this way, you miss out on all of the kernel patches that stock Debian / Ubuntu kernels include. It may be better to start with one of those source packages and apply the patches you want, rather than starting with a stock tree.

  3. jonathan says:

    @Tristan *nod* I did consider that. I’d like to see what gets patched, I’ll probably look at that today and hopefully I’ll actually understand what those patches do. I guess in such a high-profile package they will at least be well documented with references to bugs, etc :)

  4. Shane says:

    I’m curious as to why you think Unity is a better underlying technology than Gnome Shell. Are you actually planning a blog post for this? Will Debian ever get Unity packages?

  5. ace102 says:

    #! /bin/sh

    # Build_Kernel Ver. .00001
    # Run under /usr/src. Adjust .

    #Dependency Check
    #sudo apt-get install -y –force-yes build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev wget libncurses5 libncurses5-dev
    #Wget the kernel
    #Untar the kernel
    #tar -xvjf linux-2.6.38-rc2.tar.bz2
    #Symbolic link the kernel directory
    #ln -s /media/ubu/Stuff/stuff/linux-2.6.38-rc2 linux
    #Apply any patches here. Repeat a Wget for the patch itself but they offer fully patched kernels now.
    #Apply patch
    #sudo bunzip2 patch-2.6.37-git17.bz2
    #sudo cp pat linux
    #sudo cp patch-2.6.37-git17 linux
    cd linux
    #Copy the previously used config for re-use in the new kernel.
    #sudo cp /boot/config-2.6.38-rc2 .config
    #Apply any patches here. ‘patch -p1 < ‘
    #sudo patch -p1 < patch-2.6.37-git17
    #sudo patch -p1 Save.
    #sudo make xconfig
    #Make it clean
    #sudo make-kpkg clean
    #sleep 180
    #sleep 60
    #Build the new kernel.Adjust Concurrency to the CPU cores +1. Install if the build completed successfully.
    #Add a break here if the build didn’t complete successfully or add ‘&& sudo dpkg -i *.deb’ after the step below. We can just move out of the directory if the stage is successful.
    #Move files from /include/generated to /include/linux
    #sudo cp /usr/src/linux/incldue/generated/* /usr/src/linux/include/linux
    sudo CONCURRENCY_LEVEL=4 make-kpkg –initrd kernel_image kernel_headers modules_image && cd ..
    #Back out of the linux directory
    #cd ..
    #Install the image and headers
    sudo dpkg -i linux*.deb
    #Remove the Kernel Directory and downloaded bz2s.
    #sleep 30
    #sudo rm -rf /usr/src/linux-2.6.37 && sudo rm /usr/src/linux
    #Symbolic Link the *new* headers directory to /lib/modules//build & source
    #First remove bad links if there are any.
    #Move .deb
    sudo mv *.deb /media/ubu/Goodone
    sudo rm /lib/modules/2.6.38-rc3/build && sudo rm /lib/modules/2.6.38-rc3/source
    #Now synbolic link the new header directory to build and source.
    sudo ln -s /usr/src/linux-headers-2.6.38-rc3 /lib/modules/2.6.38-rc3/build && sudo ln -s /usr/src/linux-headers-2.6.38-rc3 /lib/modules/2.6.38-rc3/source
    #Reinstall any video,etc drivers after reboot or add a stage for envyng or something like that yourself.;)

  6. cphayes0882 says:

    Thanks for this little tutorial. I am trying to become a power user of linux, and this little guide is helping me. Thanks again for it.

  7. isama says:

    Thank you for writing this down. I’ve built a freebsd kernel before, it’s easy, but never built a working linux kernel. 2.6.38 is building right now, i think it’s going to work. THANK YOU.

  1. 3 February 2011

    […] This post was mentioned on Twitter by Arjan Waardenburg, Ubuntu World Wide. Ubuntu World Wide said: #ubuntu #linux Jonathan Carter: Custom Kernels on Debian: I’ve been running Debian on my laptop for the last two… […]

  2. 4 February 2011

    […] I haven’t bothered with custom kernels in a long time. I think the last time I ran a custom kernel on my own machine was in 2006. There was a time where I would just read kernel code and change random things just to see what would happen, I’m definitely not that brave anymore. More here […]

Leave a Reply

Your email address will not be published. Required fields are marked *