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

    • Microsoft releases new Windows 11 Media Creation Tool with the latest updates by Taras Buria Patch Tuesday updates arrive every month, bringing users new features and security updates. To make sure customers have access to the most recent images, Microsoft also releases updates to the Media Creation Tool app, its official utility for Windows 11 installation. Today, the company pushed new ISOs to Media Creation Tool, allowing you to create images with the June 2026 Patch Tuesday updates. With the latest update, the Media Creation Tool now downloads KB5094126. It is Windows 11 version 25H2, build 26200.8655, which is also available via Windows Update. Note that the app itself remains on the previous version, which you can check in Properties > Details. The only change is that it now downloads a more recent Windows 11 build, so the only way to check is to download an ISO. The June 2026 Patch Tuesday update is a special release for Windows 11, as it brings a new performance profile to make the operating system more responsive and snappier when rendering various user interface surfaces, including the Start menu, quick settings, and more. It does so by spiking processor speeds for a brief moment, resulting in higher loads for a second or two. The so-called “Low latency profile” is rolling out gradually, but you can force-enable it with the ViVeTool app. Other changes include webcam improvements, Task Manager updates, shared audio support, and more. You can download the Media Creation Tool app from the official Microsoft website using this link. Besides MCT, Microsoft lets you download Windows 11 ISO as a file directly from the official Windows 11 website. However, you will need a third-party app to write it to your USB drive. Check out this guide if you want to know how to do that.
    • Louis Rossmann suing Samsung over "990 Pro SSD warranty scam" by Sayan Sen Back in 2023, if you recall, Neowin reviewer Robbie Khan had a dispute with Samsung over his 990 Pro SSD, which was rapidly losing its health. After significant back and forth, the tech giant had finally released firmware to "stop" the issue. Interestingly, its previous flagship at the time, the 980 Pro was also facing problems leading to two consecutive sets of firmware fixes. Three years later, it looks like a similar conflict has now broken out between tech repair entrepreneur YouTuber Louis Rossmann and Samsung, as it has escalated into a threatened lawsuit after the company allegedly refused to appropriately replace a failing 990 Pro SSD that remained under warranty. According to Rossmann, a 4TB Samsung 990 Pro NVMe SSD purchased for approximately $330 less than two years ago, began experiencing major hiccups and issues, even though he claims it had been operated under ideal cooling conditions. It was installed in a RAID 1 array and cooled by a heatsink and dual high-speed fans. However the drive reportedly started dropping out of the array, exhibiting controller-level failures that eventually became not useable in any meaningful way. Rossmann said Samsung’s support process was marked by delays and confusion from the very start. After initially contacting the wrong regional support channel, he was redirected to Samsung’s memory support division where he submitted detailed diagnostics, logs, and proof of purchase. Rossmann runs a repair company and owns an ACE Lab PC-3000 machine, which is a professional-grade data recovery equipment. As such, he had been confident in his diagnostics. Samsung even seemingly acknowledged that later. Regardless, Rossmann claims that his initial support ticket was automatically closed before a full 24-hour response window had elapsed, forcing him to reopen the case and resubmit documentation. The controversy however intensified further from here after Samsung accepted the drive for warranty evaluation but later returned it with a repair report stating that the drive had passed its testing and that the SSD had been verified as functional. Rossmann strongly disputed those claims citing that his own independent testing on PC-3000 showed write speeds reducing to as low as 40–60 MB/s before the drive failed entirely. Samsung subsequently informed him that the SSD had been reset and reflashed, passing internal stress tests. However, the company also stated that replacement units were unavailable due to an industry-wide memory shortage and suggested that a refund process could be initiated if further testing confirmed the fault. Thus, to settle, the company offered a refund of $330, the amount that was initially paid by him to make the purchase. Here, Rossmann pointed out the seeming hypocrisy of the tech giant as in how no Samsung drive was apparently allocated for warranty replacements, but they were abundantly available for retail sales especially when using business accounts. As you can see, Rossmann is indeed right, there are Samsung 990 Pro 4TB SSDs on Amazon currently for $950 (shipped and sold by first-party Amazon US itself), and they are also available on Samsung's own store too, albeit for an even higher price of $1100. Thus Rossmann argues that Samsung’s inability or unwillingness to provide a replacement while the same model remains available for purchase at significantly higher market prices reflects a failure to honor its warranty obligations. He has issued a formal 60-day notice and says he intends to file suit in Texas small claims court, asserting that companies should face greater costs for denying legitimate warranty claims than for fulfilling them. You can check out the full video titled "Samsung's 990 Pro SSD warranty policy is a scam; I'm taking them to court," at the link below. Source and image: Louis Rossmann (YouTube) As an Amazon Associate we earn from qualifying purchases
    • Was it too much to ask to show the icon in this article?
    • Frankly, I blame whoever is writing such articles. "A big improvement/update and/or new feature is now available to everyone! Also, use this unofficial tweak tool to enable it because it actually isn't available to you yet officially and might not in fact even be entirely ready or whatever, hence why it is perhaps not enabled for you*. But it's great and you should enable it!" I mean there's nothing wrong with sharing info about some feature you might need to enable via unofficial means, of course. It's just that these articles tend to essentially end up being two news pieces in one, and one of them tends to be a bit misleading. (*Yes, yes, the "it's a controlled rollout!" thing. Not a fan of that one either. The argument, not the actual rollout.)
  • Recent Achievements

    • Week One Done
      davidbazooked earned a badge
      Week One Done
    • 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
  • Popular Contributors

    1. 1
      +primortal
      509
    2. 2
      PsYcHoKiLLa
      185
    3. 3
      +Edouard
      158
    4. 4
      Steven P.
      83
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!