The Following 49 Users Say Thank You to NiQ For This Useful Post: | ||
anapospastos, arora.rohan, bingomion, blue_led, cfh11, cheve, chrget, Chrome, clasificado, debernardis, Fabry, Flynx, futtawuh, fw190, Halftux, handaxe, hardkorek, ivgalvez, jj0, joerg_rw, JorgeFX, jstokes, jurop88, laasonen, maacruz, MaddogG, Magik, Megaltariak, Mentalist Traceur, misiak, mr id, MyNokiaN900, Netweaver, Nikem, noorallah, peterleinchen, reinob, rfranz, sinaisix, slender, Switch_, ThomasAH, Tiboric, traysh, trompkins, tuminoid, vi_, woody14619 |
|
2011-03-15
, 18:59
|
|
Posts: 1,455 |
Thanked: 3,309 times |
Joined on Dec 2009
@ Rochester, NY
|
#2
|
The Following User Says Thank You to woody14619 For This Useful Post: | ||
|
2011-03-15
, 19:02
|
|
Posts: 433 |
Thanked: 312 times |
Joined on Nov 2009
@ U.K
|
#3
|
|
2011-03-16
, 14:32
|
Posts: 102 |
Thanked: 140 times |
Joined on Sep 2010
@ Israel
|
#4
|
|
2011-03-16
, 18:15
|
|
Posts: 1,455 |
Thanked: 3,309 times |
Joined on Dec 2009
@ Rochester, NY
|
#5
|
|
2011-03-17
, 07:10
|
Posts: 186 |
Thanked: 79 times |
Joined on Feb 2010
|
#6
|
|
2011-03-19
, 21:36
|
|
Posts: 2,222 |
Thanked: 12,651 times |
Joined on Mar 2010
@ SOL 3
|
#7
|
As I spent the last week trying to compile my own kernel based on kernel-power (and adding CD-ROM drivers) and ran into virtually any possible problem, here's my definite A-Z guide for recompiling kernel-power.
So here goes:
Step 1 - Setting up your environment
You will need a Linux machine with Scratchbox and the Maemo SDK installed. If you only have Windows machines then too bad. You will need to repartition your HD and install Linux or use virtualization utilities like VMWare to have a Linux instance running. I used Debian GNU/Linux as my platform but most people recommend using Ubuntu, which is supposedly a lot more user-friendly. Anyway, It's just according to taste.
Go to the Maemo 5 SDK installation for beginners on Nokia's website and install Scratchbox, the SDK and the Nokia binaries according to the instructions. Stop just before the "Running Maemo 5 SDK" paragraph.
If installing the SDK crashes with the "Error opening terminal" message: Exit scratchbox if you're in it and perform the solution discussed here. If you're working from an X terminal, type the following commands as root:
Important: From now on, all commands specified are to be entered inside scratchbox, not directly on your Linux machine. Entering these commands directly on your Linux machine (especially as root) will cause problems.
Step 2 - Adjust Scratchbox for kernel compilation
Create a new target called MaemoKernel with qemu-arm CPU transparency. The second command installs the armel rootstraps to the target. The last command installs the C-library, /etc, devkits and fakeroot.
Unfortunately in many cases the MaemoKernel target will end-up broken (i.e. with a lot of missing dependencies). To make sure that we have all of the required packages, perform the following commands:
Finally, install the Nokia binaries as mentioned in step 1.
Our environment is ready.
Step 3 - Obtain kernel-power sources
Add the extra repositories to scratchbox by adding the following lines to /etc/sources.list
Create a new directory for the kernel sources and switch to it:
Important: Other guides use the following command to obtain the kernel-power sources:
Step 4 - Configure the kernel
First of all, enter the kernel sources directory using:
<extraversion> for the stock kernel is: -omap1
<extraversion> for kernel-power it is: .10power46
I used the following: .10power46-niq
The configuration utility should now load. It should already have the default configuration of kernel-power so you can modify whatever you want. If it doesn't seem to have the kernel-power configuration, type the following command:
Step 5 - Compiling the kernel
Edit the following file with your favorite editor:
Compile the kernel using the following command
Step 6 - Compiling and assembling the kernel modules:
Compile the modules with the following command:
You can now exit scratchbox.
Step 7 - Copying module files to the phone
Note: Before you begin this step, make sure you already have kernel-power installed. If not, install it now from the app manager or by typing the following command in a root shell on the phone:
Copy all the .ko files from the modules directory of your development machine (the scratchbox directory hierarchy is located inside /scratchbox on the development machine) to the directory you've just created on your phone.
Make sure the directory and all files in it are owned by root (otherwise due to security concerns the kernel won't load them). Enter the following commands as root on the phone in the
/lib/modules directory:
It is now time to test our new kernel on the phone. Note that we use a special method to boot the new kernel on the phone without actually flashing it, which means that if it doesn't work, it takes nothing more than a single reboot to revert back to the previous kernel.
Obtain the Maemo Flasher-3.5 from here and install it.
Copy the zImage file containing the kernel image to the machine on which you have the flasher installed. Now shut-down your phone (give it a little time to rest because if you touch it in the few seconds after you shut down it boots right back up). Take the USB data cable that came with your phone and connect it to your computer. Now hold the letter 'U' on your phone and while holding it, connect the cable to the phone. If everything went OK, you should be seeing a Nokia logo on your phone screen with the USB symbol in the upper-right corner. This means that the device is now in flashing mode (don't worry, we don't flash yet). If the machine from which your're running the flasher is a Windows machine you will have to wait a while for Windows to install the appropriate driver if this is the first time you connect your phone in flashing mode.
Now it's time to test your new kernel. Type the following command on your machine where the flasher is installed in the flasher's directory:
Extremely important: If your new kernel does not boot or your device immediately shuts down / restarts or you experience any other problem that you have not experienced earlier DO NOT PROCEED to the next step!!! Reboot the phone immediately to revert to your previous kernel and ask here for advice.
Step 9 - Flashing the new kernel
So now it's the time to permanently install your new kernel on the phone. First, return to scratchbox and edit the following file:
Copy the newly created zImage from the development machine to the flashing machine (if they are not the same one). Now put the phone into USB flashing mode as described in step 8 and then flash it uing the following command:
Congratulations, you now have a new kernel.
Please write back if you found this useful.
Last edited by NiQ; 2011-03-21 at 17:35. Reason: Added changing permissions / ownership of the module files.