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

From Pandora Wiki
Jump to: navigation, search
(The fun part: tweaking)
 
(11 intermediate revisions by the same user not shown)
Line 9: Line 9:
  
 
= Downloading and pre-configuring the latest kernel sources =
 
= 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:
 
* Plug the net, be root, then:
  mkdir -p /usr/src/
+
sh /root/kernel-sync.sh
  cd /usr/src/
+
* 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
 
  git clone git://openpandora.org/pandora-kernel.git
 +
 
  ln -s pandora-kernel linux
 
  ln -s pandora-kernel linux
 +
 
  cd pandora-kernel
 
  cd pandora-kernel
 +
 
  git checkout --track -b pandora-3.2 origin/pandora-3.2
 
  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
 
  make omap3_pandora_defconfig
  
Line 22: Line 35:
 
* You can use many tools to edit the configuration.
 
* You can use many tools to edit the configuration.
 
* The kamikaze way: edit manually the .config . Don't do that.
 
* The kamikaze way: edit manually the .config . Don't do that.
* The lazy way: install KDE and use:
+
* The lazy way: install KDE and use as a user:
make xconfig
+
gksu make xconfig
 
* The common way, which i recommend:
 
* The common way, which i recommend:
 
make menuconfig
 
make menuconfig
 
+
== Menuconfig ==
= Menuconfig =
 
 
* Kernel options are stored in a tree.
 
* Kernel options are stored in a tree.
 
* Options can be marked as [*] built-in, or <M> module.
 
* Options can be marked as [*] built-in, or <M> module.
Line 33: Line 45:
 
* Built-in means inside the kernel, so once the kernel boots, you can't remove or change parameters.
 
* 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" ?
 
* 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.
+
* 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>
 
  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  [ ]
 
  excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend: [*] built-in  [ ]
Line 56: Line 68:
 
  <Select>    < Exit >    < Help >
 
  <Select>    < Exit >    < Help >
  
= A simple tweak =
+
== A simple tweak ==
 
* Highlight  Cryptographic API  --->
 
* Highlight  Cryptographic API  --->
 
* Push [enter]. You're now in the Cryptographic API section.
 
* Push [enter]. You're now in the Cryptographic API section.
Line 68: Line 80:
 
* Be sure you've overclocked your OP to the maximum MHz.
 
* Be sure you've overclocked your OP to the maximum MHz.
 
* At 800MHz, it's a 3+ hours job.
 
* At 800MHz, it's a 3+ hours job.
* Now you can compile it with:
+
* Now you can compile it with another custom script:
  cd /usr/src/linux/
+
  sh /root/kernel.sh
make clean
 
make uImage
 
make modules
 
make modules_install
 
rm /boot/uImage
 
cp arch/arm/boot/uImage /boot/uImage
 
 
* Reboot.
 
* Reboot.
  
 
= Speed up the compilation time using two or more Pandoras =
 
= Speed up the compilation time using two or more Pandoras =
 
* Read [http://pandorawiki.org/Software_projects/OS/Slackware/Advanced_usage/Distributed_compilation this], and set up your Pandoras.
 
* Read [http://pandorawiki.org/Software_projects/OS/Slackware/Advanced_usage/Distributed_compilation this], and set up your Pandoras.
* Then compile, replacing previous related commands with:
+
* Make the adequate changes in /root/kernel-dist.sh with your editor of choice.
  make -j4 CC=distcc uImage
+
* Then compile with:
make -j4 CC=distcc modules
+
  sh /root/kernel-dist.sh
In the -j(n), n represents the (number of CPU used X 2), so if you compile with 10 OP, it will be -j20 .  
+
* Reboot.
  
 
= 3D driver =
 
= 3D driver =
* As it's not open source, you have to grab it on the Texas Instruments website.
+
* So you booted your OP with your brand new kernel, but you can't run 3D apps. Again, two custom scripts for lazy people.
* More on this later.
+
* Download the sources:
 +
sh /root/3d-get-sources.sh
 +
* Compile and install them:
 +
sh /root/3d-compile.sh
 +
* Reboot.
  
 
= Older Wiki page =
 
= Older Wiki page =
Line 93: Line 103:
  
 
[[Category:Development]]
 
[[Category:Development]]
 +
[[Category:Kernel]]
 
[[Category:Slackware]]
 
[[Category:Slackware]]
 
[[Category:Software]]
 
[[Category:Software]]
 
[[Category:System]]
 
[[Category:System]]

Latest revision as of 01:06, 11 January 2013

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 as a user:

gksu 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.