5,593,650 Members 39,333 Now Online
XDA Developers Android and Mobile Development Forum

[DIY GUIDE] Create a personalized ROM yourself! [UPDATED: 02-04-2014]

Tip us?
 
[NUT]
Old
(Last edited by [NUT]; 2nd April 2014 at 10:11 AM.)
#1  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Default [DIY GUIDE] Create a personalized ROM yourself! [UPDATED: 02-04-2014]

Introduction
After releasing my 'Update to .253' thread, I've figured it is something you might want to do your self, maybe because you like to use your own created FTF, or even want to modify your ROM a bit before flashing. This guide will help you through it, as secure and successful as possible!

Anyone can do it!
There is no need to unlock your bootloader to work this guide, however it did help me out of some sticky situations myself, as long as you keep a cool head while working on your ROM, you'll be able to get out of any situation.

The XDA mantra: MAKE BACKUPS!
Before you do anything on your phone, make sure you create a solid backup first. As CWM and TWRP both do not backup your internal storage, create a backup of it's contents too before trying to install your very own ROM.

Prerequisites
Flashtool version 0.9.15.0 - Windows / Linux / Mac

Needed to flash your phone, also needed to create the FTF bundle. The Linux version is already installed in the VM but you can download any other version too, to do the flashing and FTF building before hand in a desktop enviroment you are accustomed to.

[GUIDE] Download ANY firmware customization from Sony & create an FTF with Flashtool

This thread will help you make an FTF file for your DIY project, as we already have this excelent thread I will save myself the trouble of creating a guide for that

VMWare Player (76Mb) (Free for non-commercial use) and [NUT]'s UbuntuHost VM (Bittorrent: 4.84Gb)

The VM you download is OK to use on any 4.1.2 ROM as base.
If you wish to use a 4.2.2 ROM, you will need the DIYGuide UPDATE PACKAGE 1 (Bittorrent: 169Mb).
If you wish to use a 4.3 or 4.4 ROM, you will be needing DIYGuide UPDATE PACKAGE 2 (Bittorrent: 159Mb). Flashtool however needs to be updated to 0.9.15.0 if you are going to build a 4.4 ROM
See the index below for the link to the guide post that explains how to use it.

This you will need for the tricky bits, as modifying a ROM is safer on a Linux host with less chances of breaking file permissions. As most of the world around us uses Windows, I've created a VM to support you in your tasks. I've installed the Linux tools you need, for me this VM works just fine.

The VM needs about 10Gb space on your pc and you need around 1Gb of free RAM when trying to use it smoothly.

This VM also contains a build script, simple but effective, which will create the (unsigned) flashable zip for you, grabbing all the files it needs along the way and giving you time to edit what ever you want during the building process.

I've made sure you have fastboot and adb commands to be found in the PATH variable, and that the connection to most android phones and tablets will most probably work just fine. You can do adb and fastboot commands to your phone without having them in the directory where you keep the files, easy to use!

The VM has one user, which is called XDA Community. To log in on Ubuntu, use the following credentials:
User: xda
Password: xdauser

This user has SUDO privileges, so expect to type that password again when prompted to do so while installing packages or even when running the rombuilder script.

Download and install WinRAR or 7Zip to be able to unpack my VM.

Included in the ROM you will build using this DIY Guide
Your DIY ROM will be rooted with SuperUser (or SuperSU when you used an update package), including the reboot fix. It will also include XZDualRecovery 2.3 RELEASE (or newer if you used an update package). So you will end up with a cool ROM!

Extra's
You will be able to use my AROMA ROM Mutator package to fix your JB 4.1 ROM if anything might fall to pieces in the future regarding root. You'll also be able to use it to make the switch from SuperUser to SuperSU using the mutator, if you might change your mind in the future.

Guide Index
Chapter 1: Introduction and Prerequisites
Chapter 2: Installing VMWare Player and getting 'UbuntuHost' running
Chapter 3: Preparing the FTF for NOOB use
Chapter 4: Preparing and Extracting the ROM
Chapter 5: Building the (unsigned) flashable ZIP
Chapter 6: Installing your DIY ROM
Addendum: How to replace the recoveries to suit your device
Addendum: How to update your VM
Frequently Asked Questions

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 52 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
[NUT]
Old
(Last edited by [NUT]; 3rd June 2013 at 08:09 AM.)
#2  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Info 2 Installing VMWare Player and getting 'UbuntuHost' running

I'm assuming you have downloaded the VMWare Player application suitable for your system. Installing it is a basic knowledge to most Windows users, so I'm not going to elaborate on the actual installation.

I'm also assuming you have downloaded the VM. You can now unpack it to your Documents folder.

Now, fire up VMware player and when you see the following...



Then click on 'Open a Virtual Machine' and navigate to the folder you just extracted:



Click on the UbuntuHost.vmx and confirm the choice. You'll end up with this view:



Now you can either double click on the name in the list on the left or click play on the right to start it.



Remember, the password is xdauser



NOTE: This Ubuntu has the Unity interface which means, among other things, the menus are moved from the application window to the top bar. Move your mouse over it and the menus will appear.

And you are ready for the next chapter!

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 11 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
[NUT]
Old
(Last edited by [NUT]; 3rd June 2013 at 08:10 AM.)
#3  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Info 2 Preparing the FTF for NOOB use

Why would you do that? Well... to make sure you won't screw up flashing the wrong bits and make it erase your userdata... better safe then sorry!

This step is actually also needed to unpack the system partition from the FTF you created using the guide I put in the OP.

Copy the FTF you created to the VM by dragging the file in to the VM window. You can see Ubuntu recognizes it as a ZIP, which it essentially is.

Open it by double clicking on it.



Now delete userdata.sin, cache.sin and appslog.sin from it. Then drag system.sin to the DIY Guide folder on the desktop. Once it's unpacked, delete system.sin from the FTF as well.



That was easy, wasn't it? Lets move on to the next chapter.

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 14 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
[NUT]
Old
(Last edited by [NUT]; 3rd June 2013 at 08:10 AM.)
#4  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Info 2 Preparing and Extracting the ROM

Click on the Terminal icon on the left, type 'cd FlashTool' and then './FlashTool'.
NOTE: Use 'sudo' and your password you used to login to run FlashTool as root if you run in to problems.



In the Tools menu, you can select Sin Editor, select the system.sin in your DIY_Guide folder in your home.



Then click 'Extract data' to start the extraction, now go get a cup of coffee, this might take a while



Once it's done you will end up with a file called 'system.ext4' inside your DIY_Guide directory.



Click Close and close FlashTool using the orange X in the top left corner.

You can rename it to something you like but it should end with '.ext4' to allow the scripts to recognize it. Just open up the DIY Guide folder on the desktop and right click on the system.ext4 file and choose 'Rename'. For purpose of demonstration I renamed mine to 'nuts.ext4'

NOTE: The scripts allow for more then one flashable system to be created, so you can repeat the above multiple times, just remember to rename the system.ext4 to something else, otherwise you'll just end up overwriting the same file over and over again

Because of size considerations, the virtual disk is not really big (10Gb) so you'll run out of space fairly quickly, do not forget to empty the trash after this step!

That's it for this chapter, lets move on!

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 14 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
[NUT]
Old
(Last edited by [NUT]; 2nd July 2013 at 11:05 AM.)
#5  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Info 2 Building the (unsigned) flashable ZIP

Now we can open the Terminal by clicking on the icon on the left with the '>_' sign in the 'monitor'. Change directory to DIY_Guide and type 'ls -la' to show the following



You can start the build process using the rombuilder script by typing './rombuilder' and it will ask you for your password before it starts.
Once it successfully mounts the system partition it will open it for you. The script will pause for you to complete whatever modifications you want to do to it. Remember the XDA Mantra? Well... a backup would be good to make right now.



If you have more then one system.sin extracted, the above process will repeat itself until it passes all the various .ext4 files it has found.

NOTE: The mounted ext4 image has been mounted as root and as the contents are owned by root, you will need to sudo your actions when modifying the contents!

Tip: To make it easy on yourself you can use the terminal to open a file manager running as root. Type ctrl+shift+t, this will open a new terminal tab. In there type 'sudo nautilus' which starts the file manager again, but with an appropriate warning at the top of the explorer window, that one will be running as root. Be careful, you might wreck your entire VM if you mess things up big!

Once you are finished with the modifications or just enter through to the next bit, it will pack up the system partition and repeat or when done it will continue to create a flashable ZIP for each of the different .ext4 files you created.



You're almost done! Lets move to the next chapter...

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 13 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
[NUT]
Old
(Last edited by [NUT]; 27th December 2013 at 09:44 PM.)
#6  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Info 2 Installing your DIY ROM

FOR 4.1.2 ROM's:

Before doing these steps, remember to have any recovery installed on your phone if you are doing this with a locked bootloader, otherwise you won't be able to flash the zip you've built!
  1. Put your '$NAME.flashable.zip' on (the external) SDcard;
  2. Put the 'FTF' inside the FlashTool/firmwares folder;
  3. Create a backup of your phone in CWM or TWRP and don't forget to backup the contents of 'SDCard0';
  4. Flash everything in the 'FTF' to your phone and boot the phone straight to recovery after that;
    NOTE: If you have an unlocked bootloader, you CAN flash the kernel, but you do not need to, to keep your custom kernel.
  5. Flash '$NAME.flashable.zip' in recovery (Works in both CWM and TWRP!)
  6. Reboot to system without clearing (dalvik-/)cache.

And you're done!

FOR 4.2.2 AND 4.3 ROM's:

Before doing these steps, remember to have any recovery installed on your phone if you are doing this with a locked bootloader, otherwise you won't be able to flash the zip you've built! You will need XZDualRecovery 2.5 BETA or newer to make this work.

NOTE: This guide assumes you are coming from a 4.1.2 ROM. If you have a 4.2.2 ROM already installed, you can skip this one and use the above guide.
  1. Put your '$NAME.flashable.zip' on (the external) SDcard;
  2. Put the 'FTF' inside the FlashTool/firmwares folder;
  3. Create a backup of your phone in CWM or TWRP and don't forget to backup the contents of 'SDCard0';
  4. Flash '$NAME.flashable.zip' in TWRP, then TURN YOUR PHONE OFF AFTERWARDS - DO NOT BOOT IT YET!
  5. Flash everything in the 'FTF' to your phone;
  6. Now boot to system without clearing (dalvik-/)cache.

And you're done!

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 11 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
[NUT]
Old
(Last edited by [NUT]; 2nd April 2014 at 10:09 AM.)
#7  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Question Addendum: How to replace the recoveries to suit your device

Download XZDualRecovery specific for your device, the flashable package to be precise.

Drag the file to the VM window and open the zip. You will see 2 folders in there, traverse in to system/bin where you will see the files you need most.
Open the DIY_Guide on the VM's desktop, traverse to updater/system/bin and drag all the files from the zip in to this directory, replacing all the files already in your VM and you are set to go

On the Xperia Z Ultra and Z1, don't forget to copy the disableric file from the tmp folder inside the recovery zip to the updater/system/xbin folder. Forgetting to do so will cause your system partition to be not fully accessible from the fully booted ROM.

For completeness, you could copy the dr.prop file inside the zip to the updater directory too: this will ensure people downloading your package will know what XZDR version was included.

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 4 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
[NUT]
Old
(Last edited by [NUT]; 29th December 2013 at 11:30 PM.)
#8  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Default Addendum: How to update your VM

The update package 1 contains the following:
  • FlashTool 0.9.11.0
  • XZDualRecovery 2.5 BETA
  • The Remount-Reboot fix
  • Superuser has been replaced by SuperSU

IMPORTANT NOTE: This update makes your flashable ZIP assume you are updating from a 4.1.2 ROM to a 4.2.2 ROM. So the resulting flashable ZIP will move the contents of your internal storage to the new 4.2.2 location. If you are creating a package to go from a 4.2.2 ROM to a 4.2.2 ROM, you will need to edit the updater-script to stop it from doing that

Code:
ui_print("  Moving contents of the internal storage to it's new location...");
ui_print("");
ui_print("  NOTE: This may take a while!");
ui_print("");
run_program("/sbin/busybox", "mv", "/data/media", "/data/temporary");
run_program("/sbin/busybox", "mkdir", "/data/media");
run_program("/sbin/busybox", "mv", "/data/temporary", "/data/media/0");
set_progress(0.850000);
Remove the above portion from updater/META-INF/com/google/android/updater-script using gedit and you're set!

The update package 2 contains the following:
  • Flashtool 0.9.13.0
  • SuperSU 1.86
  • XZDualRecovery 2.7.62.

How to update:
  1. Download the update package from the link in the OP;
  2. Open the Home directory in the VM on the bar on the left;
  3. Drag the file in to the home directory straight from your host PC's location where you stored the downloaded package;
  4. Remove the FlashTool and DYI_Guide folders or rename them (to rename, right click on them to get the menu with the rename option);
  5. Now open the diyvm-update.tar.gz, drag the 2 folders in to the Home directory.

All done!

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 6 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
[NUT]
Old
(Last edited by [NUT]; 29th December 2013 at 12:40 AM.)
#9  
[NUT]'s Avatar
Recognized Contributor - OP
Thanks Meter 4234
Posts: 3,372
Join Date: Oct 2012
Location: Cyberspace and the Universe

 
DONATE TO ME
Question Frequently Asked Questions

Q: Could I use this for any other Xperia device?
A: Sure you can! The proof is starting to pop up now and then
Just make sure you put in the right recovery pieces to support your specific device

My devices:
Daily driver: Xperia Z (C6603)
Development Phones: Xperia T (LT30p), Xperia Z1 (C6903) Thanks to the XDA community!
Backup: Xperia Arc (LT15i)

My work for the community on XDA:
XZDualRecovery ~ Z1/ZU/Z/ZL DISASTER RECOVERY ~ [DYI Guide]Create a personalized ROM yourself! ~ The definitive root Remount-Reboot fix!

Update your Z1 to KK4.4.2!

My file hosting: http://nut.xperia-files.com/ ~ Please do not mirror my files!
The Following 5 Users Say Thank You to [NUT] For This Useful Post: [ Click to Expand ]
 
Fishmanzero
Old
#10  
Senior Member
Thanks Meter 23
Posts: 117
Join Date: Sep 2010
Would be very useful! Thank you for the nice and clear guide!

Could you please also provide the script and other files needed such recovery etc. ? The whole VM image is large...

Tags
flashtool, guide, rom, root, vmware
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes