Software projects/OS/Slackware/Advanced usage/Kernel
From Pandora Wiki
Revision as of 15:12, 17 April 2012 by Linux-SWAT (talk | contribs)
Contents
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
- Plug the net, be root, then:
mkdir -p /usr/src/ cd /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 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 exemple below is copied from my PC, will copy the 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:
cd /usr/src/linux/ make clean make uImage make modules make modules_install rm /boot/uImage cp arch/arm/boot/uImage /boot/uImage
- Reboot.
Speed up the compilation time using two or more Pandoras
- Read this, and set up your Pandoras.
- Then compile, replacing previous related commands with:
make -j4 CC=distcc uImage make -j4 CC=distcc modules
In the -j(n), n represents the (number of CPU used X 2), so if you compile with 10 OP, it will be -j20 .
3D driver
- As it's not open source, you have to grab it on the Texas Instruments website.