Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

View Poll Results: Was this helpful to you?
Yes 963 91.54%
No 89 8.46%
Voters: 1052. You may not vote on this poll

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old December 2nd, 2006   #1
master_kernel
Dipped in Ubuntu
 
master_kernel's Avatar
 
Join Date: Nov 2006
Location: United States
Beans: 630
Ubuntu 9.04 Jaunty Jackalope
Post Master Kernel Thread

Welcome to the Master Kernel Thread

Kernel.org Information

Current stable kernel: 2.6.31.6 | F P
Current development kernel: 2.6.32-rc7 | F P

This guide is for the current stable 2.6.31 kernel from kernel.org. It was last updated Fri 13 Nov 2009 18:41:00 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: http://www.ubuntuforums.org/showthread.php?t=157560. I give the credit for this thread to xXx 0wn3d xXx. 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. Also, the KernelCheck screenlet is available here. The main forum thread for this project is here. Note that this program allows for automatic installation of proprietary video drivers via EnvyNG.


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
    Code:
    sudo apt-get install build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev wget libncurses5 libncurses5-dev
  2. Move to the configuration directory
    Code:
    cd /usr/src
  3. Make yourself the omnipotent root
    Code:
    sudo -s
  4. Now we are going to download the kernel and unpack it
    Code:
    wget -c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.tar.bz2 && tar -xvjf linux-2.6.31.tar.bz2
  5. Remove the link to the linux directory, make a new link to the new kernel, and move to the Linux directory:
    Code:
    rm -rf linux && ln -s /usr/src/linux-2.6.31 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 8.
  6. 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.)
    Code:
    wget -c http://kernel.org/pub/linux/kernel/v2.6/patch-2.6.31.6.bz2
  7. Apply the new patch: (Do NOT do this if you are using a different patch like beyond, emission, etc.)
    Code:
    bzcat patch-2.6.31.6.bz2| patch -p1
  8. Now import your current kernel configuration and get your current kernel options:
    Code:
    cp /boot/config-$(uname -r) .config && yes "" | make oldconfig
  9. 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.
    Code:
    make xconfig
    Or for a terminal-based version:
    Code:
    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.
  10. Finally, it's time to build the kernel: Make sure that you are in /usr/src/linux with full root access. This will build a debian file that you can install.

    Now in the terminal do this:

    Code:
    make-kpkg clean
    Then this:

    Code:
    INSTALL_MOD_STRIP=1 CONCURRENCY_LEVEL=3 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. If you have an extremely slow processor, you may have to wait 4 or more hours waiting for the kernel to compile. In the meantime, I would go out to a movie or do something else while it's compiling. 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).
  11. 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:
    Code:
    cd .. && dpkg -i linux*2.6.31*.deb
    IMPORTANT: IF YOU HAVE AN NVIDIA OR ATI GRAPHICS CARD, YOU MAY HAVE TO REINSTALL THE DRIVERS FOR IT.
  12. Now reboot and profit!


Troubleshooting:


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, even if it isn't Intel.
--------------------------------------------------------------
Q.With the --revision and 64 bit processors:
Quote:
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.
Quote:
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:
Quote:
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]
A.
Quote:
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 automatically created by UpdateT version 0.1
__________________
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.

Last edited by master_kernel; 1 Week Ago at 07:41 PM.. Reason: Updates
master_kernel is offline   Reply With Quote
 

Bookmarks

Tags
compile, kernel

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:33 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry