Difference between revisions of "Software projects/OS/Slackware/Advanced usage/Kernel"

From Pandora Wiki
Jump to: navigation, search
m (3D driver)
Line 92: Line 92:
  
 
= 3D driver =
 
= 3D driver =
* So you booted your OP with your brand new kernel. Again, two custom scripts for lazy people.
+
* So you booted your OP with your brand new kernel, but you can't run 3D apps. Again, two custom scripts for lazy people.
 
* Download the sources:
 
* Download the sources:
 
  sh /root/3d-get-sources.sh
 
  sh /root/3d-get-sources.sh

Revision as of 20:37, 3 December 2012

Kernel: to recompile or not to recompile ?

  • You don't have to if you don't need to add a new feature.
  • You don't have to if there's no urgent security kernel update.
  • If you want to acquire a lot of global Linux knowledge, or if you are just curious, then yes, just go for it.

Is it simple or complicated to recompile ?

  • Both.
  • But as there's a default kernel configuration file for Open Pandora, it's pretty easy.

Downloading and pre-configuring the latest kernel sources

Directly on the Pandora

  • I wrote a script to automatize the OP kernel sources download and preparation.
  • Plug the net, be root, then:
sh /root/kernel-sync.sh
  • It's very long because of the 16MB/s SD slots throughput.

From a PC

If you prefer to speed up the process and download them from your computer, then proceed like this (assuming your SD card is mounted under /media/SLACK/):

mkdir -p /media/SLACK/usr/src/
cd /media/SLACK/usr/src/

git clone git://openpandora.org/pandora-kernel.git

ln -s pandora-kernel linux

cd pandora-kernel

git checkout --track -b pandora-3.2 origin/pandora-3.2
  • Then boot the pandora, and do this as root:
cd /usr/src/linux
make omap3_pandora_defconfig

The fun part: tweaking

  • The configuration is stored in a hidden file named /usr/src/linux/.config
  • You can use many tools to edit the configuration.
  • The kamikaze way: edit manually the .config . Don't do that.
  • The lazy way: install KDE and use:

make xconfig

  • The common way, which i recommend:

make menuconfig

Menuconfig

  • Kernel options are stored in a tree.
  • Options can be marked as [*] built-in, or <M> module.
  • The vast majority of those options refers to a driver or a functionality.
  • Built-in means inside the kernel, so once the kernel boots, you can't remove or change parameters.
  • Module means you can either add or remove them after the boot. Ever typed "modprobe ehci-hcd" ?
  • The example below is copied from my PC, will copy a real OP one later.
Arrow keys navigate the menu.  <Enter> selects submenus --->.  Highlighted letters are hotkeys.  Pressing <Y> includes, <N>
excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend: [*] built-in  [ ]
excluded  <M> module  < > module capable 
[*] DMA memory allocation support
General setup  --->
[*] Enable loadable module support  --->
[*] Enable the block layer  --->
Processor type and features  --->
Power management and ACPI options  --->
Bus options (PCI etc.)  --->
Executable file formats / Emulations  --->
[*] Networking support  --->
Device Drivers  --->
Firmware Drivers  --->
File systems  --->
hacking  --->
options  --->
Cryptographic API  --->
Virtualization  --->
Library routines  --->
<Select>    < Exit >    < Help >

A simple tweak

  • Highlight Cryptographic API --->
  • Push [enter]. You're now in the Cryptographic API section.
  • With [space], select all cryptographic algorithms you can. Ensure they are marked as <M>, not <*>.
  • With [right], select < Exit >, then push [enter].
  • Again, with [right], select < Exit >, then push [enter].
  • Now push [enter], saying <Yes> to "Do you wish to save your new configuration ?".
  • You're now ready to compile a kernel which will drive James Bond angrily jealous.

Kernel compilation

  • Be sure you've overclocked your OP to the maximum MHz.
  • At 800MHz, it's a 3+ hours job.
  • Now you can compile it with another custom script:
sh /root/kernel.sh
  • Reboot.

Speed up the compilation time using two or more Pandoras

  • Read this, and set up your Pandoras.
  • Make the adequate changes in /root/kernel-dist.sh with your editor of choice.
  • Then compile with:
sh /root/kernel-dist.sh
  • Reboot.

3D driver

  • So you booted your OP with your brand new kernel, but you can't run 3D apps. Again, two custom scripts for lazy people.
  • Download the sources:
sh /root/3d-get-sources.sh
  • Compile and install them:
sh /root/3d-compile.sh
  • Reboot.

Older Wiki page

  • 13.37 page is located here.