Editing Compiling the kernel

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 16: Line 16:
In order to modify the default kernel configuration, a few things need to be done. Assuming that the kernel has been built at least once, perform the following procedure to build a modified kernel for Maemo:
In order to modify the default kernel configuration, a few things need to be done. Assuming that the kernel has been built at least once, perform the following procedure to build a modified kernel for Maemo:
-
'''1.''' Edit ~/maemo-kernel/kernel-source-diablo-2.6.21/debian/rules so that modifications may be done.
+
'''1.''' Edit ~/maemo-kernel/kernel-source-diablo-2.6.21/debian/rules so that modifications may be done
-
Make sure the following two lines are commented out or removed completely:  
+
Make sure the following two lines are commented or removed completely:  
* build-stamp section: tar jxf /usr/src/kernel-source-$(SOURCE_VERSION).tar.bz2  
* build-stamp section: tar jxf /usr/src/kernel-source-$(SOURCE_VERSION).tar.bz2  
* clean section: rm -rf kernel-source-$(SOURCE_VERSION)
* clean section: rm -rf kernel-source-$(SOURCE_VERSION)
-
'''2.''' Change file permissions for default config file.
+
'''2.''' Change file permissions for default config file
  $ chmod a+w ~/maemo-kernel/kernel-source-diablo-2.6.21/kernel-source/arch/arm/configs/n770_defconfig  
  $ chmod a+w ~/maemo-kernel/kernel-source-diablo-2.6.21/kernel-source/arch/arm/configs/n770_defconfig  
Line 28: Line 28:
'''3.''' Make your modifications to ~/maemo_kernel/kernel-source-diablo-2.6.21/kernel-source/arch/arm/configs/n770_defconfig
'''3.''' Make your modifications to ~/maemo_kernel/kernel-source-diablo-2.6.21/kernel-source/arch/arm/configs/n770_defconfig
-
'''4.''' Recompile the kernel image:
+
'''4.''' Recompile the kernel image
  $ cd  
  $ cd  
Line 49: Line 49:
  $cc -print-file-name=libncursesw.so | grep -q /
  $cc -print-file-name=libncursesw.so | grep -q /
  if [ $? -eq 0 ]; then
  if [ $? -eq 0 ]; then
 +
 +
=Deploying the Kernel Onto the Device=
 +
 +
The kernel kernel image is deployed onto the device by issuing the following command:
 +
 +
# flasher -f -k /scratchbox/users/<username>/targets/MAEMO_KERNEL/usr/share/osso/kernels/zImage-su-18-<yyyyww>
 +
 +
This command is executed outside Scratchbox, assuming that the flasher utility is in $PATH.
 +
 +
Or if you want to be safe, you can test boot it with: (without actually permanently modifying the kernel)
 +
 +
# flasher -l -b -k /scratchbox/users/<username>/targets/MAEMO_KERNEL/usr/share/osso/kernels/zImage-su-18-<yyyyww>
 +
 +
instead.
 +
 +
If that doesn't work (hangs indefinitely while trying to find device), try:
 +
mount -t usbfs none /proc/bus/usb/
=Things to Remember When Working with Linux Kernel and Maemo=
=Things to Remember When Working with Linux Kernel and Maemo=
Line 54: Line 71:
Below is a list of things that should be taken into consideration when working with the Linux kernel and Maemo.
Below is a list of things that should be taken into consideration when working with the Linux kernel and Maemo.
-
=Modules and Initfs=
+
=Modules and initfs=
-
Your kernel image must be compatible with the modules in the initfs image on the device. If you flash a custom kernel image that is incompatible with the modules in initfs, you may see constants reboots. This can be fixed either by making the kernel compatible (use same or very similar gcc compiler and kernel configuration) or by rebuilding the initfs image with your version of modules. For a list of essential modules see: '''/lib/modules/current''' in the initfs image or '''/mnt/initfs/lib/modules/current''' directly on the device. Also, if you enabled some additional functionality as modules, you may need to copy them manually to the initfs on the device (if there is free space) or put them somewhere in the root filesystem of the device.
+
Your kernel image have to be compatible with modules in initfs image on the device. If you flash custom kernel image incompatible with modules in this initfs you may see constants reboots. This can be fixed either by making the kernel compatible (use same or very similar gcc compiler and kernel configuration) or by rebuilding initfs image with your version of modules. For a list of those essential modules see: '''/lib/modules/current''' in the initfs image or '''/mnt/initfs/lib/modules/current''' directly on the device. Also if you enabled some additional functionality as modules you may need to copy them manually to the initfs on the device (if there is free space) or better put them somewhere in the root filesystem.
=Kernel Partition Size=
=Kernel Partition Size=
Line 70: Line 87:
After this, flash the kernel image as instructed in Section 4.
After this, flash the kernel image as instructed in Section 4.
-
 
-
----
 
-
 
-
----
 
==Flash from Fiasco Image==
==Flash from Fiasco Image==
Line 97: Line 110:
  4
  4
-
There is another 4 Pin connector nearby, on both the n800 and n810. those are related to usb.(we did get some bus reset signals when playing with them)
+
There is an other 4 Pin connector near on booth th n800 and n810. those are related to usb.(we did get some bus reset signals when playing with them)
   1
   1
Line 105: Line 118:
Once your done with your cable, enable the R&D mode and set the serial console flag and connect via 8N1,115200.
Once your done with your cable, enable the R&D mode and set the serial console flag and connect via 8N1,115200.
<pre>
<pre>
-
$sudo ./flasher --enable-rd-mode --set-rd-flags=serial-console
+
$sudo ./flasher <del>enable-rd-mode </del>set-rd-flags=serial-console
Password:
Password:
Suitable USB device not found, waiting
Suitable USB device not found, waiting
Line 116: Line 129:
-
[[Category:HowTo]]
+
[[Category:HowTos]]
[[Category:Midgard wiki]]
[[Category:Midgard wiki]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: