Hi devs,
Strictly speaking, this is not a development issue, but I thought it warranted some special attention as it sheds a little bit of new light on the "bricking" caused by Clockwork (version unknown).
A new XDA member, SoSickWiTiT, brought back an Eris from the grave. The phone he started with could only be put into RUU mode - initially it would not even start correctly in Hboot or Fastboot mode (weird, right?), and is now fully functional. The long and tortuous thread is here in the Q&A forum.
The essential finding was that the "bricking" was apparently caused by enormous numbers of pages in the flash memory device being marked as bad pages, and that this was correctable by using the "flash_erase" tool of the mtd-util project. (This tool allows you to reclaim flash pages marked as bad if they erase successfully.) I built some of the tools for ARM/Android and posted them up here.. As long as you can get Amon_RA to come up, you can run this tool from Amon_RA (using adb) and erase/reclaim partitions on a partition-by-partition basis.
Also SoSickWiTiT found a useful hack that I hadn't seen before: because he could only get his phone to start in RUU mode, he started the "Official RUU", ran it to the point where it unpacks all files, and then replaced the "rom.zip" file (in the Temp folder the RUU utility unpacks) with the HTC Root-ROM (renaming it to "rom.zip", of course). Because it signed by HTC, it got the 1.49.2000 S-OFF bootloader installed (but the rest of the install failed). SoSickWiTiT was then able to flash Amon_RA via fastboot and continue gaining traction from there. Note that just flashing a ROM from this point would not work - his mtd3 (system) partition appeared as if over 60% of the pages were marked as bad, and I think his boot partition was similarly affected. "flash_erase" was able to reclaim these pages using the "-N" command line option.
Anyway, the behavior of his phone (excluding the RUU-only behavior) was consistent with prior bricking reports of how filesystems appear to be "corrupted", and this causes difficulties flashing new ROMs (largely due to lack of free space). SoSickWiTiT reports that the phone he obtained from a friend had been bricked by "a failed ROM flash in Clockwork/ROM Manager followed up with an attempt to use the RUU" - there have been at least one other report of this exact same scenario causing the "bricking".
So now I am wondering - are there a few "bricks" laying around that might be rescued?
bftb0
Very interesting and good to know, thanks! And thank you for the tool, great work.
Think this could be applied to deleting the NRAM flash on a router? =p
WAIT wait wait!!!
He changed the bootloader from S-On to S-off??? Was it on 1.49? If so couldnt that have been used to root our phones, A LONGGG time ago? lol
Nikolai2.1 said:
WAIT wait wait!!!
He changed the bootloader from S-On to S-off??? Was it on 1.49? If so couldnt that have been used to root our phones, A LONGGG time ago? lol
Click to expand...
Click to collapse
A looooooong time ago - December '09 (circa "MR1") iirc, someone attempted to stuff a different - and unsigned - "rom.zip" file into the running (MR1) RUU.
Naturally, that didn't work, 'cuz it wasn't a HTC-signed PB00IMG.zip file. To my knowledge, this is the first time anybody tried doing things this way (swapping in the validly-signed HTC Root-ROM into the RUU's "rom.zip" location)... maybe it would have worked for the "leakers". I suppose that someone could roll back their phone and give it a shot to see it if works, but that seems sort of academic at this point - hence your "LOL".
There is evidence that both the RUU- and Hboot- based update processes actually end up checking the contents of the "misc" partition for version information TWICE - first before any flashing occurs, and second, only after the bootloader has been flashed and reloaded, but before the remainder of the PB00IMG.zip/rom.zip file has been flashed. I don't think that even at this point in time this behavior is well understood: it is possible that the hboot flash of the bootloader can occur, but then the subsequent flashing of the rest of the PB00IMG.zip file fails due to a "Main Version is Older" error. Sort of hard to understand why that would ever occur (it happened to me once, so I know it occurs).
For anybody that has a brick, but can get RUU mode running, it is certainly worth a try to see if they can replace the bootloader with the S-OFF bootloader - what do they have to lose? In this particular case, it is hard to know what the state of the misc partition was; after all, it was a phone that was previously rooted. The result obtained using the RUU utility likely depends on what was going on in the misc partition on that phone, so it is not obvious that this (RUU utility) "trick" is universal. It might have been that the same phone would have been happy to accept the Root PB00IMG.zip file - but SickWiTiT couldn't get the phone into Hboot mode initially, so that wasn't tried.
cheers
bftb0
So if I have been using Clockwork to flash a few roms do you think I would have any bad pages in my flash memory? Is there an easy way to check this?
xtreme3737 said:
So if I have been using Clockwork to flash a few roms do you think I would have any bad pages in my flash memory? Is there an easy way to check this?
Click to expand...
Click to collapse
I don't think that using Clockwork causes slow growth in bad pages; afaik, when the problem occurs - whatever causes it - only then do you see a catastrophic number of pages marked this way. I mentioned it only in case someone bricks their phone and then asks for advice here - they can check to see if this repair works for them at that time - after they have determined that this is the nature of their problem. In the meantime, there is not much need to worry about it.
Short of actually performing a flash_erase with the "-N" option turned on, I don't know off the top of my head a way to determine the number of bad blocks easily, and there are good reasons why you should not be doing that unless you absolutely have to.
The tool "nanddump" that I compiled actually reports the number of bad blocks - but it also wedges the Amon_RA kernel when you run it. Rats.
bftb0
I just wanted to add my thanks for this very informative and interesting information and tool in case it becomes necessary. I do use Clockwork (loaded from Amon RA), BTW.
Thanks for the useful info as always.
It really seems like a bad idea to use clockwork
Sent from my nonsensikal froyo
SikYou said:
Thanks for the useful info as always.
It really seems like a bad idea to use clockwork
Sent from my nonsensikal froyo
Click to expand...
Click to collapse
bftb0 said:
I don't think that using Clockwork causes slow growth in bad pages; afaik, when the problem occurs - whatever causes it...
Click to expand...
Click to collapse
I haven't once had an issue with Clockwork Mod through ROM Manager, and have been using it for 3+ months now.
thanks for this thread i sort of helped one person put their phone into the grave by telling them to flash an ruu (still feel bad about it)
jamezelle said:
thanks for this thread i sort of helped one person put their phone into the grave by telling them to flash an ruu (still feel bad about it)
Click to expand...
Click to collapse
That cus you are a baddie jamezelle xD
Very informative read, thanks bftb0!
I spent some time tonight fooling around with RomManager (v3.0.0.7) and ClockworkMod (v2.5.0.1 for the Eris). Sort of an eye-opener, actually.
The way it works is that it is actually NEVER "FLASHES" ANYTHING TO THE RECOVERY PARTITION. Instead, when you first tap on the menu item to "flash the recovery", what ROM Manager does is identify your handset type, and then downloads some files to
/sdcard/clockworkmod, e.g.:
/sdcard/clockworkmod:
----rwxr-x 1 system sdcard_r 829658 Jan 17 02:23 recovery-update.zip
/sdcard/clockworkmod/download/koush.tandtgaming.com/recoveries:
----rwxr-x 1 system sdcard_r 829658 Jan 17 00:56 recovery-clockwork-2.5.0.1-desirec.zip
/sdcard/clockworkmod/download/rommanager.appspot.com:
d---rwxr-x 2 system sdcard_r 4096 Jan 17 02:23 manifests
/sdcard/clockworkmod/download/rommanager.appspot.com/manifests:
----rwxr-x 1 system sdcard_r 11492 Jan 17 02:23 devices.js
Note that "recovery-update.zip" and "recovery-clockwork-2.5.0.1-desirec.zip" are the same size - less than 1 MB. In fact, they are identical. It is a signed update package - but too small to even contain an Android kernel.
Here's how ROM Manager works: when you press the button "Reboot into Recovery", what actually takes place is this:
- Rom Manager copies "recovery-update.zip" into /cache/update.zip, and then places the following command into /cache/recovery/command
Code:
"/sbin/recovery" "--update_package=CACHE:update.zip"
and then executes a "reboot recovery" command.
The next thing that happens is that whatever Custom Recovery that IS ALREADY FLASHED to your recovery partition on the phone boots up, and immediately begins to process the /cache/update.zip file
Here's the $64,000 observation:
This update.zip modifies NOTHING IN FLASH MEMORY - IT ONLY MODIFIES THE RAMDISK OF THE BOOTED RECOVERY ALREADY PRESENT.
Towards the end of the updater-script, it kills off the old /sbin/recovery and /sbin/adbd processes; but since these processes are defined as services, they get restarted automatically, using the new "ClockworkMod" version of these program files. Voila! The ClockworkMod recovery menus pop up.
There are two important observations that arise from this analysis:
- It does not have it's own kernel - it uses the kernel of whatever was already present in the recovery partition boot
- To get ClockworkMod to be cold-bootable, you need to COMBINE IT WITH A KERNEL AND BOOTSCRIPTS FROM SOMEPLACE ELSE - but WHERE exactly?
Now, I don't know if ROM Manager formerly worked in a different fashion - but the point is fairly obvious: if you wanted to provide a rooting method which installs "ClockworkMod" as a recovery - well then, you would need to combine the minimal components of "ClockworkMod" (mostly just the /sbin/recovery program !) with someone else's bootable recovery. And you could not use an HTC stock recovery - because then koush's "update.zip" files would have needed to be signed by HTC in order to get processed.
If you accept the hypothesis that the so-called "Clockwork" brickings have been due to a bug in the kernel MTD driver - and nobody ever seems to see those bugs happening with Amon_RA v1.6.2 - then the real problem comes from a kernel which is was kanged into a flashable "Clockwork Mod" recovery by a third party - not koush.
Who is it then - the unrevoked team? Someone else? What kernel is it?
As I recall, nearly every one of the brickings that have been reported here have been folks that got their rooting instructions from outside the XDA Eris community.
Bottom line - it's starting to look like the problem is not really due to Clockwork - its a problem kernel from unknown origins.
Perhaps Rom Manager did not always work this way on the Eris - but the way it works now is that if you install it after already having Amon_RA in the recovery partition, if you cold-boot (Vol-up+End or via HBOOT), what will come up is Amon_RA, not Clockwork.
So - if you can cold-start your phone into recovery, and up pops a ClockworkMod menu instead of a Amon_RA menu - how did you root your phone originally?
bftb0
(sorry if this post is a bit of a ramble - it's pretty late/early)
When I 'cold boot' I get the Clockwork V2.5.0.1 screen.
I rooted originally the day root was discovered here at XDA. I originally loaded Amon. Somewhere in the last year, I may have clicked the 'install Clockwork mod' at the top of ROM Manager, but I don't think I did.
I don't know if this helps, but I found your post interesting.
meanm50 said:
When I 'cold boot' I get the Clockwork V2.5.0.1 screen.
I rooted originally the day root was discovered here at XDA. I originally loaded Amon. Somewhere in the last year, I may have clicked the 'install Clockwork mod' at the top of ROM Manager, but I don't think I did.
I don't know if this helps, but I found your post interesting.
Click to expand...
Click to collapse
Huh.
If you do that, and then fire up an adb session, what kernel string does
Code:
adb shell uname -a
report?
When I click "Flash ClockworkMod Recovery", all it does is ask me to verify the phone model ("Droid Eris (CDMA)"), requests root (SuperUser), goes to the Internet and downloads stuff, and then pops up a message on the screen saying "Successfully downloaded Clockworkmod Recovery!" If I shut down the phone normally and then cold-boot the recovery afterward, what is there is Amon_RA - not clockwork.
Hmmm. Just used it to perform a ROM backup**. For this operation, the same thing happens - Amon_RA comes up first, followed by chaining to ClockworkMod and then the backup starts happening. I note that it also backs up the recovery partition - maybe it only modifies the recovery partition when it is installing a new ROM?
Hmmm (part 2). Just wiped and flashed a clean ROM using Clockwork. Cold start into recovery afterward gives me Amon_RA, not Clockwork.
Maybe koush has changed the basic methodology somehow. I have to say, the way I currently am experiencing it makes a great deal of sense - it means that koush does not need to be in the kernel-making/kernel-collecting business in order to support ROM Manager on a new handset.
Can anyone with a more long-term exposure to Rom Manager/ClockworkMod (on the Eris) shed some light on this?
bftb0
** Interesting side note: CWM backup now backs up (and I presume restores) /sdcard/.android_secure; also, a "wipe" operation will attempt to wipe any SD card ext partition if it is found.
I will adb when I get home...my work comp doesn't have the required programs installed...
bftb0 said:
** Interesting side note: CWM backup now backs up (and I presume restores) /sdcard/.android_secure; also, a "wipe" operation will attempt to wipe any SD card ext partition if it is found.
Click to expand...
Click to collapse
Also the /cache partition.
bftb0 said:
Huh.
If you do that, and then fire up an adb session, what kernel string does
Code:
adb shell uname -a
report?
Click to expand...
Click to collapse
Linux localhost 2.6.29-DecaFuctCFS-dirty-c6271491
meanm50 said:
Linux localhost 2.6.29-DecaFuctCFS-dirty-c6271491
Click to expand...
Click to collapse
Sorry - I meant adb with your recovery booted, not the normal OS. (The above must be from your regular OS right?)
Related
Hi Folks.
Just been issued heros at work and wish to update the radio rom...How is this accomplished??
regards
Lohtse
Firstly it needs to have a recovery image installed I recommend Amon-Ra v 1.6.2.
Secondly you need to find the radio rom you wish to flash and put it onto the root of you phones sd card.
Thirdly enter the recovery image you have installed by holding power and home button from the phone being off.
Then select the radio.zip to flash.
Everything I have said here can easily be found how to do via searching this forum or its wiki.
also www.theunlockr.com will help with installing the recovery image.
lohtse said:
Hi Folks.
Just been issued heros at work and wish to update the radio rom...How is this accomplished??
regards
Lohtse
Click to expand...
Click to collapse
First you will need to install the custom recovery console if you haven't done so already.
Then download your updated radio, put it on your SD, load into the recovery, then apply update. DONE!
If that is too brief,... let me know,...
EDIT... Ooops,... too late.
way to complicated...
Too much to do and can screw up..... At least with winmo and symbian was a few clicks...
hmmmmm think will ditch android.....
really? its not complicated at all when you know what your doing. In fact I can say its a damn sight easier (and safer) than modifying blackberry roms and from what I hear also Windows Mobile.
Lennyuk said:
really? its not complicated at all when you know what your doing. In fact I can say its a damn sight easier (and safer) than modifying blackberry roms and from what I hear also Windows Mobile.
Click to expand...
Click to collapse
I came from wimo to android, and as it is said, it's quite hard to catch the thing at the beginning, but after everything seems easier than in wimo !! and more reliable... you have almost no chance to brick your hero after you installed the recovery boot.
radio : boot in recovery then select the good option.
rom : nandroid backup / install whatever rom you want / if you don't like it go for nandroid restore ( all you need is two Sd card.. the good one and the one for the "tests" ).... etc....
But at the beginning i was totally out but with a little time.. reading some posts (here and on the web) ... one day everything was more clear !
Ciao
Fred
lohtse said:
way to complicated...
Too much to do and can screw up..... At least with winmo and symbian was a few clicks...
hmmmmm think will ditch android.....
Click to expand...
Click to collapse
Its not hard at all. You can have the recovery installed and the radio updated in 5 minutes.
For step by step instructions follow the "Installing a recovery image" section in BTDAG's guide linked in my signature.
Then further down the same post, in the second yellow box there are instructions on "Updating your Radio".
Guys, the OP said he was issued the Hero at work, then two hours later said he was going to ditch Android... so what then, he's quitting his job? Troll alert. Don't feed the troll.
As to troll comment(yes offence has been caused)....hmmmmm.... Am going back to the trusty Kaiser... WE DON'T HAVE TO USE THE HERO.... We live in free(ish) world.. And the Phones are issued as an update to our old duty phones... Also I'm not the only one who uses them that feels the same.
Now to updating being easy. Gulp I must be eeer dum!!! Du hu Du HU must be the TROLL in me!
I have tried to install recovery image thing and well just cant get it to work... And now I find I have to root the hero too so things will install to sd card!!!! WTF this should all be standard like winmo and symbian etc...
I have been using smart phones since the Ericsson r380 and so far Android has failed to impress to the degree I am beginning to hate it....
Am far to used to having simply andfull access to everything..
Android is a HUGE learning curve that I suspect I may not have the patience for..
regards The TROLL sorry I mean Lohtse
Now I have finally managed to get recovery image on and updated the radio...Being called a troll did it !!!!!!.....LOL
My final questions are this how do I root so I can install to sd card(just point me in the right direction) And do I have to unlock Phone to any network to have custom roms on..
regards
TROLL
lohtse said:
Now I have finally managed to get recovery image on and updated the radio...Being called a troll did it !!!!!!.....LOL
My final questions are this how do I root so I can install to sd card(just point me in the right direction) And do I have to unlock Phone to any network to have custom roms on..
regards
TROLL
Click to expand...
Click to collapse
Wahey!!!! Good job man.
Ok,... So now you have the recovery image all you need to do is pick a custom ROM. Personally, I highly recommend MCR3.2 (link in signature at botom). It is an Android 1.5 ROM but is stable and fast, what more could you want for a work phone.This ROM is rooted and has apps2SD enabled. Once you have installed the ROM you will need to remember to create an ext2 partition on the SD card (easily done through the recovery). Then you are set to go!!!!
lohtse said:
Now I have finally managed to get recovery image on and updated the radio...Being called a troll did it !!!!!!.....LOL TROLL
Click to expand...
Click to collapse
You're welcome And what ddotpatel said. MCR is fast & clean. By installing a custom recovery you've already done the only tricky bit.
Yep installed 3.2 from modocca. seems nice but how do you know if the apps are installing to sdcard???? I'm not sure they are lol..
lohtse said:
Yep installed 3.2 from modocca. seems nice but how do you know if the apps are installing to sdcard???? I'm not sure they are lol..
Click to expand...
Click to collapse
You need to create an ext2 partition on your SD card through the recovery again. I cant remember the exact wording but something like "create ext2 + fat" or something along those lines.
As far as I know, once that has been done all apps will install to SD.
Someone with more knowhow than me correct me if I am wrong?... CAULI?,... LENNY?
Can someone who knows please answer this question:
Are you 100% sure that flashing the Radio ROM does not affect the phone RF Calibration ?
Thanks!
ddotpatel said:
You need to create an ext2 partition on your SD card through the recovery again. I cant remember the exact wording but something like "create ext2 + fat" or something along those lines.
As far as I know, once that has been done all apps will install to SD.
Click to expand...
Click to collapse
Yup, certainly as far as MCR is concerned. On the first reboot it will move all files from /data/app to /system/sd/app (& similarly for app-private) Nb /sysytem/sd is the mount point for the ext2 partition. All it does is move the files over & then replaces the /data/app (& app-private) directory with a symlink to the new location. That way future installs, updates etc all automatically go to the new location.
You can always check yourself with a terminal emulator & the command ls -l, or using a file manager like Root Explorer, if you're curious. Some people think it's not working because they see available space in internal flash drop as apps are installed, but that's because app data & the dalvik cache remain on internal flash, principally aiui for reasons of access speed. The saving you make just from shifting the apks to sd is more than enough for most people it seems.
cauli said:
Yup, certainly as far as MCR is concerned. On the first reboot it will move all files from /data/app to /system/sd/app (& similarly for app-private) Nb /sysytem/sd is the mount point for the ext2 partition.
All it does is move the files over & then replaces the /data/app (& app-private) directory with a symlink to the new location. That way future installs, updates etc all automatically go to the new location.
You can always check yourself with a terminal emulator & the command ls -l, or using a file manager like Root Explorer.
Some people think it's not working because they see available space in internal flash drop as apps are installed, but that's because app data & the dalvik cache remain on internal flash, principally aiui for reasons of access speed.
Click to expand...
Click to collapse
hmmmm I certainly noticed a drop in available memory on the phone to the degree of only having 54 megs free...
SebHTCHero said:
Are you 100% sure that flashing the Radio ROM does not affect the phone RF Calibration ?
Click to expand...
Click to collapse
what is rf calibration?
What is radio rom used for by phone?
kendong2 said:
what is rf calibration?
Click to expand...
Click to collapse
A set of tables usually stored in NVRAM that takes into account the slight differences in the components used to build your phone. Every single phone is calibrated during manufacturing.
If the calibration is erased, it will look like it works but you can have all sort of problems from poor battery life to random drop from the network or poor sensibility (not to mention the higher than expected radio levels you could be emitting right next to your brain )
Basically, make sure you've got a microSD card with about 650mb (or more if you have a lot of apps installed, check via Settings -> SD Card menu) free on it for the ext4 conversion before you even start.
Download the ext4 version of the kernel from;
http://android.modaco.com/content/samsung-galaxy-tab-tab-modaco-com/330378/26-jan-r3-modaco-custom-kernel-for-the-samsung-galaxy-tab/
(You _might_ need an account on the site first, not sure)
Install the Samsung Kies software so you've got the USB drivers installed (or install just the drivers from:
http://downloadcenter.samsung.com/content/SW/201010/20101026044755031/SAMSUNG_USB_Driver_for_Mobile_Phones_v1.3.350.0.exe
Turn your tab off, turn it back on holding the DOWN volume button until you get the big yellow triangle.
Plug it into your PC and run Odin. Make sure that one of the leftmost boxes lights up yellow and says "COM" in it (along with a number). If not, then it hasn't picked up the tab, try rebooting the PC and/or trying another USB port.
Click the big "PDA" button and select the "p1000-mck-r3-ext4-cwm.tar" file that you downloaded (do NOT extract the archive!)
Then press the "Start" button and cross your fingers.
If the tab seems to hang, give it 5 minutes before you hold the power button down and then turn it back on again. It should sit there for several minutes and perform the conversion.
Once you're done and up & running, you can save the full firmware/ROM to the MicroSD card, boot into recovery by turning the tab on hold the UP volume button, then using the "Select ZIP from sdcard" option to flash the firmware. This will WIPE all custom applications and settings you have installed! I'd recommend doing a "wipe data/cache" before flashing this just in case though.
The full MCR firmware is available from:
http://android.modaco.com/content/samsung-galaxy-tab-tab-modaco-com/331479/04-feb-r1-modaco-custom-rom-for-the-samsung-galaxy-tab-with-online-kitchen/
There are also alternative firmware's (e.g. Overcome, Rotohammer) on this forum - they're all currently based on the same official JMI firmware with various tweaks. The MCR kernel seems to be the easiest way to start.
Full credit goes to Paul @ MoDaCo for releasing the kernel in the first place.
I typed most of this out for someone, figured I'd post it here as well in case it's useful to someone.
WARNING: Check the integrity of anything download from the MoDaCo server(s) before flashing as their server(s) frequently seem to have issues completing downloads.
knightnz said:
Basically, make sure you've got a microSD card with about 500mb or more free on it for the ext4 conversion before you even start.
Click to expand...
Click to collapse
Make sure you have sufficient space. In my case I needed more than 500MB. My system was corrupted because it tried to backup the existing system onto the microSD and I only had 639MB free, which was insufficient for me. Then when my system rebooted, I kept on getting force closes from Nook and Titanium Backup and some other apps.
nice work!
Hi knightnz,
Sorry for this noob question.
Does this means I can do it on my stock rom without installing anything or customizing my tab?
Is clockworkmod recovery required to execute this conversion?
Thanks.
Jasper
Sent from my GT-P1000 using XDA App
jasperlaguerta said:
Does this means I can do it on my stock rom without installing anything or customizing my tab?
Is clockworkmod recovery required to execute this conversion?
Click to expand...
Click to collapse
You have to flash a new kernel, which will also flash ClockworkMod Recovery onto your device, so the answer to your first question is no, you can't do this without customising your Tab (new kernel, new recovery!), and your second question, yes you need ClockworkMod!
Regards,
Dave
Yup, on the Galaxy Tab the recovery gets packaged in with the kernel installation, so if you flash a zImage, you're probably replacing the recovery as well. (I'm sure it could be omitted, but so far it seems this hasn't been the case).
At the moment all SGT recovery's are based on ClockWorkMod (this includes the MCR kernel version).
As for "stock rom", well I'd class a complete filesystem conversion as definite customising. If you _just_ replace the kernel and do the ext4 conversion though and don't worry about replacing the main firmware, then you'll retain your existing system exactly as it was, it'll be snappier though, and you'll then have access to the CWM recovery should you ever need it.
I had difficulties flashing this as the Modaco server kept on stopping the download when incomplete. I had an hour of scratching my head when I saw that the download was 4 1/2 Mb when it should be 6.66.
It took me about 6 tries to get the full file and was sweating when I saw the following screen:
phone --- ! --- Computer
Keep an eye out for this chaps...
is there a way of going back to RFS from EXT4?
(just in case)
asenduk said:
is there a way of going back to RFS from EXT4?
(just in case)
Click to expand...
Click to collapse
Yes, I already did that once. Go into the development section and find the Roto JME rom, get the full rom, the p1_hidden.pit, and a modem of your choice, and follow Roto's instructions to the letter, and you will have rfs, and your CWM3 will be gone.
I'm used to the speed increase now. Perf drop if i went back.
Ext4 is stable enough
Sent from my GT-P1000 using Tapatalk
rob_h said:
I had difficulties flashing this as the Modaco server kept on stopping the download when incomplete. I had an hour of scratching my head when I saw that the download was 4 1/2 Mb when it should be 6.66.
It took me about 6 tries to get the full file and was sweating when I saw the following screen:
phone --- ! --- Computer
Keep an eye out for this chaps...
Click to expand...
Click to collapse
Yeah, their "load balancing" server doesn't seem to have very good balance by the look of it, downloads fall over frequently.
I have a copy here http:/ /bit.ly/myroms
Sent from my GT-P1000 using Tapatalk
" PWNED " :-D
As you know, Archos bootloaders check digital signatures of init and recovery kernels, so you need to install SDE to use custom kernels, and it somehow "watermarks" the device.
Good news everyone! I've disassembled both bootloaders, found the code which checks signature, and replaced it (first instructions of verify_hash function) with "return 0" which is "mov r0, #0; bx lr" in ARM assembly. It's much the same hack as on Archos 5, thanks EiNSTeiN from archos.g3nius.org for reverse engineering previous generation.
Archos gen8 boots using OMAP boot ROM from internal eMMC card. Primary bootloader ("boot0") is in 0x20000 bytes after the first sector of internal flash (i.e. at 0x200) and secondary bootloader is written into rawfs, /mnt/rawfs/avboot. boot0 contains image size and loading address in first 8 bytes.
So, here is the patch:
1) boot0: replace 8 bytes at 0x7520 from the beginning of mmcblk0 from 7F402DE9003091E5 to 0000A0E31EFF2FE1.
2) avboot: replace 8 bytes at 0x14424 in avboot from 7F402DE9003091E5 to 0000A0E31EFF2FE1 (same patch). 0x14424 from avboot beginning is usually 0x14824 from the beginning of mmcblk0p1 (avboot comes first in rawfs, just after 2 blocks of header).
Of course you need root to do it. I've done it on my Archos 101, then changed 1 byte in recovery image - it boots into recovery without problem (before the hack it didn't boot into this 1-byte changed recovery).
And of course do it with caution and at your own risk DO NOT replace the bytes if you find other original data at these offsets! Bad boot0 or avboot means bricked Archos. There must be some sort of test point (something connected to OMAP SYS_BOOT5 pin) to boot from USB, or a boot UART interface, so debricking the device must be possible, but it would require some effort to find it, find a proper bootloader and use it.
If someone wants to see IDA database, I'll send my.
P.S: I do not have enough messages to post inside Development subforum, so I'm posting here.
Great work! With this base, can yout get something like CW to run?
I'm so waiting for him to come back and say April fools.
I'm gonna screw him up if this was an april fool
First, if this is an April fools, I will find you and hurt you.
Second, what does all that mean anyway? Does that mean Cyanogen on Gen8 is near? Does it have anything to do with roms?
vitalif said:
P.S: I do not have enough messages to post inside Development subforum, so I'm posting here.
Click to expand...
Click to collapse
Maybe you should increase that number of post by explaining how you did this.
)))) No it isn't an April fool, my device now really has a modified recovery. Ridiculously modified (1 byte changed), but that's the proof!
Check the patch by yourself )) all you need to write to mmcblk0 is a standard linux dd tool... which is included into standard Archos busybox...
wdl1908 said:
Maybe you should increase that number of post by explaining how you did this.
Click to expand...
Click to collapse
In fact, it was not hard, and if I knew ARM assembly language before, it would be even easier... All I had to do is to find bootloader on the flash (boot0 is obviously in its beginning, and avboot is on /mnt/rawfs), copy it to computer, download IDA, feed bootloader to it and find functions similar to ones described on archos.g3nius.org (BigInteger_ModulusEnter, RSADecipher, etc). It also could be simpler, as BigInteger_ModulusEnter is mentioned inside an ASCII string inside data section... But I've found them by text search also there is a magic "ZMfX" in first 4 bytes of avboot and some other magic inside init and recovery... One also could use them to find interesting points in bootloader.
At first I've started disassembling with the wrong base address, but bootloader has code which copies itself to the correct one in the very beginning, so I've changed it and started over. In fact, it has size and address in first 8 bytes, so this also could be simpler...
So the hack is done, what needs to be done by now - utilize it and create some custom ROM or simply flash urukdroid without SDE...
chulri said:
Great work! With this base, can you get something like CW to run?
Click to expand...
Click to collapse
CW == ClockWorkMod recovery? I don't have any experience with CWM porting yet, but in theory yes, the hack gives us the ability to run custom recovery images.
Don't know alot about the bootloader, but what advantage does this have?
SWFlyerUK said:
Don't know alot about the bootloader, but what advantage does this have?
Click to expand...
Click to collapse
Hm. I'll explain... Bootloader is the program which starts up the device, similar to bootloader on your PC signature check in bootloader prevents us installing modified Linux kernel, initial ramdisk and recovery images. So, for example, we can't have netfilter in kernel without installing SDE, we can't have ClockWorkMod recovery on Archos at all, and we can't, for example, change MMC card splitting into 512M mmcblk0 for system + remaining for "internal SD" with data.
With signature check removed, all this is possible.
The underlying idea of all this signature checking is probably protecting f**king DRM... I HATE IT !!!!!! And hate companies promoting it =) When you install SDE on previous generation archos (5it), it removes drm keys from device memory (this is the "watermarking" mentioned on Archos site). It makes device unable to play the content buyed for it anymore... Not a big deal, but unpleasant. I don't know if this is the same on gen8.
In detail: Archos 101 has OMAP3630 processor. The "0-stage" (very-very first stage) bootloader, i.e. program which gains control after processor power-up, is hard-coded into one-time programmable area on the processor itself and is named "OMAP boot ROM" (similar to PC BIOS). The boot ROM can continue device booting process from different devices including SD/MMC card, NAND flash, UART (serial port) or USB interfaces. The boot sequence is determined from physical pin connection configuration. Our Archos boots from internal eMMC card.
So, OMAP boot ROM loads primary Archos bootloader, without checking any signatures or checksums, and simply transmits control to it. Primary bootloader sets up some processor configuration and then reads secondary bootloader (avboot) from flash. Then, it checks its MD5-RSA digital signature using Archos public key. If signature is incorrect, it hangs the device (goes to infinite loop). So if we modify avboot without removing signature check from boot0, device would be bricked. If signature is correct, control is transmitted to avboot. Avboot determines what system we want to start by pressing different keys, loads it, checks signature if system is init (normal system) or recovery, sets up configuration for Linux kernel and transmit control to Linux.
Interesting facts:
* According to the code, boot0 can use rawfs or FAT filesystems for boot partition.
* During boot process, various messages are printed to serial console. avboot even has some code for receiving commands over serial connections.
* OMAP processor boot sequence can be configured via special memory area which remains unchanged after soft reset, and this configuration will override one determined by physical pin configuration. This does not give us much profit, but is also interesting...
Thanks for the explanation, so is it worth doing for a noticable difference in performance etc?
SWFlyerUK said:
Thanks for the explanation, so is it worth doing for a noticable difference in performance etc?
Click to expand...
Click to collapse
Whats being done will have no affect on performance of the device. It will however, allow a lot of work that can contribute to better performance on the device. That is assuming that we can put on a modified clockworkmod recovery on these devices without bricking them.
He says the only way to do this is with root but in order to have root with r/w access at this point is SDE....right? Don't get me wrong custom recovery with the ability to make backups would be awesome but it seems SDE will still be necessary unless a new rooting option comes along.
*on a side note about root has anyone tried using psneuter to gain temp root through ADB? I really am not super knowledgeable about this stuff but this was used on the thunderbolt to aid in getting full root and s-off.
Sent from my ADR6400L using XDA App
JBO1018 said:
He says the only way to do this is with root but in order to have root with r/w access at this point is SDE....right? Don't get me wrong custom recovery with the ability to make backups would be awesome but it seems SDE will still be necessary unless a new rooting option comes along.
*on a side note about root has anyone tried using psneuter to gain temp root through ADB? I really am not super knowledgeable about this stuff but this was used on the thunderbolt to aid in getting full root and s-off.
Sent from my ADR6400L using XDA App
Click to expand...
Click to collapse
Archangel will give you temp root without using SDE.
He said root with r/w access. Archangel won't do that, the file system is still protected.
pbarrett said:
He said root with r/w access. Archangel won't do that, the file system is still protected.
Click to expand...
Click to collapse
Nope r/w access is not needed the only changes to be made are on /dev/mmcblk0p1 which is mounted on /mnt/rawfs the read-only is on the root file system so they are seperate. Archangel will do just fine for this.
wdl1908 said:
Nope r/w access is not needed the only changes to be made are on /dev/mmcblk0p1 which is mounted on /mnt/rawfs the read-only is on the root file system so they are seperate. Archangel will do just fine for this.
Click to expand...
Click to collapse
To be correct, there is no write protection on internal MMC at all, there is readonly rootfs which is mounted from a squashfs archive (squashfs is compressed readonly filesystem commonly used on Linux Live CDs), so you can't modify _files_ on it while it is mounted. But, nothing stops you from updating it as a whole.
Urukdroid
Someone should give a shout out ro $auron, creator of the Urukdroid project about this, he might find it useful.
So, if your hack is confirmed, that would give us the possibility to port CW recovery and Cyanogen to Gen8 devices... am I right ?
shrewdlove said:
Someone should give a shout out ro $auron, creator of the Urukdroid project about this, he might find it useful.
Click to expand...
Click to collapse
I think he has already seen this thread but you can ask him
lechuckthepirate said:
So, if your hack is confirmed, that would give us the possibility to port CW recovery and Cyanogen to Gen8 devices... am I right ?
Click to expand...
Click to collapse
Yes you are^^ but the thing is you have to port cyanogen to our gen8^^ and this must be done by a or more devs
i heard the biggest problem is that our touchscreen is connected by an usb controller inside the archos thats why the honeycomb port by luisivan is not recognize our touchscreen ( but when the source code is released, finally, we will get a hc port )
Lennb said:
i heard the biggest problem is that our touchscreen is connected by an usb controller inside the archos thats why the honeycomb port by luisivan is not recognize our touchscreen ( but when the source code is released, finally, we will get a hc port )
Click to expand...
Click to collapse
this isn't a problem for cyanogen (v7 = Android 2.3.3) because we have the source.
First of all, hello. I'm new to tinkering with Android, but I've flashed firmware on dumbphones 68 ways to Sunday, so I'm not new to phone modding nor am I worried about technical answers, so fire away.
To start, this phone has not been rooted (yet) and has the stock 2.3.4 ROM.
I've screwed around for the last six hours or so in fear of bricking the phone only to realize I should have followed a different set of instructions after Step 1 of Downgrading in this guide, because now that I've read other guides, I find this one unnecessarily complicated compared to directly pushing PD15IMG.zip to sdcard.
Since I'm already calling it quits on going any farther with this tonight, I just need a few questions answered before I give this another shot.
1. Is ADB supposed to see the phone when it is in recovery or bootloader mode? When the phone is in recovery or bootloader, entering adb devices in the Windows Command Prompt returns an empty list of devices attached.
2. I have the bad eMMC in my phone. In addition, once in recovery mode and I press Vol Up+Power, I see an error message that says E:Can't open /cache/recovery/command. I also get additional "can't open" error messages when I select Wipe data/factory reset from the recovery menu:
Wiping data...
Formatting /data...
E:Can't open /data/cwpkg.zip
E:Can't open /data/cw.prop
E:Can't open /cache/cwpkg.zip
E:Can't open /cache/cw.prop
Formatting /cache...
Data wipe complete...
Are those errors a concern? Are they a product of a failed eMMC or a corrupted file system? If they are because of the eMMC, would it be safe to say that I should leave this phone alone? If they are because of the file system, what I can do to fix these errors?
3. Now that I've read other, more MT4G-specific downgrading guides, will pushing PD15IMG.zip to sdcard and fastboot take care of the "can't open" errors in question 2 as well?
you need clockwork recovery if you want to flash.
You need to downgrade then root with s-off and have eng bootloader to attempt the wipes you've been trying. I just downgraded, last night, just follow the instructions. It's really easy. don't see how you can brick the phone while downgrading unless your phone dies during the flashing step.
Btw you shouldn't worry too much about the bad chip. Both good and bad have been known to brick. All bad chips aren't bad, it's only more susceptible to bricking. I have a bad chip and been flashing since forever
Sent from my HTC Glacier using XDA App
Snakecharmed said:
First of all, hello. I'm new to tinkering with Android, but I've flashed firmware on dumbphones 68 ways to Sunday, so I'm not new to phone modding nor am I worried about technical answers, so fire away.
To start, this phone has not been rooted (yet) and has the stock 2.3.4 ROM.
I've screwed around for the last six hours or so in fear of bricking the phone only to realize I should have followed a different set of instructions after Step 1 of Downgrading in this guide, because now that I've read other guides, I find this one unnecessarily complicated compared to directly pushing PD15IMG.zip to sdcard.
Since I'm already calling it quits on going any farther with this tonight, I just need a few questions answered before I give this another shot.
1. Is ADB supposed to see the phone when it is in recovery or bootloader mode? When the phone is in recovery or bootloader, entering adb devices in the Windows Command Prompt returns an empty list of devices attached.
2. I have the bad eMMC in my phone. In addition, once in recovery mode and I press Vol Up+Power, I see an error message that says E:Can't open /cache/recovery/command. I also get additional "can't open" error messages when I select Wipe data/factory reset from the recovery menu:
Wiping data...
Formatting /data...
E:Can't open /data/cwpkg.zip
E:Can't open /data/cw.prop
E:Can't open /cache/cwpkg.zip
E:Can't open /cache/cw.prop
Formatting /cache...
Data wipe complete...
Are those errors a concern? Are they a product of a failed eMMC or a corrupted file system? If they are because of the eMMC, would it be safe to say that I should leave this phone alone? If they are because of the file system, what I can do to fix these errors?
3. Now that I've read other, more MT4G-specific downgrading guides, will pushing PD15IMG.zip to sdcard and fastboot take care of the "can't open" errors in question 2 as well?
Click to expand...
Click to collapse
are you talking about the stock recovery? because the stock recovery is supposed to say "E: can't open /cache/recovery/command". not sure why but it does. happened on every stock recovery i've seen.
Yes, I'm on stock recovery, and that's good to know that it appears to be normal.
Currently, I have successfully downgraded to stock 2.2.1 with the .86 bootloader.
Now, in following this guide, I've gotten to the end of Step 10 and I get the following:
Code:
[B]# ./gfree -f[/B]
./gfree -f
--secu_flag off set
--cid set. CID will be changed to: 11111111
--sim_unlock. SIMLOCK will be removed
Section header entry size: 40
Number of section headers: 44
Total section header table size: 1760
Section header file offset: 0x000138b4 (80052)
Section index for section name string table: 41
String table offset: 0x000136fb (79611)
Searching for .modinfo section...
- Section[16]: .modinfo
-- offset: 0x00000a14 (2580)
-- size: 0x000000cc (204)
Kernel release: 2.6.32.21-g899d047
New .modinfo section size: 204
Attempting to power cycle eMMC... OK.
Write protect was successfully disabled.
Searching for mmc_blk_issue_rq symbol...
- Address: c02a63a4, type: t, name: mmc_blk_issue_rq, module: N/A
Kernel map base: 0xc02a6000
Kernel memory mapped to 0x40002000
Searching for brq filter...
- Address: 0xc02a63a4 + 0x34c
- 0x2a000012 -> 0xea000012
Backing up current partition 7 and patching it...
Backing up partition /dev/block/mmcblk0p7 to /sdcard/part7backup-1319315128.bin
...
Error opening backup file.
What should I do with the backup not being written?
Upon rebooting into bootloader, it still says S-ON.
Also, to back up a bit, in Step 5, I was supposed to unplug the phone from the computer and use the Android Terminal Emulator. I didn't and executed the commands through ADB because the soft keyboard input wasn't working at all in Android Terminal Emulator.
EDIT: Fixed the problem with backup not working and I now have S-OFF. The microSD card in my phone wasn't being detected properly, so instead of seeing the correct permissions d---rwxr-x with ls -l for directory /mnt/sdcard, it was being seen as read-only. When gfree attempted to write the backup to /sdcard, it failed because the SD was read-only.
I took out my 16GB card and put in my 8GB and this time, the gfree backup saved. I can't recall if I had the phone plugged in when I rebooted the phone or plugged it in afterward, but I'm slowly realized that the SD card gets remounted when you plug and unplug the phone from the computer due to the different file systems. That's why I had issues saving files to /sdcard through ADB. Now I understand why the commands were supposed to be entered in Android Terminal Emulator, but I couldn't get the soft keyboard to function in it. Hopefully, that won't be a problem after flashing the new ROM, but that will be the next concern for me.
EDIT 2: I have now installed CWM Recovery 5.0.2.0. Also, it looks like the Android Terminal Emulator developer borked the keyboard input with today's update. Read comments from October 22, 2011:
https://market.android.com/details?id=jackpal.androidterm&hl=en
remember to perm root your phone and flash the engineering bootloader i think it was like .85 something
Thanks. I had it perm-rooted and installed the engineering bootloader by the end of the weekend. I'm looking forward to flashing VU after I get some more free time and take note of settings and apps I might want to keep from the stock ROM.
your apps should be restored by google
but just in case, use titanium backup or my backup. I personally prefer my backup to backup my sms/mms, apps and settings because its quicker when you restore.
I use titanium backup to backup and restore system apps.
Oh yeah you shouldn't try to backup your settings from your stock and restore it when you flash VU, they're different OS so might cause problems. BUT it's useful when you flash new updates.
Other than VU, you might want to try TDJ's Darkside if you want to test out sense 3.5. However, i might go back to virtuous once they release a final build for sense 3.5
happy flashing
I actually didn't have any settings to back up because I haven't been using the phone as my primary phone since I bought it, but I backed up the stock Froyo ROM and flashed to VU 2.39 two nights ago. Everything appears to be running well. I reinstalled Swype 3.7 from the stock Gingerbread ROM and I still need to reinstall Genius with Button Shortcut.
I don't really like the trouble of going back and forth between ROMs, so thankfully, I'm quite pleased with VU and Sense 3.0. The rest is just customization at this point. I may eventually take a look at Virtuous Trentacinque after it goes gold, but I didn't want to wait around for it nor run a beta ROM on what will soon become my main phone. I have no problem with flashing files and making tweaks all day, but it gets old after a while and I'd rather just use the equipment instead.
So far, battery life on VU seems to be pretty good and is much better than stock. I'm enjoying the new ROM so far as well as finally getting to use the phone rather than just backing up files and testing features.
fyi, Swype 3.25 beta is out. I think Swype 3.26 beta is out too. I think there was a thread with themed Swypes somewhere. But I forget.
Sent from my HTC Glacier using XDA App
[REF] ★★★Understanding the Android world before rooting your LG Nexus 4★★★
Understanding the Android world before rooting your LG Nexus 4
Here is a *noob friendly* collection of information every user that wants to root their phone should know. Many people blindly follow guides without even knowing what "Rooting" means. Hopefully, this will help new users (and old ones, why not?) understand what is happening with their phone, and what they will put up with.
This may seem as a lot to read, but there are no shortcuts. You either read and learn what you're dealing with, or find out the hard way.
Let's get started, shall we?
What does rooting mean?
To 'root' your phone means to gain administrative rights on the file system of your phone (in linux, root is the username of the master admin, kind of being an Administrator on Windows). With root access, you can install and uninstall anything you want on the phone.
Most phones come with limited access regarding what you can and can't do on it. This isn't necessarily a bad thing, because it can keep users from accidentally breaking something they shouldn't mess with on the phone, especially in regards to the operating system. However, many manufacturers limit your rights to things that aren't really so mission critical, too, and rooting the phone gets around this.
If you have a few unnecessary applications (bloatware) pre-installed on your phone that you cannot uninstall, rooting will give you this ability. It will also allow you to upgrade to newer versions of Android before your phone's manufacturer and/or cell provider make the updates available to you.
Click to expand...
Click to collapse
So now you know what rooting means. And I bet you are now thinking "Should I do it, or not?" Well, hope this helps you decide:
The advantages of rooting
-De-bloat your phone. Uninstall any unwanted system apps.
-More control over how the CPU acts. This can increase performance or battery life, depends on how you configure it.
-More control over power consumption. This implies undervolting your CPU, giving it less power, so it consumes less.
-More control over how apps start up. Prevent apps from starting up when they don't need to.
-Change your Baseband (Radio). Try different radio versions, with the purpose of reducing battery drain or improving your signal strength. This may also allow you to enable LTE, due to the fact that it's disabled on the latest radios.
-Flash custom ROMs. Bored of the stock ROM and look? Browse through the hundreds of custom ROMs provided by this community, each having different features and looks.
-Backups. The ability to completely backup your phone, and fully restoring it to the time of the backup. This is done with a Nandroid Backup (we'll talk about this later)
-Mods and Inovations. Use many mods, fixes, tweaks or features created by the community!
-Custom Kernels. As a Nexus device, the Nexus 4 has tons of kernels with different features, supporting better performance, or battery life! To see what a kernel is, keep reading.
-Run apps that need Root Permission. These apps can be very useful, like Titanium Backup, Root Explorer, Terminal Emulator and many others!
Click to expand...
Click to collapse
The disadvantages of rooting
-Rooting will void your warranty (Although reverting root is very easy)
-The process a bit dangerous. Something could (99.9% probably not, but still) go wrong, and end up bricking your phone. So, yes, the process is 0.1% risky. You can end up deleting everything on your phone. You'll have to handle this process gently and with care.
-You will be able to do a lot more mistakes. These may cause damage to your phone (But hey, that's why we have these kind of threads, eh?)
-No more over the air official updates. You'll have to update your phone manually, through your recovery. (Which isn't that hard)
Click to expand...
Click to collapse
Now that you fully know what rooting implies, let's continue exploring the Android world.
What about the internal memory? How does that work?
Now, as you might already know, each phone has an internal memory. In the Nexus 4's case, it's either 8GB or 16GB. This internal memory needs to hold a lot of things, not only your personal data. This is why you only have available to use 5.8 GB or 12.9 GB.
An Android's internal memory is partitioned into many chunks that have their separate purposes.
These are all the Nexus 4's partitions, and their names.
modem -> /dev/block/mmcblk0p1
sbl1 -> /dev/block/mmcblk0p2
sbl2 -> /dev/block/mmcblk0p3
sbl3 -> /dev/block/mmcblk0p4
tz -> /dev/block/mmcblk0p5
boot -> /dev/block/mmcblk0p6
recovery -> /dev/block/mmcblk0p7
m9kefs1 -> /dev/block/mmcblk0p8
m9kefs2 -> /dev/block/mmcblk0p9
m9kefs3 -> /dev/block/mmcblk0p10
rpm -> /dev/block/mmcblk0p11
aboot -> /dev/block/mmcblk0p12
sbl2b -> /dev/block/mmcblk0p13
sbl3b -> /dev/block/mmcblk0p14
abootb -> /dev/block/mmcblk0p15
rpmb -> /dev/block/mmcblk0p16
tzb -> /dev/block/mmcblk0p17
metadata -> /dev/block/mmcblk0p18
misc -> /dev/block/mmcblk0p19
persist -> /dev/block/mmcblk0p20
system -> /dev/block/mmcblk0p21
cache -> /dev/block/mmcblk0p22
userdata -> /dev/block/mmcblk0p23
DDR -> /dev/block/mmcblk0p24
grow -> /dev/block/mmcblk0p25
Yes, there are quite a lot. You, as a user, don't need to care about all of them. Here are the ones you will need to know about:
/system- size: about 0.5GB
This partition holds the Android OS itself. Kind of like the C:// disk on your every day Windows PC. This partition has many folders and files you cannot normally get to, due to safety reasons. For example, system/app is where all the system apps are installed.
If something gets deleted from this partition, Android will most probably won't work properly.
/data- size: either 5.8GB, or 12.9GB
This is where all your personal data is kept. This includes apps, sms, contacts, e-mails etc. It also stores your system settings, like wallpaper, and all those stuff you set up when you got your phone. The most important folders on this partition are data/app (where your apps are stored), data/data (where you app data is stored, like highscores and stuff), and data/media.
Data/media might be considered your sd-card. Yes, I know the Nexus 4 doesn't have an sd-card, but this folder works like one. When you connect your phone to your PC, this is the folder that pops up, with all your music, images, videos, and whatever else you keep on your phone.
Click to expand...
Click to collapse
Things are getting a bit more complicated, eh? Just bare with me. Next, I will be explaining the different terms you will be encountering throughout your Android experience.
Things you hear people talk about
Kernel
The kernel is an essential part of any Linux based operating system. It's the program that manages input and output requests of the operating system. Imagine you're at a restaurant. You give your order to a waiter. He takes it to the chef, the chef makes your food, then the waiter brings it back to you, and you enjoy it. In this case, you are the Android system, the waiter is the Kernel, and the chef is the hardware. The system gives the Kernel a request, like firing up another processor core when you play a heavy game, and the Kernel fulfills the request.
Here is an image for better understanding
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Recovery
This is a secondary, mini operating system that has access to your internal memory. It contains a few commands that would normally help you recover your Android system in case of a failure, like factory resetting. You will see that, for rooting, you will need to install a custom recovery.
The stock recovery does not have the ability to write custom ROMs (I'll explain these later) on your internal memory. A custom recovery has this option, and many more.
Here are some images for you to fully understand:
Stock recovery:
Custom Recovery
You can see that the Custom Recovery has more options, including "Backup and Restore", Advanced, and Install zip from Sd-card.
You can get in Recovery by powering off your phone, then hold Power+Volume Down button until a black screen with colored text appears. Then, use the volume buttons to select 'Recovery", and then press the Power Button to select it.
Bootloader
The bootloader is the first thing that fires up when you open your phone. As the name says (Boot+Loader), this program loads the kernel, which when boots up the Android system.
The same bootloader can also boot in recovery, as explained above.
When you first get the phone, the bootloader is in a locked state. That means that you cannot use fastboot commands like "fastboot flash" or "fastboot boot". With other words, you cannot simply flash a custom recovery. Thankfully, Google gave us the option to unlock the bootloader very easily, and flash a custom recovery of our choice.
Custom ROMs
A custom ROM is a ZIP file that contains an altered version of the Android OS. There are many custom ROMs for the Nexus 4, made by wonderful and skilled devs for the community. You can install a Custom ROM with your Custom Recovery. Custom ROMs contain the following folders and files:
META-INF- This folder holds the installation info and data. A custom recovery does not know on it's own how to install a ROM. In this folder, there's a txt file that contains a script, with the purpose of telling the recovery what to do.
System- This folder contains the stuff that will be installed on the /system partition that we talked earlier about.
boot.img- Among others, this file contains the kernel that comes with the ROM.
Click to expand...
Click to collapse
Ok, so now, after you read all this stuff, you're probably thinking "Ok, I will never get the hang of this". Don't worry. With time, you will know all of these from reflex. And, after you got over that, and manned up again, you probably thought "Ok, let's root this damn thing!". Not quite yet. We aren't done. There are still some crucial things that you need to know. So let's continue.
How to backup your stuff
Before you do anything EVER, you'll always have to backup your stuff, even if you don't feel like it, or your dog died (in which case I'm truly sorry), but, no matter what you're about to do, always have a recent backup sitting around.
There are many ways and things you can and will probably have to backup.
1. Backup your entire phone, by creating a Nandroid Backup.
As you saw in the 'Custom Recovery" picture above, you have a "Backup and Restore" option. Here it is again:
With every occasion, it's best to use it as often as possible. It only takes about 2 minutes, but it could be a life saver.
A Nandroid will backup:
/system
/data (Except /data/media, where your "sd-card" is, because it's too large and not that important)
/cache (Yes, there is a cache partition, and it will be backed up, although not really necesarry)
kernel (The kernel will be backed up too)
***Optional tip: I always keep a recent nandroid backup on my PC, in case I somehow wipe all my phone's contents, and my backup among with them. The Nandroid backup is saved at this location, which can be accest with a root file explorer, like ES File Explorer : mnt/shell/emulated/clockworkmod/backup. If you want to copy it to your storage, just copy the latest backup, and then move it to your PC.
2. Your apps and data only
This can be very useful when changing ROMs. You just got bored of your ROM, and want to move to another one. The only way of taking your apps and data with you is by backing them up with an application like Titanium Backup. The backups will be saved in data/media, and will be restored using the same app with which you backup up on the new ROM.
3. Your SMS, Contacts, MMS etc.
These things can be backed up by special apps on the Play Store. Ok, contacts will be restored by Google Sync ( although not always done properly, that's why I still back them up), but SMS will not be restored. There are many free apps that back them up for you, nice an easily, for them to be restored in case of a ROM change or data loss.
4. Your storage (data/media, sd-card)
You just connect your phone to your PC, select all folders, and copy all over on your PC. This will be useful when you unlock the bootloader. A bootloader unlock will wipe all the stuff on your phone (This can be avoided, read guides). So keeping a copy of your sd-card contents on your PC isn't such a bad idea.
Click to expand...
Click to collapse
Now you know how to keep it safe by creating backups. I will say it again, you are never too safe! Backup when you do a modification, even if it's tiny. Now, after you've finished reading the above, you will probably attempt to root. You will use one of the guides out there ( I will link one at the end of this thread ) to install a custom recovery, and gain root access. But what to do with it? Well, you will most likely end up flashing a custom ROM.
Flashing a custom ROM
You will get bored of the stock ROM, and will decide to flash a custom ROM. But you haven't done it before, and you don't really understand the process.Before you do anything, you must:
-Make sure that the files are for your phone ! If you flash files that were made for another phone, you might end up with a brick!
-Never panic! There is always a way out! That's what backups are for!
-Read all the instructions! Every ROM thread has instructions. Read them!
{By the way, flashing = installing}
Now, let me take you through the whole flashing process. ( Use the steps in the ROM threads if instructed differently than here )
1. You will search far and wide in these forums for a custom ROM that fits your needs. Every ROM comes as a ZIP file. So when you decide on a ROM, download the zip. For copyright reasons, Google Apps (Play Store, Google Now etc) don't come included with the ROM. So you will have to download them too. They are usually linked on the ROM main thread.
Some ROMs might have addons too, so check them out, and download the ones you want.
2. You now downloaded the ROM, Google Apps, and some addons. The next step will be to put them on your sd-card. Connect your phone to your PC, and make an easy access folder, like "Root Stuffs" where you'll put all these zips.
3. Now, let the backup process begin. You first backup your apps, app data , SMS, Contacts etc., like I explained above. I recommend Titanium Backup for apps and SMS, MC Backup for contacts.
4. Now you are ready to go in recovery. Power down your phone. Then, press and hold the Power Button and the Volume Down button at the same time. You will be brought to the Bootloader Screen. Now, with the Volume Buttons, switch through the options until you find "Recovery". Then press the Power Button again.
5. Now you will be booted in your Custom Recovery. Depending on your recovery, you will have the options on your screen.
CWM Recovery:
6. You will go to the Backup and Restore menu, and select "Backup". If you made a backup before, you can select "Delete" first, and delete it, for space consumption purposes.
7. After the backup finished, you will return to the main screen. There, select 'Wipe data/ Factory Reset". This will wipe everything in /data except /media, so your sd-card will remain untouched. Don't worry, you have a Nandroid Backup!
8. After the wipe finished, you will go to "Install zip from sd-card". You'll have to navigate to the folder where you put the ROM, and select it. You'll see it will nicely install.
9. After the ROM finished installing, you will have to flash the Google Apps zip, and the mods. Install them the same way you installed the ROM itself.
10. After you have flashed everything, you can select "Reboot system now" . First boot will take longer to complete. Again, don't panic. You have a Nandoid bakcup . You will end up with the ROM booted, and you'll continue setting it up.
TWRP Recovery:
6. Go to the "Backup" menu, select "Boot", "System", and "Data", then swipe the thing on the bottom on the screen to start backing up.
7. Once you're done, use the home button to get to the main screen. Select "Wipe", and swipe the thing again to Factory Data Reset. This will wipe data, cache and dalvik cache. This will not wipe your internal storage (Music, photos, etc).
8. After the wipe finished, use the home button again to get to the main screen. From there, select the 'Install" option. You'll have to navigate to the folder where you put the ROM, and select it. Then, by using the "Add more zips" option, add the Gapps package, and and then any addons or mods, in this order. Then swipe the bottom thing to flash.
9. After you have flashed everything, you can select "Reboot" . First boot will take longer to complete. Again, don't panic. You have a Nandoid bakcup . You will end up with the ROM booted, and you'll continue setting it up.
***In case something went bad, like your phone doesn't boot for more than 10 minutes, or the animation endlessly repeats itself (Boot Loop), do the following:
11*. Hold down the Power +Volume Buttons until the phone shuts down. Then release them for a second, and immediately press them again. You will be brought to the bootloader screen. Enter recovery.
12*. In recovery, go to the "Backup and Restore" menu, and select "Restore". Then pick the backup you did earlier, and wait for it to complete. Then, select "Reboot system now", and you should be booted back in your original ROM.
Now, let's say that after you flashed a ROM, it either did not boot, or you had some bugs with it. You will go to the thread ROM to report your problem. Here's how to not post:
"This ROM doesn't work"
You will have to be a lot more specific than that. In reporting a problem, you will have to do the following:
-Say what you did (Flashing process)
-What you flashed afterwards
-What you did to reproduce the bug
-What recovery you use
-ROM Version
-even provide a logcat <This is quite advanced> (http://forum.xda-developers.com/showthread.php?t=1726238)
You have to give as many details as possible, so the developer can sort things out.
Click to expand...
Click to collapse
ADB and Fastboot
ADB (Android Debug Bridge)
The Android Debugging Bridge is kind of a toolkit, that has many commands to control your Android from your PC. This is an essential part of your Android experience. With ADB, you can do many stuff that you couldn't normally do, like backup your apps, or push and pull packages from your phone.
ADB is also used by many of the useful tools out there, like toolkits, and all sort of programs that enhance your Android experience.
With ADB, you can also Logcat. Logcatting is creating a log of everything that happens on your Android phone while it's on. This is used to find the sources of bugs.
Example of ADB Commands:
Code:
adb pull /system/app/RANDOM APP = creates a copy of a system app on your PC
adb push app /system/app = Copies an app from your PC to your system partition
adb reboot bootloader/recovery = Reboots the phone in bootloader or recovery
adb logcat = Starts a logcat
Fastboot
Fastboot is also a toolkit of commands, but a bit different from ADB. While with ADB, you can do simple actions, with fastboot, you can do major ones, like flashing a whole partition, or formatting one. Fastboot is usually the preferred method to flash a recovery. Also, Fastboot usually works with .img files.
Example of Fastboot commands:
Code:
fastboot erase boot = Erases the kernel
fastboot erase recovery = Erases the recovery
fastboot flash system system.img = Flashes the System partition with an image
fastboot flash boot boot.img = Flashes kernel
fastboot flash userdata data.img = Flashes Data partition
fastboot flash recovery recovery.img = Flashes a new recovery
fastboot reboot = Reboots the phone
To use ADB and Fastboot, you must first have ADB drivers and Fastboot drivers installed. Here is a very good guide to set up these two useful things:
http://www.redmondpie.com/how-to-set-up-android-adb-and-fastboot-on-windows-tutorial/
Click to expand...
Click to collapse
Tips and Tricks
1. Try to not use toolkits. (I'm not disregarding any toolkit dev. They did a wonderful job)
Due to the fact that people are lazy in nature , toolkits have been made so that users don't struggle with rooting their phone. But there are many reasons for you to not use one:
-->you won't learn anything from using a toolkit, and, if something goes wrong, a toolkit can rarely fix your problem. It's better if you rely on your own forces.
-->you put the fate of your phone in someone else's hands. If a bit of code is wrong, then your phone could get bricked.
-->you miss out all the fun. Why buy a Nexus device if you don't want to explore the depths of the Android OS?
2. Never panic
Whenever you don't know what to do, and you're stuck, don't panic. There are many people here that can help you. Don't try doing anything blindly. Search the forums, or start a thread in the Q&As section, and we will help you.
3. Read everything carefully!! (If you read this, post a cat picture in this thread)
I might have said it a couple of times throuout this post, but always read everything. Someone wrote something for a reason. Usually, if you read everything, and do what you are told, you are bound to be failproof.
Click to expand...
Click to collapse
Ok, so now you know pretty much all a normal user should know. But there are still questions that are very frequently asked that need answering. Here are some questions and answers about popular problems and misconceptions:
Questions and Misconceptions
1. My Nexus 4 is getting very hot. Hardware problem?
Nope. There are many reasons that contribute to your phone getting hot, like
-the fact that glass is a good heat conductor, and the Nexus is covered in it
-the fact that a quad core produces more heat
-etc.
Don't worry. Everything is working as it should. For example, the Ipad gets 3 times hotter than the Nexus.
2. If I am rooted, will I receive OTA updates?
Yes, and no.
You will be able to download the update by having installed the Stock ROM with stock kernel, though it will not be installed automatically, due to the fact that you have a custom recovery. You will need to install it manually.
3. My notifications are delayed. Why?
Well, it due to the fact that Android is doing too much filtering.
To fix, navigate to /system/etc/wifi, and open WCNSS_qcom_cfg.ini. Now find the line McastBcastFilter=3. Change the value to 1, like this: McastBcastFilter=1, save, and exit. Then reboot. Your notifications should not be delayed anymore.
4. The Nexus 4 audio quality is horrible. Why?
It isn't horrible. It's normal, but the max volume isn't as loud as on other devices. I have been a piano player for 12 years. I have quite a sensitive ear, and I can tell you that the audio quality on the Nexus is comparable with that of an Ipod. The only major difference is that, with the Ipod, you can go deaf with the max volume.
5. Which kernel/ ROM should I use?
Don't ever ask this question. What's good for others isn't necessarily good for you. You'll have to try the many kernels and ROMs yourself.
6. My Nexus 4 rattles when I shake it. Why? Something broken?
Nope. There's nothing broken. That rattling is caused my the camera lenses moving. Don't worry about that either.
Click to expand...
Click to collapse
This is all for now. I hope you understand what's up with this Rooting process. If you have any questions, don't be shy to ask in this thread
If there is anything to be added to this thread, please post below
Thank you for the time you allocated to reading this! You are now smarter :good:
Good day, and Happy flashing!!!
For credits, useful links and other stuff, see the posts below.
Useful links
INDEX of Guides, Tools, Recoveries and more... (By GaboWinter)
Unlocking Bootloader without wiping data
[HOW-TO] How to flash a factory image / return to stock / unlock / root #
Ultimate Nexus 4 Root Guide
Credits and Thanks!!
@rootSU
For providing me a template and much of the info. His original thread in the S3 forums: (http://forum.xda-developers.com/showthread.php?t=2362743)
@mskip
For providing information on memory partitions
@paxChristos
For the logcat part
@efrant
For pointing out some mistakes
My annoying cat
For continually stepping on my keyboard.
Thanks for this awesome guide!
ngr.hd said:
Thanks go this awesome guide!
Click to expand...
Click to collapse
Thanks!! No problem. My girlfriend left me, so I have plenty of free time now
abaaaabbbb63 said:
Thanks!! No problem. My girlfriend left me, so I have plenty of free time now
Click to expand...
Click to collapse
O god Nice guide, will be helpful. One thing though:
4. Now you are ready to go in recovery. Power down your phone. Then, press and hold the Power Button and both the Up and Down Volume button at the same time. You will be brought to the Bootloader Screen. Now, with the Volume Buttons, switch through the options until you find "Recovery". Then press the Power Button again.
Click to expand...
Click to collapse
The bootloader can be accessed using just volume down and power. I never have to use both volume buttons.
chromium96 said:
The bootloader can be accessed using just volume down and power. I never have to use both volume buttons.
Click to expand...
Click to collapse
One learns new things every day...
This thread should be stickied IMO.
ohersi intriguing
this thread helped me A LOT!!!
got my Nexus yesterday, and i'm happy that such a thread exists.
@ApriliaM3
U should really consider making this a sticky
Hello!
I bought my Nexus last week, and I kept looking on the internet they can do with it. I've heard of the root, and I was curious. I also found it very interesting forum where I found this thread. Thanks for the information. Very useful.
Sorry for bad English. I used Google Translate.
i JUST realized this was here.. DOH!
THANK YOU
Nexus 4 doubts
Hii i just got a 16gb nexus 4 which is my first android phone last month and now i was thinking of rooting it and getting paranoid android on it...but just wanted to get some doubts clarified...
1. I wont be able to install ota updates when 4.3 or 5.0 android versions are released , so how will i get them ?? By Updating paranoid android ROM ??
2. In case i just root my phone and not install any custom ROMs then will i get otas ??
3. After installing a custom rom , can i revert back to the stock google thing ? I mean make my phone as it was when i first booted it.. ??
Thats all i guess..
Nice guide Andu! :thumbup:
Sent from my Nexus 4 using Tapatalk 2
simms22 said:
i JUST realized this was here.. DOH!
THANK YOU
Click to expand...
Click to collapse
No problem
gamekid94 said:
Hii i just got a 16gb nexus 4 which is my first android phone last month and now i was thinking of rooting it and getting paranoid android on it...but just wanted to get some doubts clarified...
1. I wont be able to install ota updates when 4.3 or 5.0 android versions are released , so how will i get them ?? By Updating paranoid android ROM ??
2. In case i just root my phone and not install any custom ROMs then will i get otas ??
3. After installing a custom rom , can i revert back to the stock google thing ? I mean make my phone as it was when i first booted it.. ??
Thats all i guess..
Click to expand...
Click to collapse
1. Yeah. Paranoid will most probably be updated to the latest android as soon as the source is released.
2. Yes, you will get OTAs, but you will have to install them manually.
3. Yes you can. You can either do a nandroid backup of your stock rom, and keep it, or you can flash a stock rom.
xanthrax said:
Nice guide Andu! :thumbup:
Sent from my Nexus 4 using Tapatalk 2
Click to expand...
Click to collapse
Thanks!
Added Fastboot and ADB
If I made any mistakes, please correct me
abaaaabbbb63 said:
Added Fastboot and ADB
If I made any mistakes, please correct me
Click to expand...
Click to collapse
Ha. I was considering adb
Sent from my GT-I9300 using Tapatalk 4 Beta
rootSU said:
Ha. I was considering adb
Sent from my GT-I9300 using Tapatalk 4 Beta
Click to expand...
Click to collapse
Nice!
I really like how you styled your thread! Looks awesome!
is there a link you'd recommend to get all google apps and any other important apps
and Thnx for the great guide, really helped me ALOT
M.Zaki said:
is there a link you'd recommend to get all google apps and any other important apps
and Thnx for the great guide, really helped me ALOT
Click to expand...
Click to collapse
Google apps are usually linked in the ROM thread.
Here are the JB 4.2.2 gapps:
http://goo.im/gapps/gapps-jb-20130301-signed.zip
Its worth noting that some roms have specific gapps packages too. Its always good to use these dedicated packages in case they have cool optimisations (eg slim with the dark mode toggles)
Sent from my GT-I9300 using Tapatalk 4 Beta