[LG Optimus L90] k2wl:
hi friends

As you know there is CM-11.0 development going on for our L90

And flashing back to stock is a painful process.

you loose bootloader unlock status/root/recovery.

So i am putting here a guide to make your own flashable zips which can be flashed through CWM/TWRP.

All from your stock KDZ firmware.

#include
/* * Your warranty is now void.
* * I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you. Hard. A lot. */

GUIDE has following parts

1.Preparation/pre-requisites

you need

a]Windows PC

b]pyton 2.7 installed on it

download link

https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi

c] [Tool][python] LG Compressed KDZ Extractor

download from following thread

http://xdaforums.com/showthread.php?t=2483250

d]notepad++ installed

download link

http://download.tuxfamily.org/notepadplus/6.6.8/npp.6.6.8.Installer.exe

e][TOOL] KDZ and TOT Extractor

download from following thread

http://xdaforums.com/showthread.php?t=2600575

always download latest WindowsLGFirmwareExtract-ver.1.2.1.0

f]Flashable zip template

download the attachment below.

e]Unlocked bootloader with CWM/TWRP installed

for unlocking follow

http://xdaforums.com/lg-l90/general/guide-guide-to-unlocking-bootloader-l90-t2852917

this thread

for CWM/TWRP you can download from

http://xdaforums.com/lg-l90/development/rom-cyanogenmod-11-lg-l90-t2831541

f] Zip software

i use 7zip

2. Extarcting IMGs from KDZ

So now lets get started with real stuff.

extract python tool you downloaded in C:\Python27

then copy your kdz file to C:\Python27

go to

C:\Python27

open Command prompt there by pressing shift+right click

give following command

C:\Python27>python KDZFileTools.py -l -f D41010c_00.kdz

my kdz file name is D41010c_00.kdz

it may give the error like

[!] Error: Unsupported KDZ file format.
[ ] Expected: 0x28 0x5 0x0 0x0 0x34
0x31 0x25 0x80 ,
but received 0x28
0x5 0x0 0x0 0x24 0x38 0x22 0x25

.

open KDZFileTools.py file with notepad++

you will see

"\x28\x05\x00\x00\x34\x31\x25\x80"

change it to

"\x28\x05\x00\x00\x24\x38\x22\x25"

save the file and exit.

now run the command again

C:\Python27>python KDZFileTools.py -l -f D41010c_00.kdz
[+] KDZ Partition
List
=========================================
0 : D41010d_0.dz
(1027325284 bytes)
1 : WX.dll (1303040 bytes)
2 : ♥WX.dylib
(243307520 bytes)

now it will show you the file list in kdz file

now run following

C:\Python27>python KDZFileTools.py -f D41010c_00.kdz -x

it will show the follwoing prompt

C:\Python27>python KDZFileTools.py -f D41010c_00.kdz -x
[+] Extracting
all partitions!

[+] Extracting D41010d_0.dz to kdzextracted\D41010d_0.dz
[+] Extracting
WX.dll to kdzextracted\WX.dll
[+] Extracting ♥WX.dylib to
kdzextracted\♥WX.dylib
Traceback (most recent call last):
File
"KDZFileTools.py", line 195, in <module>

kdztools.main()
File "KDZFileTools.py", line 191, in
main
self.cmdExtractAll()
File
"KDZFileTools.py", line 172, in cmdExtractAll

self.extractPartition(part[0])
File "KDZFileTools.py", line 112, in
extractPartition
outfile =
open(os.path.join(self.outdir,currentPartition['name']), 'wb')
IOError:
[Errno 22] invalid mode ('wb') or filename: 'kdzextracted\\\x03WX.dylib
'

dont worry it is fine

now we have DZ file in kdzextracted folder

now give following command

C:\Python27>python DZFileTools.py -f kdzextracted/D41010d_0.dz -x

this will give you following prompt

C:\Python27>python DZFileTools.py -f kdzextracted/D41010d_0.dz -x
[+]
Extracting all partitions!

[+] Extracting PrimaryGPT_0.bin to dzextracted\PrimaryGPT_0.bin
[+]
Extracting modem_16384.bin to dzextracted\modem_16384.bin
[+] Extracting
sbl1_147456.bin to dzextracted\sbl1_147456.bin
[+] Extracting rpm_149504.bin
to dzextracted\rpm_149504.bin
[+] Extracting tz_150528.bin to
dzextracted\tz_150528.bin
[+] Extracting sdi_151552.bin to
dzextracted\sdi_151552.bin
[+] Extracting aboot_152576.bin to
dzextracted\aboot_152576.bin
[+] Extracting rpmb_156672.bin to
dzextracted\rpmb_156672.bin
[+] Extracting tzb_157696.bin to
dzextracted\tzb_157696.bin
[+] Extracting abootb_158720.bin to dzextracted\abootb_158720.bin
[+] Extracting persist_212992.bin to
dzextracted\persist_212992.bin
[+] Extracting laf_278528.bin to
dzextracted\laf_278528.bin
[+] Extracting boot_327680.bin to
dzextracted\boot_327680.bin
[+] Extracting recovery_372736.bin to
dzextracted\recovery_372736.bin
[+] Extracting rct_459776.bin to
dzextracted\rct_459776.bin
[+] Extracting factory_507904.bin to
dzextracted\factory_507904.bin
[+] Extracting sbl1b_622592.bin to
dzextracted\sbl1b_622592.bin
[+] Extracting cust_704512.bin to
dzextracted\cust_704512.bin
[+] Extracting system_933888.bin to
dzextracted\system_933888.bin
[+] Extracting system_1197064.bin to
dzextracted\system_1197064.bin
[+] Extracting system_1201176.bin to
dzextracted\system_1201176.bin
[+] Extracting system_1462288.bin to
dzextracted\system_1462288.bin
[+] Extracting system_1725464.bin to
dzextracted\system_1725464.bin
[+] Extracting system_1986576.bin to
dzextracted\system_1986576.bin
[+] Extracting system_2249752.bin to
dzextracted\system_2249752.bin
[+] Extracting system_2510864.bin to
dzextracted\system_2510864.bin
[+] Extracting system_2774040.bin to
dzextracted\system_2774040.bin
[+] Extracting system_3035152.bin to
dzextracted\system_3035152.bin
[+] Extracting system_3298328.bin to
dzextracted\system_3298328.bin
[+] Extracting system_3559440.bin to
dzextracted\system_3559440.bin
[+] Extracting system_3821584.bin to
dzextracted\system_3821584.bin
[+] Extracting system_4079616.bin to
dzextracted\system_4079616.bin
[+] Extracting system_4341760.bin to
dzextracted\system_4341760.bin
[+] Extracting system_4603904.bin to
dzextracted\system_4603904.bin
[+] Extracting system_4866048.bin to
dzextracted\system_4866048.bin
[+] Extracting BackupGPT_15268864.bin to
dzextracted\BackupGPT_15268864.bin

C:\Python27>

now extract

KDZ and TOT Extractor to dzextracted folder and go to dzextracted folder.

Open WindowsLGFirmwareExtract.exe

click on

merge system-bin

it will start merging and output will be C:\Python27\dzextracted\merge_output

you have now got your system.img

3. Makinhg a flashable zip

now in dzextracted folder

rename boot_327680.bin to boot.img

and

rename cust_704512.bin to cust.bin

Now extract the attached zip to this post where ever you want.

you will get META-INF folder.

copy system.img,boot.img,cust.bin to that folder

now you have

META-INF, system.img,boot.img,cust.bin

make a zip containing all 4 with 7zip.

there you go..... now have your own flashable zip. :)

CREDITS

bullghost for kdz&tot extract tool

thecubed for python kdz extraction tool

Quarx for CWM/TWRP/ and CM

LG for KDZ