View Poll Results: Was this helpful to you?

1159. You may not vote on this poll
Results 1 to 10 of 1518

Thread: Master Kernel Thread

Threaded View

  1. #1
    Join Date
    Nov 2006
    United States
    Ubuntu Development Release

    Post Master Kernel Thread

    Welcome to the Master Kernel Thread Information

    Current stable kernel: 3.0 | F P
    Current development kernel: None | F P

    This guide is for the current stable 3.0 kernel from It was last updated Sun 24 Jul 2011 19:47:30 EST.

    Author's Dedication
    You see many kernel compiling posts or blogs on the web. What makes this one any more special? In truth, just because this is the post linked to more than all the others, almost nothing is different from other kernel compiling methods. Sure, it might be a little easier, it might be more constantly updated, I'll give you that. Here comes the truth of what this thread is all about. I wanted to create a tutorial that could give something back to the Linux community as a whole, I wanted to help people stick with Linux without going through the pains of slow bootup time and slow desktop performance. I created this guide to do exactly that. A tutorial to optimize the kernel you are compiling can be found here. This tutorial is based on this thread here: I give the credit for the content of this thread to xXx 0wn3d xXx and Klondikes. Thanks!

    FYI: KernelCheck (written by me, current version 1.2.5), a program that automatically compiles and installs the latest kernel, can be downloaded here. This script uses the instructions posted in this guide. The main forum thread for this project is here. Note that this program allows for automatic installation of nVidia non-legacy drivers.

    Dim Gray Text should be ignored.
    Green Text is recommended but not mandatory.
    Orange Text is instruction.
    Red Text is important.

    1. Install the utilities needed to configure the kernel
      sudo apt-get install build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev wget libncurses5 libncurses5-dev
    2. Move to the configuration directory
      cd /usr/src
    3. Add yourself to the src group so you can write in /usr/src
      sudo adduser $USER src
    4. Login to the shell with your new group privileges
      su $USER
    5. Now we are going to download the kernel and unpack it
      wget -c && tar -xvjf linux-3.0.tar.bz2
    6. Copy the initramfs scripts so that you will actually be able to boot from the kernel:
      sudo cp /usr/share/kernel-package/examples/etc/kernel/postinst.d/initramfs  /etc/kernel/postinst.d/ 
      sudo cp /usr/share/kernel-package/examples/etc/kernel/postrm.d/initramfs  /etc/kernel/postrm.d/
    7. Remove the link to the linux directory, make a new link to the new kernel, and move to the Linux directory:
      rm -rf linux && ln -s /usr/src/linux-3.0 linux && cd /usr/src/linux
      Note: If you are applying a patch to the kernel, such as fbsplash, beyond, or emission, apply the patch now and skip to step 10.
    8. Now download the latest kernel patch: (Do NOT do this or the step below if you are using a different patch like beyond, emission, RT, etc.)
      Unneeded step, skip to step 10
    9. Apply the new patch: (Do NOT do this if you are using a different patch like beyond, emission, etc.)
      Unneeded step, skip to step 10
    10. Now import your current kernel configuration and get your current kernel options:
      cp /boot/config-$(uname -r) .config && yes "" | make oldconfig
    11. Configure the kernel:
      Note: If you have a wireless internet device, you must enable your wireless drivers in the kernel. The easiest way to do this is to press Ctrl + F and search for your wireless device module name.
      make xconfig
      Or for a terminal-based version:
      make menuconfig
      Tip: You can significantly speed up the compile time of your kernel by using distcc. You can read the howto on this subject here.
    12. Finally, it's time to build the kernel: Make sure that you are in /usr/src/linux. This will build a debian file that you can install.

      Now in the terminal do this:

      make-kpkg clean
      Then this:

      INSTALL_MOD_STRIP=1 CONCURRENCY_LEVEL=3 fakeroot make-kpkg --initrd --append-to-version=-mk kernel_image kernel_headers modules_image
      Note: You can replace "mk" with anything you want. Like "k7" or "686". Make sure you leave the hyphen. The kernel will now compile for 1-3 hours, depending on the speed of your processor. The concurrency level should be set to one number above your number of CPU cores. (Leave it at the default if you don't know what this means).
    13. Install the .deb files in /usr/src. There should be 2. One should be an image .deb file and the other a header .deb file. In terminal do:
      cd .. && sudo dpkg -i linux*3.0*.deb
    14. Now reboot and profit!


    Q. Help! My suspend and hibernate buttons don't work!:

    A. The new SLUB allocator in the 2.6.22 and later kernels has a bug in it that does not allow some systems to suspend or hibernate. To fix this, just use the SLAB allocator instead of SLUB in the xconfig dialog.
    Q. My High Definition sound (Azalia or Intel HD) does not work with the new kernel!:

    A. You have to enable the Intel HD module in Advanced Linux Sound Architecture.
    Q.With the --revision and 64 bit processors:
    Concerning --append-to-version: My question is which is better kernel to use for my systems with a 64-bit computer? 686, k7 or something else?
    A. Note to everyone: The append-to-version option has absolutely nothing to do with the kernel at all. It is simply a short title for your kernel. 64 bit users can even put --append-to-version=64 or don't even include the append-to-version at all. 64-bit users can enable 64-bit options in the kernel under Processors.
    Q. When I 'make xconfig', this error appears, but it doesn't seem to harm the installation.
    X Error: BadDevice, invalid or uninitialized input device 168
    Major opcode: 148
    Minor opcode: 3
    Resource id: 0x0
    Failed to open device
    X Error: BadDevice, invalid or uninitialized input device 168
    Major opcode: 148
    Minor opcode: 3
    Resource id: 0x0
    Failed to open device
    A. This is harmless. It simply appears because you have your wacom devices enabled in xorg.conf. If you don't want to see that error see here.
    Q. After GRUB boots my kernel, all I see is this:
    Begin: Waiting for root file system...
    A. This may because you installed Ubuntu on a SATA hard drive. To fix this error, you must recompile the kernel with SATA options enabled.
    Q. NVIDIA users compiling the 2.6.21 kernel should follow the directions below to compile the NVIDIA driver. [DEPRECATED]
    1. Go to your source location and run make xconfig
    2. Under "Processor type and features" turn "Paravirtualization Support" OFF
    3. Exit and save the config.
    4. Run make prepare
    5. Re-run the NVIDIA Installer
    6. Profit.
    Q. Why isn't there any more troubleshooting?
    A. Because you need to help add some. You want more? Post your problems, PM me and help the Ubuntu community.

    † Post created by hand
    Last edited by master_kernel; July 25th, 2011 at 12:47 AM. Reason: Updates
    The one and only, Master Kernel Thread
    KernelCheck - Finally. A way to easily download, compile, and install the latest kernel. Release 1.2.5 available now.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts