Idiots Guide to Rooting and Custom ROMs, Optimus S Edition
...the tutorial for the rest of us!
First, I do not take credit for any of the information contained here. A great big shout out to Beezy, KsmithinNY, drellisdee and all the others who have spent countless hours sharing their intimate knowledge of the inner workings of our devices. Without them, none of this would be possible.
In fact, most of this post is the result of copy and pasting their respective threads, and I highly recommend you visit the original source for more detailed information (I will try to make sure to link all sources in the text).
I'm writing this because I felt like newbies have a lot to take in the first time, especially if this is their first Android handset. I'm no expert and I'll be the first to admit that I'm still learning this myself. So, if any of you seasoned Android veterans find anything to be incorrect here, please let me know!
Now, on to the good stuff!
So, you want to flash a custom ROM, but don't even know where to start? No problem. This tutorial is for YOU.
Throughout the tutorial I will try to explain in detail what each thing is and why it is necessary, but it is not important for you to understand in order to perform the process. These details will be written in red italics, and don't worry if you don't get it. You won't have to- its just FYI and good to understand.
Here is the process in a nutshell (I will go into more details in the posts that follow if you find the original threads too daunting):
1)Root your phone. (original thread here) Needed to allow access to critical system areas.
2)Back up any user data you wish to save and/or restore to new rom (App data, such as what Angry Birds level you're on, call logs, etc. are going to be cleared. If you want to keep them, there are plenty of apps to choose from. I recommend Titanium Backup, there is an excellent free edition in the Market).
3)Install custom recovery (original thread here) This is a modified system menu that allows you to "recover" a rom that never actually existed on your phone before. That is, to install a custom rom, this tool is used to trick the system into thinking its recovering to an official release. Aside from ROM flashing, it also allows you to save the entire contents of your phone, user data and all, to an image that can be restored later if you get cold feet and want to turn back. Cool, huh?
4)Put ROM on SD card and reboot the phone into custom recovery to install it.
5)If you backed any data up (user data, etc), you can start restoring it now.
That's really all there is to it. If you've already visited those threads and still not sure what you're getting into, relax!
In the next couple of posts I will explain in great detail what you need to do!
The detailed version...
NOTE: I WILL NOT BE HELD RESPONSIBLE FOR BRICKING YOUR PHONE. Proceed at your own risk.
Section 1: Root your phone.
This is needed because we will be running code that will modify the protected areas of the system. The only way to access those areas is to do it with root access.
For more information on this process, you can find the original thread by KSmithinNY here (http://forum.androidcentral.com/lg-o...optimus-s.html). There is also a video walkthrough link from iamlilysdad in that thread as well.
Also interesting to note that there is an easy one-click way to do this called Z4root, which doesn't require any shell commands or tools installed on the desktop (It used to be in the market, but appears to have been recently pulled- original XDA thread containing file can be found here). However, you'll need to use the shell and have all this installed for the next steps, so you might as well install them now and root the old fashioned way to get a feel for it.
Note: For the purposes of this tutorial, I assume you are using a Windows PC. If using a Mac, I recommend mfldmike's excellent tutorial for rooting on his mac (with screenshots), found here.
1) You'll first need to install all of the following (if you haven't already):
1.a) Java Runtime Environment Link
1.b) Google's Android Software Development Kit Link. We recommend you install this on the root of your computer so the path is C:\android, since that will be important to the commands entered later.
1.c) Drivers for the LG phone installed on your computer. Instructions from gbhil to do that can be FOUND HERE.
These are basically the tools needed to connect to your phone as a developer. In other words, if you were to develop your own Android apps, you'd use these tools to test and debug a real world example on your phone. No, you're not going to have to become a developer to flash roms! The reason we do this is because you will need to issue commands directly to the phone, using a nifty little command line tool called Android Debug Bridge (ADB). Think of it like a remote command line to the linux system driving your phone. Pretty useful stuff.
The next set of steps are from the original thread by KSmithinNY, found here.
1.d) Download the root exploit files found at the bottom of the original thread here (called OptimusRoot.zip).
Download it, unzip it, and put the 3 files inside in your android-sdk-windows\tools folder created from installing the SDK in 1.b above.
2) Once everything from step 1 is installed, plug your phone into your PC with the USB cable.
3) Make sure the phone is charge only (don't mount as USB drive) and USB debugging is enabled. (Find this in Menu > Settings > Applications > Development > check mark USB debugging)
4) Launch the SDK manager, should be something like C:/Android-sdk-windows SDK Manager
5) Open a CMD window and type each of the following lines, one by one:
(Tip: You can paste text into a cmd window in most versions of windows by right-clicking anywhere inside the window)
cd c:\wherever-your-sdk-tools-folder-is (mine for example is C:\android\tools however in the new SDK, I think for gingerbread 2.3, the correct directory would be "Platform Tools", and not just "tools". See what you have on your directory))
adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage
adb push su /data/local/tmp/
adb push busybox /data/local/tmp/
chmod 4755 /data/local/tmp/rageagainstthecage
chmod 4755 /data/local/tmp/busybox
./rageagainstthecage (let things sit a couple minutes (2), your phone will disconnect from the computer and you'll be removed from your ADB session)
adb shell This should return a "#" symbol instead of a "$" symbol. If it does you're good. If not go back and start from the beginning of step 5
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
./busybox cp su /system/bin
./busybox cp busybox /system/bin
chmod 4755 su
chmod 4755 busybox
Congratulations, you just used the ADB command line tool to load the software needed to root your phone. That's wasn't so scary now was it? In the future, if you would like to enter some ADB commands, all you have to do is plug in the phone like this again, navigate to the directory that houses the SDK, and type ADB again.
Now that the exploit is in place, all you have to do is designate who/what has root access, which brings us to the next bit:
If you are unable to get the # and finding yourself frustrated, you could always download z4root and do it the one click way. It was important that you have all this stuff installed and setup working for later.
6) Go to the android market on your phone and download "Superuser"(free). The developer will be listed as ChainsDD.
DONE! Your phone is rooted! And you used the ADB command line to do it! On to part 2, Backing up!
Section 2: Backing up user data
As I mentioned above, the custom recovery tool (explained in the next section) will allow you to do a dump of the entire contents of your phone's memory (also known as a NAND backup). This is great because you'll be able to revert back if you decide to go back to a stock ROM. The problem, however, is that you can't recover user data into a new ROM with that backup. That backup can only restore the entire contents of your old NAND, including the original ROM. So, if you want to take anything with you, call logs, text messages, user data in apps, you need a specific program to do that. I personally used the free edition of Titanium Backup, which will allow you to do a full backup of your apps and data, and restore them one by one afterwards. There are also specific apps you can use to backup/restore your call logs or SMS, but I found that Titanium can handle most of the data I was interested in.
This entire section is optional, as you can choose to start with a fresh slate and that is your own prerogative.
On to Section 3, Custom Backup!
Section 3: Custom Recovery
The original thread for this can be found here.
1) You need two files, flash_image.zip and recovery-RA-GNM-thunderc-s-1.1.0.img.zip, both of which can be found towards the bottom of the original thread. Copy them to the root of your SD card.
2)Plug in the phone like we did in Section 1, and open up the ADB shell (like we did before- enter the cmd, navigate to where your SDK is installed, and type adb shell).
Check your display to see if Superuser is asking you to grant permission to have root access to the commands coming in. Make sure you click to allow it if it asks. You should be greeted with a # prompt (If not, the prompt is not being granted root access and something is wrong).
3)Enter the following commands:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock5 /system
cat /sdcard/flash_image > /system/bin/flash_image
chmod 755 /system/bin/flash_image
mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak
mount -o remount,ro -t yaffs2 /dev/block/mtdblock5 /system
flash_image recovery /sdcard/recovery-RA-GNM-thunderc-s-1.1.0.img
That's it! You've replaced LG's default recovery menu with a custom one. This custom one will allow you to backup/restore nand and flash custom roms made by the users. Great. Now what? Well, lets a pick a ROM and load it up in the next section!
Section 4: Copying ROM file and using Custom Recovery
The most popular rom for our device so far is the ThundeROM, which can be found here.
4)Pick a ROM you would like to flash, for example ThundeROM, and copy the entire zip file to your storage card root (do NOT unzip it!).
5) Reboot phone into recovery by powering off, then press and hold vol_down + home + power and release keys at LG splash.
You should be greeted by something that looks like this:
6)Navigate the options on the custom recovery using the vol up and down keys, and menu button to select. It is recommended that you first select Backup/Restore and do a full Nandroid backup, so that if all else fails you can restore your phone to this point later.
7) Scroll down to WIPE and wipe each of the following clean:
7)After that, scroll down to Flash zip from SD card, and select the correct file using the menu key for enter again.
Congratulations. You have successfully flashed a ROM.
You can now open up the market and download Titanium Backup again (or whatever you used for your user data backup), then use that to restore your other apps and user data.
If you have any questions about the process or get stuck, I'll help with whatever I can, but please keep in mind that the original threads are a much better source of information than I am. The purpose of this thread is simply to have everything you need in one place, so a newbie can read it linearly. I would recommend that appropriate questions go in their respective threads. Still, if I wasn't clear about any of the steps, let me know and I'll do what I can to make it more understandable.
Enjoy your phone!
- 12-14-2010, 03:20 AM #4
- 12-14-2010, 04:46 AM #5
- 12-14-2010, 06:42 AM #6
- 12-14-2010, 09:59 AM #7
- 12-14-2010, 10:25 AM #8
- 12-14-2010, 10:46 AM #10
- 12-14-2010, 10:49 AM #11[CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
If all else fails, you can try the one-click Z4root app in the market, and then continue with section 2 of my guide. The point of doing the root the long way was just to make sure you have the drivers and SDK working so that you can ADB shell, and to familiarize yourself with the process. You don't have to actually complete it this way if you got that far, IMO.
- 12-14-2010, 10:52 AM #13
They do enough for us already, though. I think asking them to sit all day in a chat room might be much.
- 12-14-2010, 10:58 AM #15
- 12-14-2010, 11:03 AM #17
- 101 Posts
- Hyperdragon, ThundeROM
An mIRC/Chat client would be way more complex to deal with than something that is threaded and topic centralized like forums are.
In a scenario like that you would have multiple dozens of people in one place all going on with diffrent conversations and someone asking for help about something would just get lost in the wall of text that would constantly be passing by, and make it more so confusing for the person seeking assistance.
- 12-14-2010, 11:05 AM #18
- 12-14-2010, 11:10 AM #20
- 12-14-2010, 11:11 AM #21
I had tried probably thirty times, before figuring out I needed to fire the command at that time. Hope it helps...
- 12-14-2010, 12:14 PM #23
- 12-14-2010, 06:45 PM #24
- 12-14-2010, 06:55 PM #25
Guys we have to nip this in the bud real quick....
It's not a vote kind of thing. If something is sticky worthy, I'll stick it. In the interim i need to go back and remove comments like "sticky" as they don't contribute to the topic at hand. People don't want to read that comment when theyre looking for answers to rooting and roming.
I know you cant see my PM box but if i sticky everything that someone says "sticky" or PM's me about then you'd have 2 pages of stickies before you even get to the forum.
When information is important it should be stuck so it doesnt dominate the forum but let me be the judge, ok? If something should be a sticky, PM me, don't clutter the OP's page.
Thanks in advance. I'm sure the OP's appreciate the cooperation as well so their thread can stay on topic.[CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +