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

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

View Poll Results: Was this helpful to you?
Yes 985 91.37%
No 93 8.63%
Voters: 1078. You may not vote on this poll

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

Welcome to the Master Kernel Thread

Kernel.org Information

Current stable kernel: 2.6.32.7 | F P
Current development kernel: 2.6.33-rc6 | F P

This guide is for the current stable 2.6.32 kernel from kernel.org. It was last updated Sat 06 Feb 2010 11:24:15 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.32.tar.bz2 && tar -xvjf linux-2.6.32.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.32 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.32.7.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.32.7.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.32*.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; 3 Days Ago at 12:24 PM.. Reason: Updates
master_kernel is offline   Reply With Quote
Old December 6th, 2006   #2
ciscosurfer
Chocolate-Covered Ubuntu Beans
 
ciscosurfer's Avatar
 
Join Date: Jun 2006
Beans: 2,295
Ubuntu 9.10 Karmic Koala
Re: Master Kernel Thread

That should read
Code:
sudo /etc/init.d/gdm stop
NOT
Code:
sudo /etc/init.d/gdu stop
__________________

ciscosurfer is offline   Reply With Quote
Old December 7th, 2006   #3
whomever21
5 Cups of Ubuntu
 
Join Date: Oct 2006
Location: Boston
Beans: 26
Ubuntu 8.04 Hardy Heron
Re: Master Kernel Thread

I was able to compile version 2.6.19 on my Dell Dimension at work, but after compiling, installing, and rebooting on my Precision M65 laptop, it just hangs at "Begin: Waiting for root file system... ..."

Any ideas?
whomever21 is offline   Reply With Quote
Old December 7th, 2006   #4
lime4x4
Dipped in Ubuntu
 
Join Date: May 2006
Beans: 530
Re: Master Kernel Thread

Well this also allow selecting which kernel you want to boot up?
lime4x4 is online now   Reply With Quote
Old December 7th, 2006   #5
hikaricore
RIP ~ Fluffy ~ 2006-2008
 
hikaricore's Avatar
 
Join Date: Aug 2006
Location: lewis center, ohio
Beans: 5,732
Kubuntu Development Release
Send a message via ICQ to hikaricore Send a message via AIM to hikaricore Send a message via MSN to hikaricore Send a message via Yahoo to hikaricore
Re: Master Kernel Thread

Quote:
Originally Posted by lime4x4 View Post
Well this also allow selecting which kernel you want to boot up?
Installing a new kernal from packages (after compiling) as described above should automagicly add them to your grub list. I've followed this method before with no problems.
hikaricore is offline   Reply With Quote
Old December 7th, 2006   #6
lime4x4
Dipped in Ubuntu
 
Join Date: May 2006
Beans: 530
Re: Master Kernel Thread

heres the error i'm getting

make[1]: Entering directory `/usr/src/modules/fglrx'
if [ -f /usr/src/modules/fglrx/debian/control.template ]; then \
cat /usr/src/modules/fglrx/debian/control.template > /usr/src/modules/fglrx/debian/control; \
fi
if [ -f /usr/src/modules/fglrx/debian/postinst ]; then \
mv /usr/src/modules/fglrx/debian/postinst /usr/src/modules/fglrx/debian/fglrx-kernel-2.6.19.postinst; \
fi
dh_testdir
touch configure-stamp
dh_testdir
/usr/bin/make -C /usr/src/linux SUBDIRS=/usr/src/modules/fglrx modules
make[2]: Entering directory `/usr/src/linux-2.6.19'
CC [M] /usr/src/modules/fglrx/firegl_public.o
/usr/src/modules/fglrx/firegl_public.c:89:26: error: linux/config.h: No such file or directory
/usr/src/modules/fglrx/firegl_public.c:456: warning: initialization from incompatible pointer type
/usr/src/modules/fglrx/firegl_public.c: In function ‘firegl_stub_open’:
/usr/src/modules/fglrx/firegl_public.c:579: warning: assignment discards qualifiers from pointer target type
/usr/src/modules/fglrx/firegl_public.c: In function ‘__ke_request_irq’:
/usr/src/modules/fglrx/firegl_public.c:2510: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
/usr/src/modules/fglrx/firegl_public.c: In function ‘__ke_smp_call_function’:
/usr/src/modules/fglrx/firegl_public.c:3898: warning: passing argument 1 of ‘smp_call_function’ from incompatible pointer type
make[3]: *** [/usr/src/modules/fglrx/firegl_public.o] Error 1
make[2]: *** [_module_/usr/src/modules/fglrx] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.19'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/usr/src/modules/fglrx'
Module /usr/src/modules/fglrx failed.
Hit return to Continue
lime4x4 is online now   Reply With Quote
Old December 10th, 2006   #7
Defscanguci
First Cup of Ubuntu
 
Join Date: Mar 2006
Beans: 9
Cool Re: Master Kernel Thread

I'm unable to install libqt3-mt-dev, because it needs libxft-dev. libxft-dev needs libxft2 version 2.1.10-1ubuntu1.1, but I have libxft2 version 2.1.10-1ubuntu1.3. If I uninstall libxft2, I get a slew of programs and such that would also be uninstalled. Any ideas?
Defscanguci is offline   Reply With Quote
Old December 12th, 2006   #8
BennS
First Cup of Ubuntu
 
Join Date: Dec 2006
Beans: 2
Re: Master Kernel Thread

I'm getting the same problem as whomever21, I'm a Compaq v3000z laptop. Tried multiple times with different kernel config options, but I still get the "Waiting for root filesystem..." message.

@Descanguci
You don't necessarily need qt3, thats just used in the 'make xconfig' step (I believe). Instead of running 'make xconfig', you could run 'make menuconfig' and that would give you a text based menu for changing kernel options.
BennS is offline   Reply With Quote
Old December 12th, 2006   #9
BennS
First Cup of Ubuntu
 
Join Date: Dec 2006
Beans: 2
Re: Master Kernel Thread

@lime4x4:
The file it's trying to include is /usr/src/linux-headers-2.6.19/include/linux/config.h
however, this file does not exist, at least in the versions I've been able to build. This file exists in my linux-headers-2.6.18 directory that I have from the last time I built my own kernel (using the previous guide), but not in the new (2.6.19) version.
Seems like something is broken (or fragile) when building 2.6.19 on Ubuntu machines. Makes me wish I still had my Fedora Core 6 partition to try building a kernel on.
BennS is offline   Reply With Quote
Old December 13th, 2006   #10
kurty
5 Cups of Ubuntu
 
Join Date: Aug 2006
Beans: 11
Re: Master Kernel Thread

I'm also getting the "Begin: Waiting for root file system... ..." message and the system just hangs. If I hit ctr+alt+del it reboots and I can repeat over and over, nothing. If I choose my old kernel from grub it boots just fine so I don't think there is anything wrong with the file system.

Help?
kurty 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 05:49 PM.


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