What's new

[tutorial] create your own custom firmware!

Status
Not open for further replies.

ExZeus

Forum Expert
Joined
Jan 24, 2011
Posts
3,665
Reaction
17,004
Points
3,490
[TUTORIAL] Create your own Custom Firmware!

OFW - Official/Original FirmWare
CFW - Custom/Cooked FirmWare
Cooking - Customizing
MCU - It is the core part of your firmware. Maximum stuff is included in it if it's not repartitioned. Most CFWs would be repartitioned. Repartitioning gives us more space to put in our stuff in the section of the firmware we can easily modify.
PPM - It consists of the ROFS files. They are the ones that can be modified without causing much damage to the phone.
APE - It is the UDA file of the firmware. It goes to the C: drive (Phone Memory) of your phone. Thus it's better to leave it untouched if you want sufficient free phone memory.
Mods - Modifications. Any ready made file, which on adding to your ROFS files will bear an impact on the phone. eg. A speed mod might help you increase your phone's speed.
Brick - Death of your phone due to improper modification of files.
Note: Should you need any more help, leave a comment.


Firmware Tools
You do not have permission to view the full content of this post. Log in or register now. – Download all your OFWs
You do not have permission to view the full content of this post. Log in or register now. (NFE 0.3) – ROFS2 editor
You do not have permission to view the full content of this post. Log in or register now.– Lets you edit UDA directly
You do not have permission to view the full content of this post. Log in or register now. – Lets you remove certain components from your CFW to free space.
You do not have permission to view the full content of this post. Log in or register now. - Will help you integrate an app in your CFW.


Basics
First of all, modifying the Core file is extremely dangerous. The core undergoes a hash check which will fail if we modify it. Ofcourse there are new tools to modify core too, but I prefer modifying ROFS. Safest way. Now, ROFS is of two types. ROFS2 and ROFS3. The core file contains another type - the ROFS1. In some older phones, you might find ROFX too.
When we deal with CFWs, we mostly prefer repartitioned ones. The reason was explained above. In repartitioned CFWs, there exists no ROFS3. Instead, the ROFS3 is put into Core. To repartition, we needed to modify core. Then hash check would fail, so we added an unmodified ROFS3 which has a valid hash, into Core. The ROFS1 in the repartitioned files in in ROFS2 itself.
So, we'll we talking basically about editing ROFS2, and UDA.
Whatever we edit in the ROFS2 goes to drive Z: of your phone. This is a hidden drive that is Read-Only. You can't change it from the phone itself. To modify it, you have to modify the files in ROFS2 and then reflash your phone.
Changes in UDA go to C: (Phone Memory). Hard resetting might wipe away all your C: files. But, if you want that they shouldn't, add all the files you don't want to be wiped off to 100059c9/exludelist.txt in the UDA.
The ROFS2 of the OFW has a maximum size of ~ 33 MB. The repartitioned one has a maximum size (partition size of Z of ~110 MB. But then, even it's contents are more. By default you have some 10 MB free on the repartitioned ROFS2. The size if exceeds the partition size, will brick your phone. Thus we have tools like Nokia Firmware Cleaner to remove off the junk.
All the files in the .C00 (core) are first flashed to Z: drive. Don’t try to edit it. You may end up bricking your phone. Then ROFS2 is also flashed to Z: drive but no files except for some bookmarks and some other txt files are overwritten. If anything is overwritten, it results in a brick. So, we do not add mods to Core so that our files do not clash. ROFS3 does the same but is not used in repartitioned files (including C6 and N97 ports). The reason has been explained above. The default theme in OFW is in ROFS3. Since, it has become a part of core, it can not be removed, though hidden.
I personally use Nokia Firmware Editor (NFE 0.3) for editing ROFS2. So I’ll be explaining how to use it in this tutorial.


Having a base for your CFW
A stable codebase is extremely important. So I recommend that you decide whether you want your CFW to be based on OFW, C6, or N97. Each has its advantages and disadvantages. The OFW has the best RAM management. C6 has widgetized homescreen with new features like smart dialer and many more. N97 has widgetized homescreen. Some say it's better than C6 in RAM management. Not my opinion, though.
If you want it to be based on C6 or N97 port, download your files from here first. If you want to base it on OFW, then download the OFW files from NaviFirm. At some places, repartitioned OFW files are also available. It's recommended to use those.


Starting the REAL business
Once you are done with downloading the files, we can start off the REAL deal.
Analyze your files.
The .Vxx file is your ROFS2. It may have a name like “RM-356_52.0.007_prd.rofs2.V01”. Size ~ 100 MB. We’ll be editing it. Follow the steps below.


1) Open NFE 0.3 The window looks like this


NFE.png


2) Now click on Open File. Goto the directory where your files are located. Select it.


NFE2.png


3) Click on Extract.


Nfe3.png


4) After extraction, wait for Done! Ready for Cooking! In the bottom left corner.
5) Close the Window.
6) Open the folder which has the name of the rofs2. It can be found in the folder where NFE exe was located. In my case, the folder is “RM-356_52.0.101_PRD.ROFS2”
7) It contains two sub folders, ROFS2 and Temp. Open ROFS2. Now you have all the files extracted.


NFE5.png


8 ) Paste your mods here. Edit whatever you want in this folder.
9) Reopen NFE.
10) Now click “Reload from HDD”


NFE%252520-%252520Copy.png


11) Click on Repack/Rebuild.


NFE4.png


12) This process typically takes a few seconds if you have a good RAM and CPU. If the process rb.exe gets a good CPU usage for itself and 200-300 MB free RAM, it takes 5 seconds. Beware! On 1 GB RAM, Windows 7, it took 30 minutes! If your ROFS2 size is greater than partition size, then you will be warned not to flash it to your phone.
13) Now, the repacked, edited ROFS2 is there in the same directory with a _Rebuilt appended to its name. In my case its RM-356_52.0.007_prd.rofs2_Rebuilt.V01. Remove the _Rebuilt by renaming. Now you have your new CFW! Flash it to your phone and enjoy!


Nokia Cooker
Usually we keep UDA empty so that we may get maximum free phone memory. But should you need to add something to it, there it is. The functionality is almost same as NFE.
I'll soon explain that too.


Other modding tools
You might want to integrate an app in your CFW. It’s simple! Use SisContents to do that.


SisContents
1) Once you have downloaded SisContents, open extsis.exe. The window looks like this.


sis.png


2) Click on the open icon (the yellow folder you see above).
3) Go to the directory where you have your sis/sisx file. Open the file. The Window looks like this now.


sis2.PNG


4) Click on the Extract button (left to sign)
5) Now the sis/sisx has been extracted to a local folder. The folder automatically gets opened. You have many files with some folders.


sis3.png


6) As you can see, there are 3 folders. (C_private, C_Resource, C_sys) You have to use Nokia Cooker to paste the contents of these folders in the respective folders in UDA. Had there been no C_ appended, you could have pasted them in ROFS2.
7) Now you have your app integrated.


Using SisContents to extract resources (MIF)
How about using siscontents to extract files from almost unopenable nokia FW files? For that, Click on New, Select the device for which the FW is meant.
Click on the contents icon.


sis4.png


Now click on add entry – add file entry. Add the FW mif file you want to edit. Say “Series60Skin.mif”
A resource will appear added to the list. When you double click it, it shows all entries inside the resource files (like images). You can Extract the image, edit it and replace the original image with it. Just click on extract in the left pane, and then make any changes to the image. Now, click on your image. Replace resource in the left pane. Viola!


Using FW Cleaner
1) Open FW Cleaner. Enter the path to your ROFS2


clean.png


2) A new window opens. Click on the components you want to REMOVE. Next, click on Backup if you want to be on the safer side. Then click on the green plus sign.


clean2.png


3) Click on the Red cross on the right hand side. You'll see a message "Done!"
It's done!
Now you have more free space.


After you are done, flash it to your phone​
 

Attachments

Status
Not open for further replies.
Back
Top