Home > MOD and HACK > Technicalities to build custom ROM for LG GT540

Technicalities to build custom ROM for LG GT540

::First things first::

Thanks to XDA developer and Modaco forums to share their experience

Below are the steps taken by me to build a working Android kernel image and system image for the GT540 (a.k.a. LG SWIFT). This image is based on linux kernel 2.6.29 and relies on the Android 2.1 “Eclair”.

This page is here as a reminder to me for when I come to do it again. This is what worked for me so far, your approach may vary.

1. Download required tools and software

-Download GT540 ROM sources from LG here.

I have used Eclair sources, the size should be 132MB after download. next unzip sources and follow the Readme.txt to ease I copy-paste below

1. How to download Android source.

refer to Android site – http://source.android.com/source/download.html

2. Check your build environment

whether it is successful in building downloaded Android source.

3. Untar open source package of GT540 into downloaded Android source

4. Kernel Build

dount$> source ./build/envsetup.sh

donut$> choosecombo 1 1 generic 1

donut$> cd kernel

donut/kernel$> make swift_defconfig

donut/kernel$> make

-> After build, you can find the built image at kernel/arch/arm/boot/

5. Android Source Build

donut$> source ./build/envsetup.sh

donut$> choosecombo 1 1 generic 1

donut$> make

-> After built, you can find the built image at out/target/product/generic

-Download Android source code for desired version like Eclair in this case, Details on how to download source code is here

2. Build kernel and system images

-Following the first steps in Readme.txt from LG sources will give you the kernel image i;e zImage at ~/eclair/kernel/arch/arm/boot/zImage

-Second step will build system.img, ramdisk.img, userdata.img which will be at ~home/br/eclair/out/target/product/generic/

you may run system.img to test on emulator(How to is here ) before NAND flashing

3. Unpack, Repack and Flashing

– Get the Boot image from existing target


# cat /proc/mtd

dev: size erasesize name

mtd0: 00500000 00020000 “boot”

mtd1: 04000000 00020000 “cache”

mtd2: 00500000 00020000 “recovery”

mtd3: 00060000 00020000 “splash”

mtd4: 0f500000 00020000 “system”

mtd5: 002c0000 00020000 “lgdrm”

mtd6: 08b80000 00020000 “userdata”

mtd7: 00080000 00020000 “usd”

mtd8: 005a0000 00020000 “pkg”

mtd9: 1cfc0000 00020000 “”

# cat /dev/mtd/mtd0 > /sdcard/boot.img pull the boot.img from sdcard and apply below scripts

– Download scripts from here (follow the instruction in the scripts) to add new kernel image with devicee ramdisk. I have a different set of scripts that I will share later.

– Used fastboot to flash images, fastboot usage is here

-First reboot may take while, or you may see weird behavior (stuck at boot screen or reboot loop…..)

Conclusion: Kernel up and running, but system image give a problem…


P.S : Dear readers, if you are able to run custom system image please do share your experiences.

Categories: MOD and HACK
  1. April 13, 2012 at 7:40 pm

    Hi According to your instructions in this page, I followed them until that step "add new kernel image with devicee ramdisk." Then I use mkbootimg to merge ramdisk and zImage(in gt540 compile output) and created a boot.img, flash_image this image into gt540, I rebooted it and the gt540 just stucked at lg logo. Can you please tell me why? thanks

  2. ama
    April 15, 2012 at 9:02 pm

    Did you extracted ramdisk from the gt540 device. the boot-loop means that kernel is not able to find the rfs which you merged with compiled zImage.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: