Compiling the kernel with additional patches


Recommended Posts

(I know there's already a thread on this subject, but this one is also about extra kernel patches. Mods, do with it as you wish :p )

Compiling the kernel and adding patches

---------------------------------------

There are many possible reasons for wanting to compile a kernel with additional patches. One can try new features, hope for a speed increase, require a security fix... In my case, I wanted to try the latest bcm43xx driver (I would like to run some tests and give feedback to the developers, and on top of that, the new driver is said to work better with my wireless card).

On request of h3xis, and keeping in mind that others might want to add patches before compiling their kernel, I've written this guide. I've recompiled my kernel on Ubuntu 6.10, so instructions for other distributions might be slightly different!

IMPORTANT NOTICE!! Compiling your kernel could cause damage to your system, especially if you use conflicting packages! So be very careful, and don't forget to make a back-up!

I've based this guide on this page, with a few differences.

If a command does not work, try it again with 'sudo' added at the beginning!

Note: if anything goes wrong, it's your own responsibility!

1. Installing the required packages for compiling the kernel:

sudo apt-get install build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev wget libncurses5 libncurses5-dev && cd /usr/src

2. Downloading and unpacking the kernel:

First, go to http://kernel.org/pub/linux/kernel/v2.6/, and choose the kernel you wish to compile (normally, you'll need the most recent one). Download it and unpack it in /usr/src. You will then have a folder /usr/src/linux-VERSION.

3. Changing links:

Make sure you're in /usr/src right now.

We're going to remove the current symbolic link at /usr/src/linux, and replace it by a link to our new kernel (soon to be compiled). Then, we'll move into the /usr/src/linux directory.

It's possible you don't have a /usr/src/linux directory. In that case, you don't need to remove the symbolic link (however, you still need to do the rest of the step).

We'll do this by using the following code.

sudo rm -rf linux && sudo ln -s /usr/src/linux-VERSION linux && cd /usr/src/linux

4.A. Adding official kernel patches

It's possible that you already have the source of kernel 'VERSION.smallversion' on your computer, but would like to use kernel 'VERSION.smallversion+X' instead. You could download the entire source to kernel 'VERSION.smallversion+X' (over 50 MB), or you could download 'patch-VERSION.smallversion+1', 'patch-VERSION.smallversion+2' and so on (could be a few kB up to a few MB).

Suppose you already have the source of an earlier kernel. You could download a kernel patch 'patch-VERSION.smallversion', decompress it in /usr/src/linux, and type the following code to add it to the kernel source:

patch -p1 < patch-VERSION.smallversion-DECOMPRESSED

By doing this, you will have patched your kernel!

4.B. Adding other kernel patches

If you have a kernel patch you wish to add, you simply decompress the patch into the /usr/src/linux folder, and type the following code:

patch -p1 < patch-DECOMPRESSED

5. Importing your previous kernel configuration and configuring the kernel

In this step, you'll use the previous kernel configuration, followed by answering lots of questions (if you're unsure about these, it's easiest to just keep pressing enter -- but if you need to set additional options: don't! I pressed enter, and I'll have to compile again to enable a debug-option on my bcm43xx-driver.).

sudo cp /boot/config-`uname -r` .config && sudo make oldconfig && sudo make xconfig

6. Compiling the kernel

Debian (and distributions based on it) has a configuration utility, called make-kpkg. It replaces a combination of commands and makes compiling the kernel easier.

[TO-DO: add explanation for non-Debian-based systems]

make-kpkg clean

Then, we'll do the actual compiling. Grab yourself a book, type the following code, and wait a few hours...

make-kpkg -initrd --revision=386 kernel_image kernel_headers modules_image

7. Finishing the job

Last, but not least, we need to install the created kernel packages.

There should be 2 .deb-packages in your /usr/src (one is a kernel image, the other a kernel header), so type:

cd /usr/src

Then, to install them:

dpkg -i KERNELIMAGE.deb && dpkg -i KERNELHEADER.deb

8. You made it!?

Now simply reboot, and that's it!

(If you have any comments, improvements, or have noticed errors, please do mention!)

  • 3 months later...
  • 2 weeks later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Camtasia 2026.1.3 by Razvan Serea TechSmith Camtasia is the complete professional solution for high-quality screen recording, video editing and sharing. Camtasia 2026 makes editing your videos easier, and faster than ever. The new editor is packed with enhanced video processing, all-new production technology, an innovative library, and stock videos and other creative assets to help you create more polished, professional videos. No video experience needed. Anyone can create informative, engaging videos. Create professional, eye-catching videos: Add special video effects - Apply Behaviors that are perfectly designed to animate your text, images, or icons. Get a crisp, polished look without being a professional video editor. Drag-and-drop your edits - What you see is what you get. Every effect and element in your video can be dropped and edited directly in the preview window. And you can edit at resolutions up to beautiful 4K, for clear video at any size. Get exceptional performance - Camtasia takes full advantage of your computer’s processor with 64-bit performance. You’ll get fast rendering times and enhanced stability—even on your most complex projects. Camtasia 2026.1.3 changelog: Feature Updates Improved keyboard navigability in tool panels. Improved screen reader accessibility of headings in Preferences. Tool panels can now be resized using a keyboard-navigable control. Updated color of folder icon in User Library tab for better visibility. Grouped media now render a composite waveform considering all audio media within that group. Added Long Path Aware to the manifest of Editor and Recorder. Performance Improvements Improved performance for editing groups on the timeline. Improved the project loading performance when timeline has lots of trec media with cursor data. Updates for IT Administrators Updated cpp-httplib from 0.38.0 to 0.43.3. Updated expat from 2.7.4 to 2.8.0. Updated freetype from 2.13.3 to 2.14.3. Updated harfbuzz from 13.0.1 to 14.2.0. Updated libpng16 from 1.6.55 to 1.6.58. Updated pango from 1.57.0 to 1.57.1. Updated girepository from 2.86.3 to 2.88.0. Updated pcre2-posix from 10.47.0 to 12.0.2. Added new harfbuzz-gpu.dll. Updated FFmpeg from 7.1.1 to 7.1.2. Updated aom from 3.11.0 to 3.13.1. Updated dav1d from 1.5.0 to 1.5.1. Updated ogg from 1.3.5 to 1.3.6. Updated SDL2 from 2.32.4 to 2.32.10. Updated zlib from 1.3.1 to 1.3.2. Updated Nalpeiron binaries to version 4.4.69.3. Bug Fixes Fixed an issue which prevented some user submitted crash reports from being sent. Fixed a potential memory leak when decoding HEVC or VP9 video. Fixed a potential crash when trying to delete a range selection on a magnetic track. Fixed a bug with the Properties Panel showing stale properties when only a caption is selected on the timeline. Fixed an issue that could prevent the Opacity and Blur properties from being changed in the Background Removal effect. Fixed an issue where larger Camtasia online projects may fail to open in Camtasia Editor. Table of contents thumbnails are no longer created for Smart Player exports with no table of contents. Fix resetting skew revert to revert just skew and not scale as well. Fixed editing in Snagit with snagX file with Unicode characters. Fixed a bug where grouped visual media could be cropped in some cases. Fixed importing SnagX files with Unicode characters. Localization fixes. Download: Camtasia 2026.1.3 | 309.0 MB (Shareware) View: Camtasia Homepage | Tutorials | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • yeah it seems to be Edge only. The dialog buttons work as expected in Chrome and Firefox. The phone is using Android 16 (OneUI 8.5) and Edge version  149.0.4022.53
    • I'm not aware of this issue, but to help the other guys.  What version of Android are you using? Did you try a different browser? To see if Edge is the issue here.
    • I agree when are you going to read this (really poor BTW) article? Here is a better article so you actually know what is going on and answers questions you had in other comments --> https://arstechnica.com/gadgets/2026/05/speed-boosting-low-latency-profile-is-one-of-the-improvements-coming-to-windows-11/ It is unclear if one will be able to disable the new profile at this point but I am not seeing any reason why one would.
  • Recent Achievements

    • One Month Later
      Jamswaz earned a badge
      One Month Later
    • Week One Done
      Jamswaz earned a badge
      Week One Done
    • Rookie
      Marzoid went up a rank
      Rookie
    • Community Regular
      coch went up a rank
      Community Regular
    • One Year In
      slackerzz earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      512
    2. 2
      PsYcHoKiLLa
      188
    3. 3
      +Edouard
      157
    4. 4
      Steven P.
      83
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!