Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.

Welcome to Eric Hameleers (Alien BOB)'s Wiki pages.

If you want to support my work, please consider a small donation:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
linux:kernelbuilding [2009/04/21 20:16] – Mostly textual clarifications alienlinux:kernelbuilding [2009/07/22 07:20] – Fix a typo. alien
Line 35: Line 35:
 Now, get a Slackware kernel config file for a headstart during your own configuring. Pat's config files are pretty generic. By the time you read this, there might be a config for a newer 2.6 release available: Now, get a Slackware kernel config file for a headstart during your own configuring. Pat's config files are pretty generic. By the time you read this, there might be a config for a newer 2.6 release available:
 <code> <code>
-wget http://slackware/mirrors.tds.net/pub/slackware/slackware-12.2/source/k/config-generic-smp-2.6.27.7-smp+wget http://slackware.mirrors.tds.net/pub/slackware/slackware-12.2/source/k/config-generic-smp-2.6.27.7-smp
 cp config-generic-smp-2.6.27.7-smp /usr/src/linux/.config cp config-generic-smp-2.6.27.7-smp /usr/src/linux/.config
 </code> Alternatively, you can grab the configuration for the kernel which is currently running: <code> </code> Alternatively, you can grab the configuration for the kernel which is currently running: <code>
Line 53: Line 53:
 Walk through the forest of options. What I usually change are things like: Walk through the forest of options. What I usually change are things like:
  
-  * build the ext3 (needs the jbd driver as well) and reiser/xfs/jfs fileystem drivers into the kernel instead of compiling them as modules - that way I do not need to create an additional "[[#creating_an_initrd|initrd]]"\\ (see under "Filesystems" in the configurator).+  * Build the ext3 (needs the jbd driver as well) and reiser/xfs/jfs fileystem drivers into the kernel instead of compiling them as modules - that way I do not need to create an additional "[[#creating_an_initrd|initrd]]"\\ (see under "Filesystems" in the configurator).
  
-  * enable 64GB of RAM.\\ (under "Processor type and features" > "High Memory Support (64GB)"). Use this if you have a system with 4GB of RAM or more.+  * Enable 64GB of RAM.\\ (under "Processor type and features" > "High Memory Support (64GB)"). Use this if you have a system with 4GB of RAM or more.
  
-  * enable the "low-latency" kernel if you run a desktop/laptop computer - multimedia apps will run much smoother\\ (under "Processor type and features" > "Preemption model" > "Preemptible kernel"). If you run a desktop system with a lot of multimedia applications, then this is an useful option for you because it will keep your system more responsive even under high load.+  * Enable the "low-latency" kernel if you run a desktop/laptop computer - multimedia apps will run much smoother\\ (under "Processor type and features" > "Preemption model" > "Preemptible kernel"). If you run a desktop system with a lot of multimedia applications, then this is an useful option for you because it will keep your system more responsive even under high load.
  
-  * set a 1000 Hz timer (under "Processor type and features" > "Timer Frequency" > "1000 Hz"). A higher tick count can be beneficial to multimedia 'desktop' systems.+  * Set a 1000 Hz timer (under "Processor type and features" > "Timer Frequency" > "1000 Hz"). A higher tick count can be beneficial to multimedia 'desktop' systems.
  
-  * or set a tickless timer (dynamic ticks - under "Processor type and features" > "Tickless System (Dynamic Ticks)").+  * Or set a tickless timer (dynamic ticks - under "Processor type and features" > "Tickless System (Dynamic Ticks)"). 
 + 
 +  * If you are (re-)building a Slackware kernel, you should make sure that installing your new kernel will leave the original kernel modules intact. You do this by changing the //local-version// part of the kernel's release number to an unique string (under "General setup" > "Local version - append to kernel release"). This kernel option corresponds to **CONFIG_LOCALVERSION** in your ''.config'' file. Slackware sets that value to "-smp" for a SMP kernel to give you an idea. \\ The resulting kernel release value (as returned by "''umake -r''") for a kernel version "''2.6.27.7''" with a local-version of "''-alien''" would be "''2.6.27.7-alien''"
  
   * ... and more I can't think of right now. You can decide to disable a lot of the modules that the default config will build, to cut down on compilation time, if you don't have the hardware in your computer. You could also look at //software suspend// and //CPU frequency scaling// (under "Processor type and features") if you own a laptop.   * ... and more I can't think of right now. You can decide to disable a lot of the modules that the default config will build, to cut down on compilation time, if you don't have the hardware in your computer. You could also look at //software suspend// and //CPU frequency scaling// (under "Processor type and features") if you own a laptop.
Line 83: Line 85:
 </code> </code>
  
 +With 2.6.x kernels, running "''make''" or "''make all''" instead of "''make bzImage modules''" should be sufficient. This will build the default targets, being //vmlinuz// (the uncompressed kernel), //bzImage// (the compressed kernel which we will be using) and //modules// (all of the kernel modules). Since we do not need the uncompressed kernel I usually stick to the "''make bzImage modules''" command. \\ If you want to know more about the available //make// targets, you can run "''make help''" and examine the output. The default build targets are marked by an asterisk (*).
  
 ==== Modifying lilo.conf ==== ==== Modifying lilo.conf ====
Line 134: Line 137:
  
 <note tip>If you rebuild a package containing a kernel module, use **installpkg** rather than **upgradepkg** to install this new package without removing the original version. \\ If you used ''upgradepkg'' this would remove the old kernel module and you may still need this if you ever want to reboot into your old kernel. This trick works under the assumtion that the version of the kernel is part of the //VERSION// of your package, like here: ''svgalib_helper-1.9.25_//2.6.27.7//-i486-1.tgz''</note> <note tip>If you rebuild a package containing a kernel module, use **installpkg** rather than **upgradepkg** to install this new package without removing the original version. \\ If you used ''upgradepkg'' this would remove the old kernel module and you may still need this if you ever want to reboot into your old kernel. This trick works under the assumtion that the version of the kernel is part of the //VERSION// of your package, like here: ''svgalib_helper-1.9.25_//2.6.27.7//-i486-1.tgz''</note>
 +
 +<note warning>The method described above will leave you **unaware** of any kernel modules that you may have compiled manually instead of creating a package for them. Typically, proprietary graphics drivers such as those from //Nvidia// or //Ati// will cause a few anxious moments if you forget to recompile them for your new kernel before starting X Window... especially when your computer boots into the graphical //runlevel 4// by default.
 +
 +In that case, reboot into //runlevel 3//, download the latest version of your graphics driver and compile/install the driver. This will enable you to reboot into your graphical logon. \\ For those who forget, booting into another than the default runlevel is easy: when the LILO screen appears, type the label of your kernel (which was ''newkernel'' in our example above) and after that, type the runlevel number: <key>newkernel</key> <key>Space</key><key>3</key><key>Enter</key></note>
  
 For ALSA you have a choice: either enable the ALSA driver that is part of the kernel you've just downloaded, or leave the kernel configuration like Slackware's: disable all ALSA support in the kernel and instead re-build the alsa-driver package. The 2.6 kernels of Slackware 12.2 have all the ALSA drivers built-in because they will not work with the ALSA driver releases that you can download and install separately. For ALSA you have a choice: either enable the ALSA driver that is part of the kernel you've just downloaded, or leave the kernel configuration like Slackware's: disable all ALSA support in the kernel and instead re-build the alsa-driver package. The 2.6 kernels of Slackware 12.2 have all the ALSA drivers built-in because they will not work with the ALSA driver releases that you can download and install separately.
 Building a Linux Kernel from source ()
SlackDocs