Configuration tips for the Ubuntu Lucid kernel

As requested by many readers of my blog and because of one major problem I ran into when I compiled the Ubuntu Lucid kernel for Ubuntu Karmic here are some pointers for configuring the Lucid kernel.
Not all configuration changes will have an impact on the kernel, some of them reduce the amount of source that has to be compiled.

Making configuration changes depends on your hardware. My computer is a Dell inspiron 1720 laptop but to see more details of your hardware you can run a couple of commands

$ lspci
00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c)
00:01.0 PCI bridge: Intel Corporation Mobile PM965/GM965/GL960 PCI Express Root Port (rev 0c)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 02)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 02)
00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f2)
00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 02)
00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02)
01:00.0 VGA compatible controller: nVidia Corporation G84 [GeForce 8600M GT] (rev a1)
03:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)
03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
03:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
03:01.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)
0c:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61)
$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 23
model name	: Intel(R) Core(TM)2 Duo CPU     T9300  @ 2.50GHz
stepping	: 6
cpu MHz		: 800.000
cache size	: 6144 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm ida tpr_shadow vnmi flexpriority
bogomips	: 4988.50
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 23
model name	: Intel(R) Core(TM)2 Duo CPU     T9300  @ 2.50GHz
stepping	: 6
cpu MHz		: 800.000
cache size	: 6144 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm ida tpr_shadow vnmi flexpriority
bogomips	: 4987.44
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

You can not rely on a command to determine your memory. If the kernel you are running isn’t configured for memory above 4GB it won’t show.

Configuration Changes

nVidia – Nouveau driver

I’ll start with the most important one I had to make when I was building the Ubuntu Lucid kernel.
The Ubuntu Lucid kernel has the option to use the Open Source drive Nouveau, which is the driver for nVidia cards, enabled. Although very nice, the 3D-acceleration is in experimental stage. I rather run the proprietary driver by nVidia and that’s where I ran into trouble after my first kernel compilation. When the Nouveau driver is being used you can not install the proprietary driver. The installation will stop by stating that a driver is being used which interferes with the installation of the proprietary driver. There is no mention of the Nouveau driver but that is the one that’s blocking the installation. You can blacklist the Nouveau driver or disable the Nouveau driver in the kernel.
To disable Nouveau in the kernel:

Device Drivers  ---> Staging drivers  ---> Nouveau (nVidia) cards 

Processor

As you can tell by the information above I have a Intel Core2 processor, a little further searching on the internet gave me more detailed information about this processor. If you have an Intel processor go to http://ark.intel.com/ type in your processor information in the search box and you’ll see more detailed information which will be helpful.
You can select your processor type in the configuration

Processor type and features  ---> Processor family

The Core2 processor does not support hyperthreading. To disable this feature:

Processor type and features  ---> SMT (Hyperthreading) scheduler support

I also disable Generic x86 support and Support for extended (non-PC) x86 platforms

Processor type and features  ---> Generic x86 support
Processor type and features  ---> Support for extended (non-PC) x86 platforms

Memory

The standard Ubuntu Lucid kernel does not support memory of 4GB or higher, to enable it

Processor type and features  ---> High Memory Support ---> 64GB

Miscellaneous

The following suggestions won’t improve the size or speed of the kernel but they will reduce the compilation time.

I disable all filesystems I am not running:

File systems  ---> 

I disable all network options I am not using, like IPX, AppleTalk:

Networking support ---> Amateur Radio support
Networking support ---> WiMAX Wireless Broadband support
Networking support ---> Networking options  ---> The IPX protocol
Networking support ---> Networking options  ---> Appletalk protocol support
Networking support ---> Networking options  ---> ARCnet support
Networking support ---> Networking options  ---> Asynchronous Transfer Mode (ATM)

This list is far from complete, I have disabled a whole bunch of options based on my hardware and needs, but I hope you get the idea.

Final Notes

Whenever you make changes to your kernel configuration keep in mind that the kernel could stop working, so make sure you always have a working kernel to boot from. Yes it is very frustrating when you make a choice for an option and it turns out it messes up your computer as you’ll have to recompile your kernel again but that’s the fun of it too, at least it is for me.

This article is filed under the category Ubuntu and has the following tags associated with it: , .

For more of the same articles see the page Compile a kernel for Ubuntu overview
  • notbad

    thanks for the tips.
    I have one problem with compiling. after I compile and install the new kernel, I just get one CPU working. In processor I have chosen Core 2 / Xeon. What am I doing wrong?

    • You are probably not doing anything wrong. It depends on the application you are running whether or not both cores are utilized. That doesn’t really have anything to do with the selection of the processor in the kernel. The selection will optimize the kernel for the processor, it’s not a necessity for having application utilize the dual core.

      cat /proc/cpuinfo

      will show you if your CPU is recognized, it should return two processors

      • srinath

        sir,
        while compiling the lucid kernel on karmic,,IN later of ur mentioned stages i got “getall” command not found..
        plz help

  • notbad

    forgot to mention that my cpu is E6600@2.4ghz

  • notbad

    But in System Monitor it shows only one cpu, and its quite loaded. ok i’m compiling a new one and will check the cat /proc/cpuinfo

  • notbad

    well, the cpuinfo shows only one cpu. I don’t know what am I doing wrong. By the way I use the oldfashioned debian way and use some of these tips: http://ubuntuforums.org/showpost.php?p=1174954&postcount=507

download