[LG Optimus 2x] HolySid:
Replace boot logo

Replace LG P990 boot logo

I have searched a lot to find a solution on how to change the LG boot logo and the (twin) LG splash logo on the LG P990.

Unfortunately, the ICS kernel does not seem to have a initlogo.rle (or similar) which you can easily replace.

But I did not give up. I now will show you how I successfully replaced the boot logo by flashing a modified bootloader.

Please note that:

I am not a developer, and my method is HIGHLY experimental. I am NOT responsible if you brick your device by using this method;

The (twin) LG splash logo is not in the new bootloader by wkpark, so I did not bother about this logo;

I used Debian to modify all files and to flash the modified (ICS) bootloader using the files from the Toolkits by Homero2 (and spyrosk);

If the outcome of your code does not match the one you see here, you either stop or proceed with caution;

If you are still running the old bootloader (white LG boot logo), you will need to update to the new bootloader (pink LG boot logo) first!

Method overview

i. Preparations

1. Analyse bootloader image - analyse the original bootloader image (you may skip this step)

2. Create boot logo - create and convert your custom boot logo

3. Replace boot logo in bootloader image - write your custom boot logo to the bootloader

4. Flash your new bootloader - push the modified bootloader to your phone

Required files * marked files are in the attached archive

bootloaderUnLock.bin* [1] (unlocked bootloader by wkpark)

nvflash [1]

start.bct [1]

fastbootICS.bin [1]

from565.c* [2]

to565.c* [2]

extract-rle.pl* (modified, original by wkpark [3])

i. PREPARATIONS

Before you can start, you need to compile the two .c-files [2].

$ gcc -o from565 from565.c

$ gcc -o to565 to565.c

1. ANALYSE BOOTLOADER IMAGE

To see exactly what I have done, you can start by analysing the current bootloader image.

You may skip this section, as it is not required to proceed.

Firstly, run my modified rle extractor (original by wkpark [3]) to extract the run-length encoded (rle) bitmaps that are contained in the bootloader.

It simply searches for bitmaps with a 480x800 pixel resolution and extracts the bytes containing rle bitmaps.

$ perl extract-rle.pl bootloaderUnLock.bin

Extract image #1 (skip 656216 bytes, read 19904 bytes)

19904+0 records in

19904+0 records out

19904 bytes (20 kB) copied, 0.076957 s, 259 kB/s

Extract image #2 (skip 676128 bytes, read 57136 bytes)

57136+0 records in

57136+0 records out

57136 bytes (57 kB) copied, 0.218607 s, 261 kB/s

As you can see, the bootloader contains two bitmaps.

Convert these rle bitmaps to raw bitmaps (using from565 [2]).

Note that they are exactly 480x800 (=384000) pixels.

And hereafter, convert them to png's, so you can view them.

You should see the pink LG boot logo. If not, update to the new bootloader before you proceed!!

The second image is the one that is shown during nvflashing.

$ ./from565 -rle < bootloaderUnLock.bin-1.rle > bootloaderUnLock.bin-1.raw

384000 pixels

$ ./from565 -rle < bootloaderUnLock.bin-2.rle > bootloaderUnLock.bin-2.raw

384000 pixels

$ convert -depth 8 -size 480x800 bgr:bootloaderUnLock.bin-1.raw bootloaderUnLock.bin-1.png

$ convert -depth 8 -size 480x800 bgr:bootloaderUnLock.bin-2.raw bootloaderUnLock.bin-2.png

$ rm *.raw

The goal of this method is to overwrite the first bitmap with your own.

2. CREATE BOOT LOGO

First, create an image 'bootlogo.png' of size 480x800 in your favorite image editor (e.g. GIMP, Photoshop).

Note that the image cannot contain too many details as the final rle bitmap size must be smaller than its original size.

After creating a nice boot logo, save it as bootlogo.png and run the next code. Verify that the number of pixels is correct.

$ convert -depth 8 bootlogo.png bgr:bootlogo.raw

$ ./to565 -rle < bootlogo.raw > bootlogo.rle

384000 pixels

$ rm *.raw

Now assure the filesize of bootlogo.rle is smaller than the filesize of bootloaderUnLock.bin-1.rle!!

If this is not the case, do NOT proceed!!!

You should not be worried if the bitmap is smaller, the extra bytes will simply be ignored.

$ ls -l *.rle

-rw-r--r-- 1 user user 19904 Jul 6 21:02 bootloaderUnLock.bin-1.rle

-rw-r--r-- 1 user user 57136 Jul 6 21:02 bootloaderUnLock.bin-2.rle

-rw-r--r-- 1 user user 17731 Jul 6 21:17 bootlogo.rle

3. REPLACE BOOT LOGO IN BOOTLOADER IMAGE

Now replace the current boot logo in the bootloader with your newly created one.

$ cp bootloaderUnLock.bin bootloaderUnLockCustomBootlogo.bin

$ dd if=bootlogo.rle of=bootloaderUnLockCustomBootlogo.bin seek=656216 bs=1 conv=notrunc

17731+0 records in

17731+0 records out

17731 bytes (18 kB) copied, 0.0527056 s, 336 kB/s

4. FLASH YOUR NEW BOOTLOADER

Before you flash, you may wish to run the ANALYSE BOOTLOADER IMAGE phase (again) to confirm the new boot logo has been copied successfully.

Now flashing the bootloader can be done by the following steps or any method you prefer (many better guides are available on xda).

Now shutdown your phone and remove the battery. Now simultaniously hold down the volume up and volume down buttons and connect the USB cable.

The screen shall remain off, so do not worry about that.

Note: If you are running on 64-bit Debian, run this first: sudo apt-get install lib32stdc++6

Now you can flash the bootloader by running [1]

$ sudo ./nvflash --bct start.bct --bl fastbootICS.bin --download 4 bootloaderUnLockCustomBootlogo.bin

$ sudo ./nvflash -r --go > nul

Wait for the screen to turn off and unplug the USB cable.

Now put the battery back in and restart to set eyes on your new boot logo!

P.S. can anyone confirm the bootloader can be flashed by sudo ./nvflash -r --download 4 bootloaderUnLockCustomBootlogo.bin?

References

[1] http://xdaforums.com/showthread.php?t=2081662

[2] https://github.com/udaykanthr/from565

[3] http://xdaforums.com/showthread.php?t=1954903