yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] [NUT]:
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!

Put your '$NAME.flashable.zip' on (the external) SDcard;

Put the 'FTF' inside the FlashTool/firmwares folder;

Create a backup of your phone in CWM or TWRP and don't forget to backup the contents of 'SDCard0';

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.

Flash '$NAME.flashable.zip' in recovery (Works in both CWM and TWRP!)

Reboot to system

without

clearing (dalvik-/)cache.

And you're done! :victory:

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.

Put your '$NAME.flashable.zip' on (the external) SDcard;

Put the 'FTF' inside the FlashTool/firmwares folder;

Create a backup of your phone in CWM or TWRP and don't forget to backup the contents of 'SDCard0';

Flash '$NAME.flashable.zip' in TWRP, then

TURN YOUR PHONE OFF AFTERWARDS - DO NOT BOOT IT YET!

Flash everything in the 'FTF' to your phone;

Now boot to system

without

clearing (dalvik-/)cache.

And you're done! :victory:
[Sony Cross-Device General] [NUT]:
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, Z1 Compact, Z1 and (Tablet) Z2, 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.
[Sony Cross-Device General] [NUT]:
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 :)

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! :fingers-crossed:

The update package 2 contains the following:

Flashtool 0.9.13.0

SuperSU 1.86

XZDualRecovery 2.7.62.

How to update:

Download the update package from the link in the OP;

Open the Home directory in the VM on the bar on the left;

Drag the file in to the home directory straight from your host PC's location where you stored the downloaded package;

Remove the FlashTool and DYI_Guide folders or rename them (to rename, right click on them to get the menu with the rename option);

Now open the diyvm-update.tar.gz, drag the 2 folders in to the Home directory.

All done! :good:
[Sony Cross-Device General] [NUT]:
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 :)

Q: Am I allowed to release my ROM to the public?

A: Of course! I only require a simple mention or a humble thank you in your topic, where ever that may be. I like to know where my work travels to, so post or PM me the links to it :o

Q: Am I allowed to change the updater script to suit my needs?

A: You are allowed to change whatever you wish, I have NO copyright or license stuck to my work, simply because I consider anything with a license or copyright not to be 100% pure open source.

Q: I would like to make a ROM for my device, but there is no XZDualRecovery for it?

A: Try to integrate a recovery package available for your device. You can of course also request XZDR support, but it can take some time before that happens.

Q: I want to expand the storage capacity of the VM, is there any guide for that?

A: Yes, [MENTION=3843529]gregbradley[/MENTION] posted one here.

Q: My VM disk is slowly filling up, while I am keeping the trash empty, how come?

A: [MENTION=2375541]GavTheStoner[/MENTION] found out why, read his post on the subject and the solution he found.
[Sony Cross-Device General] Fishmanzero:
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...
[Sony Cross-Device General] [NUT]:
No :p

It's not hard to find parts in my releases... :rolleyes:
[Sony Cross-Device General] BeDesireS:
Great guide! Thanks a lot for this!

Gesendet von meinem Xperia Z via Tapatalk
[Sony Cross-Device General] Johbremat:
Don't suppose anyone's come up with a way to rebuild to FTF?

Would love to be able to do that and just load with FlashTool.
[Sony Cross-Device General] [NUT]:
Me too, but unfortunately that's just impossible... Sorry :(
[Sony Cross-Device General] lancebuks:
Great Guide

Thanks for sharing - I was able to create my own deodexed and zipaligned 10.1.1.A.1.307 firmware. I tweaked it a bit so it doesn't reboot when changing system to R/W.

Next I'll try creating one for the Japanese 10.1.D.0.343 build
[Sony Cross-Device General] lancebuks:
I was able to create a working 10.1.D.0.343 build for the SO-02E variant using your guide. Is it cool with you if I upload it and share it for our Japanese friends? I'll give you credit of course. :good:
[Sony Cross-Device General] [NUT]:
Of course you can :)

If I didn't want you to release it to the public I'd have that explicitly stated in the OP ... which I haven't, so go right ahead! :good:

--- ON A DIFFERENT NOTE ---

I'll be updating the VM soon to reflect the changes in the updater script, the remount-reboot fix and the latest XZDualRecovery.

I'll also make a tar archive with a little guide in one of the reserved posts to help you update your VM so you won't have to download it all over again :)
[Sony Cross-Device General] jader13254:
Thanks!

But its possible to create a ROM out of a CWM Backup on Windows.. I.E. thats more simple ;)

Thanks for the VM though :)
[Sony Cross-Device General] [NUT]:
I know it is, but that is basically a TAR backup and requires a few extra steps: flashing the FTF to your phone, then booting to recovery to make that backup, dragging that to your PC and stripping the META info from the nandroid backup process adds to the TAR (which makes it a non-standard tar archive!) and you still risk losing all permissions and ownership information on the files inside the archive when extracting that to integrate it in your flashable zip... which is a ZIP and does not know about the extended file permissions and ownership from a Linux system... so you will have to make your updater-script reset permissions or instruct your users to do so using recovery... :eek: :silly:

Using this VM and my method of using the SIN file to extract a ROM prevents a huge heap of possible issues and keeps the updater-script nice and small and the installation a breeze :)
[Sony Cross-Device General] jader13254:
I just used a nice tool called "yaffey" which keeps the file structure and I set permissions via updater-script.

Works really fine but may be more difficult :)

Reall great way though and big thanks for this guide :P
[Sony Cross-Device General] NoSubstitute:
Weeehaaa!

Flashed my NCB.zip and it booted fine. Installed/ran/uninstalled the SDFix app to remove that silly No-you-can't-write-to-the-SDcard limitation. System seems fine now. Google Play Services is running hot, but I'll let it be for a few days and see what people think about it or if someone comes up with a better "fix" than killing such an integral part of the system. Haven't touched/enabled the Force 2D gpu setting.

Actually, I haven't even seen what KK looks like on my Z. I use Nova. :)

I only saw the new boot animation. Flashy. :) Also , of course, the new Notification & Quick Settings. They look fine to me.

Thank you for your help, [NUT]!

Should I care about the removed xzdr.prop file, or can I leave it deleted?
[Sony Cross-Device General] [NUT]:
It already has been recreated :D
[Sony Cross-Device General] LaurynasVP:
no system.sin ?

I can't find system.sin anywhere. I searched whole files and nothing.. Can u upload it?
[Sony Cross-Device General] [NUT]:
The system.sin is supposed to be inside the ftf you either created or downloaded. It's not a part of any of my files...
[Sony Cross-Device General] LaurynasVP:
ah, ok, thanks (+)
[Sony Cross-Device General] Rootk1t:
Got some questions to clarify.

I'n running DIY on Vmware Workstation (because of snapshots function). Cause constantly running out of space, expanded disk to 20GB in Vmware Workstation. In Ubuntu installed GParted, it sees 10GB partition and 10GB unallocated space instead of 20GB partition.

But the main problem is that it can't expand / partition because it can't unmount it while system running. I googled it, all references suggest using live dvd/usb stick system to boot and use gparted to expand it. I can do it in ordinary hardware PC, but how can it be applied inside VM:confused:

Or are there any other steps to increase DIY partition size?
[Sony Cross-Device General] gregbradley:
Use this guide to expand the virtual machine, I boosted mine to 50gb

http://www.rootusers.com/use-gparted-to-increase-disk-size-of-a-linux-native-partition/

when booting the virtual machine you have enter bios and change the boot order to boot from the DVD rom first, then it boots into gparted and the system is not mounted
[Sony Cross-Device General] Rootk1t:
I think points about expanding DIY VM and removal Trash-0 folder should be added to Guide for greater experience.
[Sony Cross-Device General] [NUT]:
Will certainly do that with the next update.
[Sony Cross-Device General] [NUT]:
Updated the guide a little and added some questions and answers to the FAQ
[Sony Cross-Device General] Hamidreza2010:
[MENTION=4904057][NUT][/MENTION]

Hi

bro we should install VMWare Player?

mean without VMWare Player we cant make a custom rom?

thanks
[Sony Cross-Device General] [NUT]:
If you wish to use this guide and do it with ease, then yes.
[Sony Cross-Device General] iBuzman:
Im sure Ive done everything correctly but my flashable zip always fails to be created due to not enough space.. Even deleted *.ext4 file last time (and cleared trash obviously hehe) but still no luck.. Added another disk of 50gb for storage and that works fine. Going to give up for now as I have no ext4 after deleting and arent drop and drop from windows.due to same spwve issue.. [MENTION=4904057][NUT][/MENTION] not sure how hard it is to create same vm but with 20 or 30gb home or filesystem space? (Ill delete vm start again if easy..)

Update.. Trying again lol [emoji106] [emoji13]

Update again... Got distracted.. Now in middle if Ubuntu dual boot install/setup (will recreate [MENTION=4904057][NUT][/MENTION] tools there lol)
[Sony Cross-Device General] Rootk1t:
after copying firmware .ftf to VM, don't forget to clear /tmp/VMwareDnD folder;)
[Sony Cross-Device General] iBuzman:
[MENTION=4904057][NUT][/MENTION] I presume I can still use your vmware rombuilder script in ubuntu 14.04 after copying all the required files across? Ta..
[Sony Cross-Device General] [NUT]:
Yeah, that should work fine :)
[Sony Cross-Device General] Rootk1t:
that's a pity that points about expanding DIY VM and removal Trash-0 are still not added to FAQ:confused:.
[Sony Cross-Device General] iBuzman:
^^ he's a busy man lol
[Sony Cross-Device General] [NUT]:
whoops, I forgot to add them :o

Yes, you are part of what keeps me busy lately, lol :D

-- EDIT --

Updated the FAQ. Thank you [MENTION=5292989]Rootk1t[/MENTION] for reminding me :)
[Sony Cross-Device General] Chena_22:
hey brother,thanks for your guide its easy to follow...:D

but i'm stuck at the flashtool things,when i try to open it through terminal it says no such file or directory...

can you help me? :)
[Sony Cross-Device General] dkionline:
Done, delete.
[Sony Cross-Device General] RedSkyRoad:
So this afternoon I'm going to attempt this. I just have one concern. The file list from the FTF in the screenshots after files have been removed, do not match with the file list in my FTF. What should I do?

[IMG="My File List"]https://lh6.googleusercontent.com/-k3YImoxJHqU/U-SQfPjJnVI/AAAAAAAAH5A/uGrdQpvZYoM/s800/FTF_File%2520List.png[/IMG]

I have a "boot" folder, an XML file and there is a file in the OP's screenshot which I cannot make out, right at the bottom...
[Sony Cross-Device General] [NUT]:
If the FTF you are using has been made with an older version of FlashTool, this will happen.

That, or the creator forgot to include them :)
[Sony Cross-Device General] RedSkyRoad:
So is mine correct? I used the latest Flashtool to create my FTF. I included all files except the *.ta files.
[Sony Cross-Device General] [NUT]:
Best is to include everything in the bundle, FlashTool will skip what's dangerous to flash anyway. I'd say yours is OK though...
[Sony Cross-Device General] RedSkyRoad:
Is there no other way of doing this without this VMWare. It just gives me all kinds of error of things that need to be installed. I cannot get it to boot... VM and I don't mix well...

Error 01 :

[IMG="Error 1"]https://lh4.googleusercontent.com/-sHeO45U7AoE/U-YAzvwvmjI/AAAAAAAAIJw/t9di4gk4-NM/s800/Error_01.png[/IMG]
[Sony Cross-Device General] [NUT]:
Well, what platform are you using? Did you install the correct version of player? (64 or 32bit?)

The alternative is to install Ubuntu on your pc and download the latest update package. It should work independently from my VM, you need to install the appropriate packages to run java and make sure you get a working udev configuration for android devices.
[Sony Cross-Device General] RedSkyRoad:
I'm on Windows 7 x64. I downloaded this one : VMware-player-6.0.3-1895310.exe
[Sony Cross-Device General] [NUT]:
That's really odd ... the VM was created on a Win7 x64 PC, that fact shouldn't matter at all though...

The solutions vmware gave in the KB article, did you try them yet?
[Sony Cross-Device General] Rootk1t:
i tried DIY VM on latest VMware player & workstation under WinXP x32 and 7&8 x64 and it's working good.:good:
[Sony Cross-Device General] Black_Eyes:
Can anyone give me the link to VM player ?

on their Website there are so many of them, :)
[Sony Cross-Device General] RedSkyRoad:
Are there anything about the "machine" that needs to be changed/updated to get it to work? Should any updates be run?

This is driving me insane. I just cannot get it to boot...
[Sony Cross-Device General] RedSkyRoad:
[MENTION=4904057][NUT][/MENTION],

Can you please give me the MD5 checksum? Need to verify if my download is intact
[Sony Cross-Device General] Rootk1t:
https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0
[Sony Cross-Device General] [NUT]:
You can actually perform a test on the rar file, it's 100% accurate on file integrity checks.

The MD5 is ec7dc36408d5f6247d621523e3228645
[Sony Cross-Device General] Chena_22:
Hey dude,why i cant open flashtool in the ubuntu host? Its always end up like the screenshot...-___-
[Sony Cross-Device General] Chena_22:
I always get message like this when trying to execute sudo nautilus command. Please help..:(
[Sony Cross-Device General] Rootk1t:
path to folder in Linux is cAsE sensitive, it's cd FlashTool, not flashtool.
[Sony Cross-Device General] Chena_22:
yeah i also tried with cd FlashTool but it still show no file or directory...
[Sony Cross-Device General] whoosename:
Where is your FlashTool folder? Within the DIY-Guide? So you hve to go there:

cd DIY-Guide/FlashTool or cd DIY-Guide, then cd FlashTool

When you're in the FlashTool folder, to run FlashTool type

sudo ./FlashTool you will be asked for your password, type it but don't forget that the pw will not be echoed, there are no asteriks or points or something like that shown. Type the password and hit enter.

By the way, never, in no case, under no circumstances open nautilus or a graphical text editor with the superuser command

sudo. Doing so might brake the rights.

If you need opening nautilus with superuser rights use gksudo or gksu (followed by the command).
[Sony Cross-Device General] Chena_22:
nope,the FlashTool folder is separated from DIY guide folder...
[Sony Cross-Device General] Chena_22:
now i cant open the virtual machine...it shows an internal error message..

any one can help me?
[Sony Cross-Device General] whoosename:
Please post the exact formulation and/or a screenshot of the error report.
[Sony Cross-Device General] Rootk1t:
you have smth really screwed up if VM now is not working for you. Check your settings.
[Sony Cross-Device General] juanpirulo:
[MENTION=4904057][NUT][/MENTION] I Tried your method with the new firmware .133 but i only get a semi-root (system is not writeable). I dont know if its not working or i did something wrong when updating the recovery files . Cheers.
[Sony Cross-Device General] [NUT]:
I'm assuming you did that on a Z1(compact)/ZU or Z2, then you should put disableric (you can find it in the tmp folder inside the flashable zip) in the system/xbin folder of your flashable package.

That should fix it.
[Sony Cross-Device General] juanpirulo:
I think the problem its related to the new security fix in the 133 firnware. After updating the xbin folder with the disableric i got a semiroot. Anyway the other method used by dark-lord its working good . I still Wonder if there os any other way to make a flashable zip. Cheers
[Sony Cross-Device General] Rootk1t:
can you give a link to the other method:confused:
[Sony Cross-Device General] juanpirulo:
http://xdaforums.com/showthread.php?t=2848466

Here you have. Cheers
[Sony Cross-Device General] Premananda_laishram:
Can a new version of the VM with 40GB be made. I am having a hard time expanding the VM
[Sony Cross-Device General] Rootk1t:
http://xdaforums.com/showpost.php?p=53268853&postcount=187
[Sony Cross-Device General] Premananda_laishram:
The flashable.zip I get after finishing build has a lock sign on it and cannot be open in recovery. Can anyone help?
[Sony Cross-Device General] gripfly:
open Terminal and type sudo nautilus DIY_Guide. Then type in the password. Now it should open the folder and you can edit and delite the files..

[MENTION=4904057][NUT][/MENTION] I want to change the font sytle. Do I have to replace all the fonts with this one I like to see or does it is enough to replace the Robot-Regular.ttf?

Edit: One more thing. What size does the flashable zip and the ftf should have togheter? I might had missed something because they were +-50mb togheter..
[Sony Cross-Device General] Premananda_laishram:
You have got me all wrong. I mean the final product has a lock sign on it and recovery says 'cannot open zip file' when flashing.
[Sony Cross-Device General] zippy01:
You mean a lock sign on your phone? Did you flash the ftf with flashtool? The flashable zip is the system only. If I've also got you wrong then you need to explain a bit better
[Sony Cross-Device General] juanpirulo:
What message you get when you try to flash the zip by recovery?
[Sony Cross-Device General] Premananda_laishram:
Hi everyone. Problem solved. It was caused by partial upgrading of VM. I upgraded the Flashtool folder only and not the DIY_Guide folder. Anyway. Thanks everyone.

Further information: the failure to flash was caused by adding apps with funny names (names containing white space, superscripts etc) while modifying the rom.
[Sony Cross-Device General] juanpirulo:
Hi Nut or anyone who can hep me. I am following the guide and i made some flashables zips and all is working good, but i got some problem when i tried to modified the system. I made one only modifying the bootanimation and it works but i tried to modified the system( to do this I run sudo ./rombuilder and when system is mounted i open nautilus with sudo nautilus) deleting the app, framework and app-prived folders and replacing them whith the deodexed ones that i made,i can flash the fiinal zip with no errors but i get a bootloop. I don't know if i have to modify something in the updater script or giv e some permissions to make it work. I tried another one to get the flashable.zip with superusermod just deleting the Services.jar and replacing it with the modified one the result is again bootloop. So if someone can give me some advice i will really apreciatte. Cheers
[Sony Cross-Device General] th0ngpham:
How to upgrade it? Can you share link? :o
[Sony Cross-Device General] Rootk1t:
it seems that when messing with deodex you'll get bootloop if you inject deodexed files. Actually i tried only to replace 1 file - framework-res.apk with a modified copy of it. When i flashed .zip, i got bootloop. OK. I entered recovery, flashed stock version of file (i had it backed up). After that deviced booted normally. I entered recovery again and flashed the file i integrated in .zip earlier, and everything booted ok. Also when integrating deodexed files system got's bootloops. But when applying deodex.zip in recovery with the same files, system boots normally.:confused:

delete flashtool folder and replaced it with new version downloaded from http://www.flashtool.net/. For updating recovery you can read on 1st page.
[Sony Cross-Device General] juanpirulo:
The same happend to me, i think its something related to permissions but to do this you have to mess with updater script, but i am not sure about that. Hope someone can help us and guide us through the right direction. Cheers
[Sony Cross-Device General] Rootk1t:
maybe it's connected with android signature check.
[Sony Cross-Device General] juanpirulo:
[MENTION=4904057][NUT][/MENTION] any help?
[Sony Cross-Device General] zxz0O0:
Upload your personalized rom. Did you fix the permissions after replacing the files with deodexed ones?