[HOWTO] Cook your custom rom for LG P500

Search This thread

janitux

Senior Member
Dec 27, 2010
86
60
Chile
Hi there, we are going to use excellent dsixda's HTC Android Kitchen to cook our custom ROMs for LG P500. The list of the things we are going to need:
  1. Original ROM (Check this thread)
  2. LG Utils 0.4.2 (Check this URL)
  3. DzDecryptor v1.0b(Check this thread)
  4. Cygwin (Check this URL
  5. Unyaffsmbn (Check this thread)
  6. Dsixda's HTC Android Kitchen (Check this thread)

Note: I have a "romcooking" folder on my home (C:\Users\Patricio\romcooking), inside i have all the utils needed, and the .kdz file for the stock ROM. I recommend to use tab to complete filenames since they are too long.

  1. First we need to get a dz from the kdz (original firmware), extract LG Utils 0.4.2 and open KP500-Utils-EN.exe (You need to run this as administrator, or else you are getting an empty .cab file), select the I option (Extract files from KDZ file), and type the route to your .kdz file (Mine is C:\Users\Patricio\romcooking\V10A_00.kdz). Now, you must have a V10A_00.cab (Or another name, it depends on the stock rom you downloaded), open it with a extractor like 7zip or similar and extract the file "LGP500AT-00-V10a-EUR-XX-SEP-25-2010+0.dz" or similar to our romcooking folder.
  2. Then we are going to uncompress the .dz with DZDecrypt (Press Win + R, type cmd and enter, then you cd to the folder where DzDecrypt is located (ex:
    Code:
    cd C:\Users\Patricio\romcooking\DZDecryptor_v1.0b
    then we type:
    Code:
    DZDecrypt.exe "C:\Users\Patricio\romcooking\LGP500AT-00-V10a-EUR-XX-SEP-25-2010+0.dz" C:\Users\Patricio\romcooking\stockrom
    This is going to create a "stockrom" folder in our original romcooking folder, you are going to see a lot of files in the stockrom folder, the important ones are boot.img and system.mbn (DZDecrypt should have merged your system.mbn_0, system.mbn_1 and system.mbn_2)
  3. We need to install cygwin, open the setup.exe, just keep hitting next until you are on the select packages screen, go to "Devel" menu and select to install gcc, gdb and make, in "Interpreters" check perl, in "Archive" check zip and unzip, in "Web" check wget, in "Editors" check nano and vim and in "Utils" select cpio, util-linux and ncurses. Make some tea and wait for the cygwin install to finish and we are ready to go to the next step.
  4. We are going to compile unyaffsmbn, copy the extracted files from unyaffsmbn, system.mbn and boot.img to C:\cygwin\home\Patricio, now fire up cygwin and compile unyaffsmbn with:
    Code:
    gcc -o unyaffsmbn unyaffsmbn.c
    Now uncompress system.mbn, delete symlinks of bin/ and zip everything with:
    Code:
    mkdir system
    cd system
    ../unyaffsmbn.exe ../system.mbn
    find bin -type l -exec rm {} +
    cd ..
    zip -r stockrom.zip boot.img system/
    We are ready to go to the kitchen :) (We have a stockrom.zip on C:\cygwin\home\Patricio, remember that)
  5. Now we are going to use dsixda's HTC Android Kitchen, we need to have installed JDK. After we have downloaded and uncompressed the kitchen (Mine is in C:\cygwin\home\Patricio\kitchen), we need to put the ziped file we got in the previous step into the original_update folder of the kitchen. We are ready to go! fire up cygwin and cd to the kitchen location and exec ./menu , select option 1, you should see the zip file, put the number of it, and you are ready to go (It will create a WORKING_XXXXXX_XXXXXX folder, you can modify the files in WORKING_XXXX_XXXXX/system, add APKs, modify the apns file, etc).
    This command also gives us a lot of options for our rom: enable root, add busybox, deodex our files, zipalign, etc. If you are going to edit text files, use an editor like Notepad++ or any other program that can open/edit/save files in linux compliant style. It's pretty easy to use the kitchen, just check the official thread for options or help

The common options i use are:
  1. Add root permission (option 2), press f when asked and you are done
  2. Add Busybox
  3. Change name of the rom, easy cake
  4. Advanced options, press 0
  5. Add /data/app functionality
  6. Add Apps2SD
  7. Add custom boot animation functionality
  8. Deodex files in your ROM
  9. And Finally: Zipalign all *.apk files to optimize RAM usage

That should do the trick, when you are ready to cook your rom, just type 99, wait for it to build and it should be in the OUTPUT_ZIP folder in your kitchen folder.

Took info from this thread (About decompressing .dz and .mbn, and making it to work with the kitchen), and info from ruigui and tritant in this thread. The awesome android kitchen by dsixda. Sorry if i forgot to mention any work, just post it or pm me :)
If you have anything you want to add to the guide, just post it :)
 
Last edited:

ruigui

Senior Member
Oct 11, 2010
54
23
You don't need to dual boot to linux. It can be done with cygwin.
When you follow dsixda's guide to install kitchen, do as said but don't install cygwin from that guide.
Instead, download from official site, choose default options, but add these packages (it will be compliant with kitchen and give a little extra funcionality):
Devel: gcc, gdb, make
Interpreters: perl
Utils: cpio, util-linux, ncurses
Archive: zip, unzip
Web: wget
Editors: vi, nano

Good guide, nicely done ;)


EDIT:
In my wife's machine (using windows 7 64bit. i'm without computer, for now....), i've installed cygwin as said above.
Then added two folders to my home dir:
kitchen and unyaffsmbn
In kitchen, use the kitchen ;)
In unyaffsmbn, copy the files from unyaffsmbn.zip to that dir, then compile it there

EDIT2:
If you edit text files under windows, USE NOTEPAD++, or any other program that can open/edit/save files in linux compliant style.
There are differences in Windows and Linux when ENTER is pressed, and you'll have issues when trying to flash or run your custom ROM
 
Last edited:

vinnux

Member
Nov 9, 2010
20
0
Ragusa
hi there... thanks a lot for your guide.
I'm trying to do the things you wrote step by step... I have extracted the dz file successfully, then I extracted the content using DZDecrypter... I found three files called system.mbn0, system.mbn1 and system.mbn2. The first and second are 80 Mbytes, the third just 17... Which one is the correct? When I try to use the command "unyaffsmbn system.mbn" (obviously I renamed the first and then the second) I get an error message ("impossible to execute binary file", or somenthing like that... I don't know how's in english because I'm italian).. Is that concerning to the presence of those three different files? Did somethind go wrong with the extracting process? Or maybe I didn't do somenthing important? Before doing this, I installed "build-essential" and did "gcc -o unyaffsmbn unyaffs.h" but apparently nothing happend... I got neither errors nor processes...
can you help me?
 

janitux

Senior Member
Dec 27, 2010
86
60
Chile
hi there... thanks a lot for your guide.
I'm trying to do the things you wrote step by step... I have extracted the dz file successfully, then I extracted the content using DZDecrypter... I found three files called system.mbn0, system.mbn1 and system.mbn2. The first and second are 80 Mbytes, the third just 17... Which one is the correct? When I try to use the command "unyaffsmbn system.mbn" (obviously I renamed the first and then the second) I get an error message ("impossible to execute binary file", or somenthing like that... I don't know how's in english because I'm italian).. Is that concerning to the presence of those three different files? Did somethind go wrong with the extracting process? Or maybe I didn't do somenthing important? Before doing this, I installed "build-essential" and did "gcc -o unyaffsmbn unyaffs.h" but apparently nothing happend... I got neither errors nor processes...
can you help me?
you shouldn't get three system.mbn files, did you used the 1.0b of DzDecryptor? when i used it, it said something about merging, i think that it gets the three files and then combines them to get a proper system.mbn
 
  • Like
Reactions: Krensii

vinnux

Member
Nov 9, 2010
20
0
Ragusa
I used the downloaded version from the link you posted. At least I guess... :/ Well I'm going to try again soon! Thanks a lot again for your guide! :)

Sent from my LG-P500 using XDA App
 

tritant

Senior Member
Dec 31, 2010
85
10
Other methode for exctract mbn file, not need to connect the phone.
Windows only....


(1) Download LG-Utils 0.4.2: http://www.assembla.com/spaces/ks360...tils-0.4.2.zip
(2) Run KP500-Utils-EN.exe (or whatever language you prefer out of the available choices) and select I to extract the KDZ.
(3) Open the resulting CAB file and extract the DZ file.
(4) Download DZExtract: http://www.frenchcoder.com/upload/DZExtract-V0.2.zip
(5) Use DZExtract to extract the MBN files:

DZExtract -x GW620RAT-V10c-OCT-21-2009-RGS-CA_DZ+0.dz C:\extractedTo\
 
  • Like
Reactions: k4ce and janitux
D

Deleted member 2673063

Guest
after compiling and chmod I do:

Code:
xoxo@xoxo-VirtualBox:~/work/unyaffsmbn$ unyaffsmbn system.mbn 
unyaffsmbn: command not found

both files are in that folder. Am I doing anything wrong?

Cheers.

@tritant - LG-Utils link not working
 
Last edited by a moderator:

ruigui

Senior Member
Oct 11, 2010
54
23
So.... You MUST compile unyaffsmbn first. Only then you'll have an "executable".
Code:
gcc unyaffsmbn.c -o unyaffsmbn
Then copy system.mbn to unyaffsmbn folder.
After that, do:
Code:
cd PATH_TO_UNYAFFSMBN
./unyaffsmbn system.mbn

You missed the ./

You can download lg utils from here
 
Last edited:
D

Deleted member 2673063

Guest
after compiling and chmod I do:

Code:
xoxo@xoxo-VirtualBox:~/work/unyaffsmbn$ unyaffsmbn system.mbn 
unyaffsmbn: command not found

both files are in that folder. Am I doing anything wrong?

Cheers.

@tritant - LG-Utils link not working

'course I compiled :p

of course your method worked and the one in the first post didn't...
 
D

Deleted member 2673063

Guest
please add the compiling method from ruigui (in the previous page). For some reason that's the only way I was able to compile on Ubuntu 10.

Cheers
 

ruigui

Senior Member
Oct 11, 2010
54
23
It was a typo in first post (he switched file to be used in gcc).
Give the man some time to reorganize his thread ;)
 
D

Deleted member 2673063

Guest
I did not mean to be rude by any means!

I appreciate the effort to create the how-to! Hopefully people will read the thread if they get stuck and use the right commands so that they don't abandon the idea of creating their own ROM :)
 

ruigui

Senior Member
Oct 11, 2010
54
23
I also didnt want to call you rude... Sorry...
But we were exhanging some pms and he is redoing this tutorial.
Sometimes we make mistakes while typing long posts ;)
 

mohammedalmusimie

Senior Member
Dec 21, 2010
61
20
Amman
installation aborted

thanks for this great tutorial

everything works like a charm , but when i flash my new rom i have an error says no enough space while writing boot image

any idea?

Update: okay i solved the problem, it seems that i missed up with the boot settings!
 
Last edited:

vinnux

Member
Nov 9, 2010
20
0
Ragusa
I finally made the zip file, but when I start the kitchen and select it, i find this:


"Warning: No META-INF folder found under working folder!

Warning: No META-INF/com/google/android folder found, creating it.

Did not find an update-script. Shall I create one (y/n)? (default: y): "

is that normal? and what should I do? :/
 

mohammedalmusimie

Senior Member
Dec 21, 2010
61
20
Amman
I finally made the zip file, but when I start the kitchen and select it, i find this:


"Warning: No META-INF folder found under working folder!

Warning: No META-INF/com/google/android folder found, creating it.

Did not find an update-script. Shall I create one (y/n)? (default: y): "

is that normal? and what should I do? :/
yes this is normal, i got that warning, and i entered "yes" to create one, and everything went just fine!

good luck
 

tritant

Senior Member
Dec 31, 2010
85
10
For me, work with wine on linux mandriva 2010.2

[jice@localhost rootlg]$ wine DZDecrypt.exe "LGP500AT-00-V10b-EUR-XX-OCT-01-2010+0-DZ.dz" rom
DZ-Decryptor v1.0b *ALPHA RELEASE* by BIGB0SS from COPS.

[■] Opening file "LGP500AT-00-V10b-EUR-XX-OCT-01-2010+0-DZ.dz".
[■] Allocated memory: 280 Mo.
[■] Unpacking informations:
- Unpacking "amss.mbn" (Packed:008D2935 - Unpacked:010F6000).
- Unpacking "partition.mbn" (Packed:000000E9 - Unpacked:00000390).
- Unpacking "qcsblhd_cfgdata.mbn" (Packed:00000240 - Unpacked:00002534).
- Unpacking "qcsbl.mbn" (Packed:00007D88 - Unpacked:0000DFF0).
- Unpacking "oemsblhd.mbn" (Packed:00000026 - Unpacked:00000028).
- Unpacking "oemsbl.mbn" (Packed:0002C637 - Unpacked:0005EFB4).
- Unpacking "amsshd.mbn" (Packed:00000028 - Unpacked:00000028).
- Unpacking "appsboothd.mbn" (Packed:00000022 - Unpacked:00000028).
- Unpacking "appsboot.mbn" (Packed:00008A6F - Unpacked:0000D484).
- Unpacking "boot.img" (Packed:00385B3F - Unpacked:0038A800).
- Unpacking "system.mbn_0" (Packed:0307280E - Unpacked:05000000).
- Merging "system.mbn_1" (Packed:028EAA5A - Unpacked:05000000).
- Merging "system.mbn_2" (Packed:00738F81 - Unpacked:01003F40).
- Unpacking "recovery.img" (Packed:003BE683 - Unpacked:003C3800).
- Unpacking "splash.img" (Packed:00001C3A - Unpacked:0004B000).
[■] SubFiles: 0x780C3E84. (DzCreator)
[■] Closing file "LGP500AT-00-V10b-EUR-XX-OCT-01-2010+0-DZ.dz".
 

Top Liked Posts

  • There are no posts matching your filters.
  • 45
    Hi there, we are going to use excellent dsixda's HTC Android Kitchen to cook our custom ROMs for LG P500. The list of the things we are going to need:
    1. Original ROM (Check this thread)
    2. LG Utils 0.4.2 (Check this URL)
    3. DzDecryptor v1.0b(Check this thread)
    4. Cygwin (Check this URL
    5. Unyaffsmbn (Check this thread)
    6. Dsixda's HTC Android Kitchen (Check this thread)

    Note: I have a "romcooking" folder on my home (C:\Users\Patricio\romcooking), inside i have all the utils needed, and the .kdz file for the stock ROM. I recommend to use tab to complete filenames since they are too long.

    1. First we need to get a dz from the kdz (original firmware), extract LG Utils 0.4.2 and open KP500-Utils-EN.exe (You need to run this as administrator, or else you are getting an empty .cab file), select the I option (Extract files from KDZ file), and type the route to your .kdz file (Mine is C:\Users\Patricio\romcooking\V10A_00.kdz). Now, you must have a V10A_00.cab (Or another name, it depends on the stock rom you downloaded), open it with a extractor like 7zip or similar and extract the file "LGP500AT-00-V10a-EUR-XX-SEP-25-2010+0.dz" or similar to our romcooking folder.
    2. Then we are going to uncompress the .dz with DZDecrypt (Press Win + R, type cmd and enter, then you cd to the folder where DzDecrypt is located (ex:
      Code:
      cd C:\Users\Patricio\romcooking\DZDecryptor_v1.0b
      then we type:
      Code:
      DZDecrypt.exe "C:\Users\Patricio\romcooking\LGP500AT-00-V10a-EUR-XX-SEP-25-2010+0.dz" C:\Users\Patricio\romcooking\stockrom
      This is going to create a "stockrom" folder in our original romcooking folder, you are going to see a lot of files in the stockrom folder, the important ones are boot.img and system.mbn (DZDecrypt should have merged your system.mbn_0, system.mbn_1 and system.mbn_2)
    3. We need to install cygwin, open the setup.exe, just keep hitting next until you are on the select packages screen, go to "Devel" menu and select to install gcc, gdb and make, in "Interpreters" check perl, in "Archive" check zip and unzip, in "Web" check wget, in "Editors" check nano and vim and in "Utils" select cpio, util-linux and ncurses. Make some tea and wait for the cygwin install to finish and we are ready to go to the next step.
    4. We are going to compile unyaffsmbn, copy the extracted files from unyaffsmbn, system.mbn and boot.img to C:\cygwin\home\Patricio, now fire up cygwin and compile unyaffsmbn with:
      Code:
      gcc -o unyaffsmbn unyaffsmbn.c
      Now uncompress system.mbn, delete symlinks of bin/ and zip everything with:
      Code:
      mkdir system
      cd system
      ../unyaffsmbn.exe ../system.mbn
      find bin -type l -exec rm {} +
      cd ..
      zip -r stockrom.zip boot.img system/
      We are ready to go to the kitchen :) (We have a stockrom.zip on C:\cygwin\home\Patricio, remember that)
    5. Now we are going to use dsixda's HTC Android Kitchen, we need to have installed JDK. After we have downloaded and uncompressed the kitchen (Mine is in C:\cygwin\home\Patricio\kitchen), we need to put the ziped file we got in the previous step into the original_update folder of the kitchen. We are ready to go! fire up cygwin and cd to the kitchen location and exec ./menu , select option 1, you should see the zip file, put the number of it, and you are ready to go (It will create a WORKING_XXXXXX_XXXXXX folder, you can modify the files in WORKING_XXXX_XXXXX/system, add APKs, modify the apns file, etc).
      This command also gives us a lot of options for our rom: enable root, add busybox, deodex our files, zipalign, etc. If you are going to edit text files, use an editor like Notepad++ or any other program that can open/edit/save files in linux compliant style. It's pretty easy to use the kitchen, just check the official thread for options or help

    The common options i use are:
    1. Add root permission (option 2), press f when asked and you are done
    2. Add Busybox
    3. Change name of the rom, easy cake
    4. Advanced options, press 0
    5. Add /data/app functionality
    6. Add Apps2SD
    7. Add custom boot animation functionality
    8. Deodex files in your ROM
    9. And Finally: Zipalign all *.apk files to optimize RAM usage

    That should do the trick, when you are ready to cook your rom, just type 99, wait for it to build and it should be in the OUTPUT_ZIP folder in your kitchen folder.

    Took info from this thread (About decompressing .dz and .mbn, and making it to work with the kitchen), and info from ruigui and tritant in this thread. The awesome android kitchen by dsixda. Sorry if i forgot to mention any work, just post it or pm me :)
    If you have anything you want to add to the guide, just post it :)
    15
    :(:(:( I dont know whats the problem, when I run the ./menu command I get this error...screenshot attached :( please help me


    Possible solution, from that kitchen_readme.txt file:
    6) When it shows all the package names, go to the top and select "All <-> Default" until it changes to "All <-> Install" (you must click on the arrows)

    EDIT: Another solution, if the above doesn't work still:

    In the file .bash_profile (located in the folder that Cygwin starts up in, e.g. c:/cygwin/home/john), add to the **end** of the file:

    Code:
    PATH=/bin:\${PATH}

    Or simply type this from a command prompt instead:

    Code:
    echo "PATH=/bin:\\\${PATH}" >> ~/.bash_profile

    Then, close Cygwin and restart it by clicking on the Cygwin shortcut.
    7
    You don't need to dual boot to linux. It can be done with cygwin.
    When you follow dsixda's guide to install kitchen, do as said but don't install cygwin from that guide.
    Instead, download from official site, choose default options, but add these packages (it will be compliant with kitchen and give a little extra funcionality):
    Devel: gcc, gdb, make
    Interpreters: perl
    Utils: cpio, util-linux, ncurses
    Archive: zip, unzip
    Web: wget
    Editors: vi, nano

    Good guide, nicely done ;)


    EDIT:
    In my wife's machine (using windows 7 64bit. i'm without computer, for now....), i've installed cygwin as said above.
    Then added two folders to my home dir:
    kitchen and unyaffsmbn
    In kitchen, use the kitchen ;)
    In unyaffsmbn, copy the files from unyaffsmbn.zip to that dir, then compile it there

    EDIT2:
    If you edit text files under windows, USE NOTEPAD++, or any other program that can open/edit/save files in linux compliant style.
    There are differences in Windows and Linux when ENTER is pressed, and you'll have issues when trying to flash or run your custom ROM
    3
    Yes same question?

    Sent from my GT-P1000 using xda premium

    In kitchen
    use adavanced options no 17 to add etc/init.d support for scripts ...

    then just add the scripts or any tweaks in this folder .. that's it

    and for some tweaks refer the below link it has very good tweaks and also instructions on how to create a tweak script

    http://xdaforums.com/showthread.php?t=1227269
    2
    Other methode for exctract mbn file, not need to connect the phone.
    Windows only....


    (1) Download LG-Utils 0.4.2: http://www.assembla.com/spaces/ks360...tils-0.4.2.zip
    (2) Run KP500-Utils-EN.exe (or whatever language you prefer out of the available choices) and select I to extract the KDZ.
    (3) Open the resulting CAB file and extract the DZ file.
    (4) Download DZExtract: http://www.frenchcoder.com/upload/DZExtract-V0.2.zip
    (5) Use DZExtract to extract the MBN files:

    DZExtract -x GW620RAT-V10c-OCT-21-2009-RGS-CA_DZ+0.dz C:\extractedTo\