hi there,
been busy all evening on my Mac trying to unlock and root my nexus one retail. Got the phone unlocked after extensive reading on SDK and ADB Hoped that the positive flow would continue when switching over to the rooting process, but unfortunately I seem to get stuck and have failed
I downloaded the correct superboot version for my phone and placed it in my home folder (on same drive as where I successfully did the fastboot procedure for unlocking). And then I entered this in Terminal:
---
suikerchiller-macbook-3:~ suikerchiller$ cd /superboot
suikerchiller-macbook-3:superboot suikerchiller$ chmod +x install-superboot-mac.sh
suikerchiller-macbook-3:superboot suikerchiller$ ./install-superboot-mac.sh
ERROR: could not get pipe properties
downloading 'boot.img'... OKAY
booting... OKAY
suikerchiller-macbook-3:superboot suikerchiller$
---
As a result my phone automatically reboots into basic settings. Does anybody know what I'm doing wrong??? I'm a total n00b but am really eager to learn In a bit of trouble now as well, because I don't know what to do anymore and dare to touch my fone either.
Any help would be great. Can't wait to finally be released from Vodafone's retail nexus one terror and want to challenge all those ignorant iphone studs out there and show how cool and superior my Nexus one actually is
P.S. I searched for quite some time on the forum and couldn't find a post/thread that was related to my problem. Please forgive me if this is some sort of double post.
If your phone is unlocked, don't bother with superboot, just flash a custom recovery and use it to install the su zip...
http://forum.xda-developers.com/showthread.php?t=682828
Place the recovery image in your sdk tools folder, place the su zip on your sd card, connect via fastboot and type:
fastboot flash recovery name-of-recovery.img
fastboot boot name-of-recovery.img
Flash the su zip from recovery, and you're done!
many many thanks for the quick reply I placed the recovery image in my sdk tools folder.
However, still have a couple of questions:
I don't know what you exactly mean with a su zip??? Where can I get this file?
what do you mean with: "flash the su zip from recovery"?
I put a link in my original post. The eclair/froyo version works for gingerbread, also...
Once in recovery, you chose the flash zip from sd option, and then the chose zip from sd option, find and select the zip... It will be obvious when you do it...
sorry, it's still too much rocket science for me I guess
I uploaded the su zip file (did not unzip or rename file) to my sd card (activated usb storage and dropped the zip via Mac in the main folder of my phone).
what do you exactly mean with "connect with fastboot"? I shut down my fone first and pressed power button at same time with track ball. Then I did this:
---
suikerchiller-macbook-3:tools suikerchiller$ fastboot flash recovery recovery-RA-passion-v2.2.1-CM.img
-bash: fastboot: command not found
suikerchiller-macbook-3:~ suikerchiller$ fastboot flash recovery recovery-RA-passion-v2.2.1-CM.img
-bash: fastboot: command not found
suikerchiller-macbook-3:tools suikerchiller$ fastboot devices
-bash: fastboot: command not found
suikerchiller-macbook-3:tools suikerchiller$ cd ~
suikerchiller-macbook-3:~ suikerchiller$ cd /fastboot
suikerchiller-macbook-3:fastboot suikerchiller$ fastboot devices
-bash: fastboot: command not found
---
As you can probably see it didn't really work haha what am I doing wrong? Sorry for my n00biness!
You said you have already unlocked your bootloader. In order to unlock the bootloader I you have to connect with fastboot...
How did you unlock the bootloader?
I unlocked it via the first 7 steps of this procedure (sorry have to copy paste a lot of text because im not allowed to post outside links on forum yet haha):
-----
Connect your Nexus One to your PC/Mac and turn it off.
Hold the trackball and hit the power button (while holding the trackball). You should see the following bootloader screen.
Now from the files you downloaded previously, you will see a folder called ‘fastboot‘ (if you extracted fastboot.zip that is!).
On a Windows machine – launch Command Prompt and CD to fastboot folder. (Type in ‘cd ‘ (without the quotes and drag and drop the fastboot folder to the command prompt). Type in ‘cd fastboot‘ again and now type the following command ‘fastboot-windows oem unlock‘ (without quotes) and hit enter.
On a Mac or Linux machine – launch the Terminal and CD to fastboot folder (type in ‘cd ‘ and drag and drop the folder. Now hit enter.). Now CD to the other fastboot folder and type the following (without quotes): ‘./fastboot-mac oem unlock‘ (for Mac) or ’./fastboot-linux oem unlock’ (for Linux) and hit enter. You will see the following. Ignore the error.
This is the screen that you will see now. Use the volume button (on the side) to select ‘Yes’. (Please read the full message displayed on the screen thoroughly). Now push the Power button to select this option (weird, I know. Trackball would have been a better choice to select!).
Great! You have successfully unlocked the bootloader! You will see the unlock image while your phone boots up.
----
I did this successfully and had the black screen and selected unlock phone. So when I press the power button & trackball at same time now I get a white screen now and it says in pink on top: ***Unlocked***
Ok substitute the term fastboot-mac instead of fastboot, into my previous instructions
damn, still doesn't seem to be working:
---
suikerchiller-macbook-3:tools suikerchiller$ fastboot-mac flash recovery recovery-RA-passion-v2.2.1-CM.img
-bash: fastboot-mac: command not found
suikerchiller-macbook-3:~ suikerchiller$ cd /fastboot
suikerchiller-macbook-3:fastboot suikerchiller$ fastboot-mac flash recovery recovery-RA-passion-v2.2.1-CM.img
-bash: fastboot-mac: command not found
----
it's really weird, it looks like my fastboot is not responding anymore... Any idea what's going wrong here???
thanks so much for taking time and helping with figuring this one out!!!
Just tested something. When my phone is switched on normally and connected via USB, Terminal recognizes it as an adb device. However, when I switch into fastboot, Terminal doesn't recognize it:
---
suikerchiller-macbook-3:tools suikerchiller$ adb devices
List of devices attached
HT07YP804207 device
suikerchiller-macbook-3:tools suikerchiller$ adb devices
List of devices attached
suikerchiller-macbook-3:tools suikerchiller$ fastboot devices
-bash: fastboot: command not found
---
Is this where the problem resides?? Anyone know how I can fix this???
adb will only work when it can see the adbd on your phone, so the phone had to be booted to either recovery or fully bolted.
fastboot will only connect when your phone is booted in fastboot. If its not connecting, reboot your phone and mac and try again...
suikerchiller said:
suikerchiller-macbook-3:tools suikerchiller$ fastboot devices
-bash: fastboot: command not found
---
Is this where the problem resides?? Anyone know how I can fix this???
Click to expand...
Click to collapse
Sorry, just re-read this...
Command not found, NOT device not found.
You should be typing fastboot-mac, not fastboot...
Do you have a file called fastboot-mac in the same folder as your adb and recovery img?
rebooted my mac and phone... Still no difference, this is my latest command:
---
suikerchiller-macbook-3:~ suikerchiller$ cd /"Android SDK"/tools
suikerchiller-macbook-3:tools suikerchiller$ fastboot-mac devices
-bash: fastboot-mac: command not found
---
can this be the reason: my fastboot folder is in a different (other) folder than my 'android sdk' folder... should i drag and drop fastboot into the tools folder of sdk???
YES!
Put the fastboot-mac file in the same folder as the other stuff!! xD
haha ok, so I copied my fastboot-mac file (original file from fastboot folder) into AndroidSDK/tools folder. It's in the same folder now where the .img file is in as well.
But it still doesnt seem to be working. These are the commands that I have been using:
---
suikerchiller-macbook-3:~ suikerchiller$ cd /"Android SDK"/tools
suikerchiller-macbook-3:tools suikerchiller$ fastboot-mac flash recovery recovery-RA-passion-v2.2.1-CM.img
-bash: fastboot-mac: command not found
suikerchiller-macbook-3:tools suikerchiller$ fastboot-mac boot recovery-RA-passion-v2.2.1-CM.img
-bash: fastboot-mac: command not found
suikerchiller-macbook-3:tools suikerchiller$ fastboot-mac devices
-bash: fastboot-mac: command not found
suikerchiller-macbook-3:tools suikerchiller$ fastboot devices
-bash: fastboot: command not found
suikerchiller-macbook-3:tools suikerchiller$
---
What's going wrong??? I'm going slightly mental now. Also running out of beer at same time. Not a good combination
can you list the contents of that folder, and tell me what result you get?
this is the list of files in my AndroidSDK/tools folder:
--
suikerchiller-macbook-3:tools suikerchiller$ ls
Jet hierarchyviewer
NOTICE.txt hprof-conv
adb-mac layoutopt
adb_has_moved.txt lib
android mksdcard
ant monkeyrunner
apkbuilder proguard
ddms recovery-RA-passion-v2.2.1-CM.img
dmtracedump source.properties
draw9patch sqlite3
emulator traceview
etc1tool zipalign
fastboot-mac
---
and here are the commands for fastboot, in case they can be of any usage
suikerchiller-macbook-3:tools suikerchiller$ ./fastboot-mac
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
Hmmmmm, well the file is there, so that's really weird because you mac is definately saying that it's the command it can't find...
I'm not much of a mac guy, but I do know that your mac is the one having the problem...
Try:
./fastboot-mac flash recovery name-of-recovery.img
suikerchiller-macbook-3:~ suikerchiller$ cd /"Android SDK"/tools
suikerchiller-macbook-3:tools suikerchiller$ ./fastboot-mac flash recovery recovery-RA-passion-v2.2.1-CM.img
sending 'recovery' (3380 KB)... OKAY
writing 'recovery'... OKAY
The popularity of Nexus devices has increased significantly since the launch of the Nexus One in January 2010. Along with this popularity, forums such as xda-developers have also had an influx of new users, most of which are not developers, and are not well versed in the intricacies of Android.
After much thought (and some discussion on this thread), I’ve decided to create this thread as a compilation of FAQs, 101s, and “How-To’s” in the hopes that those coming to Android who want to learn will have another resource to help them learn. With that in mind, this thread is NOT meant to explain the quickest way to do things (you will NOT see toolkits or shortcuts discussed in this thread), nor is it meant to be a “fix-my-device” thread. It is created with for a purpose of learning, in order to expand users’ knowledge of Nexus devices and Android in general. See this post by kyphur for the general philosophy of this site, which I share.
I do not take myself to be an Android guru or developer. However, I do have a bit of knowledge to share. If you think things are missing or not accurate, I will be more than happy to add or revise anything. I will try to cover most of the basic topics related to Android, including drivers, ADB, fastboot, partitions, recoveries, bootloaders, root and reverting to stock. Again, I will not discuss toolkits, nor will I cover custom ROMs. Those have their own threads.
This will be an ongoing work-in-progress, as it takes considerable time to try and capture everything properly, and my time is limited. The order of the information will also change, as I haven't quite figured out the best way to present everything. (Currently there are some FAQs, including fastboot and ADB commands, followed by a list of reference and how-to threads.)
So, without further delay:
Frequently Asked Questions
What is Android?
Android is an open-source operating system for mobile devices. It is basically a java virtual machine running on a Linux-based kernel.
What is the Android SDK and do I need it?
SDK stands for "software development kit. Do you need it? If you are developing, then yes (but then you probably would be reading this thread now would you... ). If you are not developing, then no, you do NOT need to install it. It is just a waste of space. The only files you need (to interface with your PC) that comes from the SDK are the fastboot and adb files, and they can be found here for Windows, Linux, and MacOS.
Why do I need a driver for my Windows PC to recognize my device?
As with all hardware, Windows requires device drivers for it to be able to interface with the OS. Drivers are not required if you are using Linux or MacOS.
Where do I get the driver for my PC?
For the Nexus 4, the driver available in the SDK works. (You can get just the driver without the SDK from here.) However, I recommend using this package by 1wayjonny. It works perfectly and, unlike most other packages, 1wayjonny’s repack does not install any crapware along with it. That said, it doesn’t include an .exe file, so it needs to be installed manually from the .inf file. If you do not now how to do that, see here for instructions. Note: If you are using Windows 8, you will need to do this before you can install the driver.
Why do I need to install the driver twice?
Nexus devices use two main interfaces (there are actually a few more, but I will cover them later) to communicate with a PC. These are ADB (Android debug bridge) and fastboot, both of which will be covered later. The fastboot interface requires the N4 to be booted in fastboot (i.e., bootloader) mode. Thus, in order to install the fastboot driver, you need to boot your N4 into the bootloader. The ADB interface requires an Android kernel to be booted, i.e., your device needs to be booted normally, or in a custom recovery (covered later). Additionally, if your device is booted normally, you need to have USB Debugging set to enabled in settings (i.e., Settings->Developer options->USB debugging).
How do I boot my device into the bootloader (i.e., fastboot mode)?
Turn off your device, hold volume down, and press and hold the power button.
What is a command prompt?
A command prompt in Windows (or terminal in Linux/MacOS) is a command line window in which you can enter commands. To open a command prompt in Windows, you can hold the shift key and right click in the directory in which you want your command prompt open. Or, in a Windows Explorer window you can go to File-><name-of-window>->Open command window here.
What is a bootloader?
Without getting into too many technicalities, the bootloader is essentially the program that gets loaded first when starting your device, and it is responsible for booting the Android kernel. Think of the bootloader as the BIOS of a computer.
What does it mean if my bootloader is locked/unlocked?
Most (if not all) devices are shipped from the manufacturer with locked bootloaders. This is for security reasons. A locked bootloader does not allow easy flashing of images, which means that it is difficult to change or modify the operating system. Unlocking a bootloader (using fastboot) on most Nexus devices results in a complete loss of all personal data from the device. Having a locked or unlocked bootloader has no bearing on the functioning of the device. Unlocking it gives you more options to play around with the OS. Additionally, an unlocked bootloader means that you can easily root your device no matter what -- unlike most non-Nexus devices, if you lose root, it is trivial to get it back.
What is “root”?
Root essentially means that you have root (or superuser) access to the file system on Android. It is similar to being “administrator” on a Windows PC. It has nothing to do with your device or the bootloader, it has to do with the Android OS (i.e., you cannot “root” your device – you root the Andoid build that you are running). To have root, you need to be booted into the Android OS that you have rooted. If you are in fastboot mode, root is irrelevant.
How do I get “root”?
If you are booted into a custom recovery (recoveries will be covered later), root is enabled by default. If you want root while booted into Android, you will need to place two files on your system partition: an “su” binary which grants root access, and a superuser app that manages that access. The two that are available are ChainsDD’s Superuser and Chainfire’s SuperSU. Usually these files are packaged up in a zip file that is flashable using a custom recovery, but they can be flashed manually using ADB. Both of these methods will be described below.
If I unlock my bootloader, is that the same as root?
No, as was mentioned above, unlocking the bootloader allows you to (among a few other things) flash images easily to the device when not booted into the Android OS. Root allows you access to manipulate the files WITHIN the Android OS.
If I unlock my bootloader, does that mean that I have to root?
No.
If I unlock my bootloader, do I have to flash a custom ROM?
No.
Do I need to root to flash a ROM?
No.
What is a ROM?
A ROM is slang for an mobile OS build.
What are the different versions of Android, and is there a difference between say 4.2 and JOP40C?
Have a look at this link for an explanation of what (for example) JOP40C means, and what version of Android that is.
What is the difference between a stock ROM and a custom ROM?
A stock ROM is a ROM that is built by Google and is signed by Google’s platform keys. Everything else is a custom ROM.
What is this AOSP I keep hearing about?
AOSP stands for Android Open Source Project, and is a repository for the source code for Android. You can build your own ROM from AOSP. Details can be found on http://source.android.com/.
What is fastboot?
Fastboot can refer to three things: the actual interface between your PC and phone; the fastboot.exe file; or the “mode” of your device. For you to be able to use fastboot commands: your device has to be booted in fastboot mode, the fastboot driver for your PC needs to be installed, and the fastboot.exe file needs to be on your PC.
What are the fastboot commands?
The list of fastboot commands can be seen by typing “fastboot” (without the quotes) in a command prompt opened in the directory where you fastboot.exe file is located. See below.
Code:
fastboot
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
format <partition> format a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default: 2048
Along with these commands, there is an additional one: oem. For now, I will only cover the following commands: devices, flash, boot, erase, reboot, reboot-bootloader and oem.
These commands will work in fastboot mode, whether your bootloader is lock or unlocked:
oem: with a shipping bootloader (like what most of us have on our devices) there are two “oem” commands: “oem unlock” and “oem lock”. These commands are used to unlock and lock your bootloader, e.g., “fastboot oem unlock” will unlock your bootloader.
devices: this command checks to see if your device is properly connected to your PC in fastboot mode, e.g., “fastboot devices”
reboot: this command will reboot your device, e.g., “fastboot reboot”
reboot-bootloader: this command will reboot your device into fastboot mode, e.g., “fastboot reboot-bootloader”
These commands will only work in fastboot mode IFF your bootloader is unlocked:
flash: this command is used to flash images to partitions (partitions will be covered later) on your device. It cannot be used to “flash” individual files or .zips. For example, to flash the system partition, the command would be “fastboot flash system system.img”
boot: this command boots a kernel without flashing it to your device. For example, to boot an insecure kernel called “test.img”, the command would be “fastboot boot test.img”
erase: this command erases a specified partition. For example, to erase the cache partition, the command would be “fastboot erase cache”
The above mentioned commands are the basics for flashing your device. You should get familiar with them.
What is ADB?
ADB can refer to two things: the actual interface between your PC and phone, or the adb files (the .exe and two .dll files for Windows). For you to be able to use adb commands: the adb driver needs to be installed on your PC, the adb files need to be on your PC, and your device has to be booted either in recovery mode or booted normally into Android. Additionally, USB debugging needs to be enabled if booted into Android.
What are the ADB commands?
The list of ADB commands can be seen by typing “adb” (without the quotes) in a command prompt opened in the directory where your adb.exe file is located. See below.
Code:
Android Debug Bridge version 1.0.29
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
copkay has written up a great guide on the use of the “backup” and “restore” commands in this thread, so I will not cover those commands here.
For now, I will only cover the following commands: devices, reboot, reboot bootloader, push, pull and shell.
devices: this command checks to see if your device is properly connected to your PC in ADB mode, e.g., “adb devices”
reboot: this command will reboot your device, e.g., “adb reboot”
reboot-bootloader: this command will reboot your device into fastboot mode, e.g., “adb reboot bootloader”
push: this command copies a file (or directory) to your device from your PC. For example, say you wanted to copy to your /sdcard folder on your device a file called junk.jpg, which is stored on your PC in c:\. The command would be “adb push c:\junk.jpg /sdcard/” (assuming the folder is mounted – to be covered later). Petrovski80 has added more details on copying files to your device in his thread here.
pull: this command copies a file (or directory) to your PC from your device. For example, say you wanted to copy to your c:\ directory on your PC a file called junk.jpg, which is stored in the /sdcard folder on your device. The command would be “adb pull /sdcard/junk.jpg c:\” (assuming the folder is mounted – to be covered later).
shell: this command opens a “shell” to your device so you can issue commands directly to the Android OS. The command is “adb shell”. Your prompt will change to “$” which means that you are now issuing commands to Android, not to your PC. (At some point, I will try to put together a list of commonly used commands, but for anyone that has used Linux, they are essentially the same.)
What are the partitions on a the N4?
A Nexus 4 has the following partitions:
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
Source here.
What does mounting mean?
In order for a device to have access to files, the partition on which those files reside needs to be “mounted”. If you are in recovery, you can easily do this by going to the mounts menu and mounting the appropriate partition. If you are booted in Android, you will need to mount the partition yourself. The /sdcard folder is already mounted by default, however.
How do I mount the system partition?
In recovery: go to the mount menu and mount /system
In Android, on your device: you need root, and a file explorer with root access
In Android, connected via ADB (root required): you need to type the following command in a command prompt:
adb shell
su
mount -o remount,rw -t ext4 /dev/block/mmcblk0p21 /system
To explain this a bit:
-o remount,rw <== this remounts a partition that is already mounted (as read-only), as read-write
-t ext4 <== this specifies to mount it as ext4
/dev/block/mmcblk0p21 <== this is the system partition
/system <== this is what you are mounting it as
What is recovery?
Recovery is like a mini OS, which allows you to perform various functions, usually related to flashing files to your device, or updating files, or backing things up, etc. The stock image has a recovery included, but its functionality is very limited. There are a number of custom recoveries available, but the two most popular for the Nexus 4 are CWM and TWRP. There are various versions of each. More details to come in this section.
I see an Android lying on its back when I boot into recovery. Why?
What you see is the main screen of the Nexus stock recovery. To access the menu, you need to push and hold power and press volume up.
I just flashed CWM, but every time I try to boot into CWM, I keep seeing the stock recovery. Why?
If you updated your Android build using an OTA update file (either manually or over-the-air), the update placed two files on your device that re-flash the stock recovery every time you reboot your device. These two files are:
/system/etc/install-recovery.sh <== this is the script that installs the patch file
/system/recovery-from-boot.p <== this is the patch
You have to rename (or delete) one or both of them, then re-flash your custom recovery. Now it will stick.
What is an insecure boot image?
An insecure boot image is one that has root enabled for the shell user (i.e, ADB) by default on boot. This means that if you have booted or flashed an insecure image, when you connect your device to a computer, and open a shell via ADB, you will be userid 0 (or root) without having to "request" root access via the su binary. This makes somethings easier -- for example, you can now use the "remount" command in ADB to mount /system without having to type the full mount command in a shell. (More to add later.)
How do I root?
As was mentioned earlier, you need to place the su binary and the superuser app into the right spots on your device. In order to do this, you need to already have root access. There are two ways: flash a root package in recovery (instructions here), or manually place the files in the appropriate spots (I will add instructions on how to do this at a later time).
Useful Nexus 4 Guides and Reference Threads
Nexus 4 technical specifications: http://forum.xda-developers.com/showthread.php?t=1964850
Nexus 4 drivers: http://forum.xda-developers.com/showthread.php?t=1996051
How to back up your device using ADB – no root needed: http://forum.xda-developers.com/showthread.php?t=1420351
How to copy files to/from your device using ADB: http://forum.xda-developers.com/showthread.php?t=1869380
How to return your device to Google’s stock images: http://forum.xda-developers.com/showthread.php?t=2010312
How to root: http://forum.xda-developers.com/showthread.php?t=2010312
How to unlock your bootloader WITHOUT wiping (once you have root): http://forum.xda-developers.com/showthread.php?t=2063388
List of all OTA update files and links http://forum.xda-developers.com/showthread.php?t=1971169
Instructions on how to flash OTA updates: http://forum.xda-developers.com/showthread.php?t=2145848
List of all radios: http://forum.xda-developers.com/showthread.php?t=2087227
List of RILs: Coming soon.
List of bootloaders: Coming soon.
CWM recovery: http://www.clockworkmod.com/rommanager/
TWRP recovery: http://forum.xda-developers.com/showthread.php?t=2002326
Edify scripting: How to create recovery-flashable zips: http://forum.xda-developers.com/showthread.php?p=29735133
Information on bootloader security: http://forum.xda-developers.com/showthread.php?t=1898664
How to recovery deleted files: http://forum.xda-developers.com/showthread.php?p=34185439
How to nandroid directly to your computer: http://forum.xda-developers.com/showthread.php?t=1818321
Reserved.
Just to let you know, there's a mistake on " How to boot into the bootloader". It says to hold down vol+&vol- and press power, bit you only have to hold vol- and power.
Sent from my Nexus 4 using Tapatalk²
I think accessing bootloader mode is only by pressing volume down and the power key. I tried vol up + vol down + power key (the way you do it for the Galaxy Nexus) and it was a no go.
Maybe I'm just dumb, but on stock recovery, i get to the android with the triangle and hold vol up + power and my phone just turns off. What the heck am I doing wrong?
kcls said:
Just to let you know, there's a mistake on " How to boot into the bootloader". It says to hold down vol+&vol- and press power, bit you only have to hold vol- and power.
Click to expand...
Click to collapse
evaradar said:
I think accessing bootloader mode is only by pressing volume down and the power key. I tried vol up + vol down + power key (the way you do it for the Galaxy Nexus) and it was a no go.
Click to expand...
Click to collapse
Yeah, I caught it as well. Fixed.
Exidrion said:
Maybe I'm just dumb, but on stock recovery, i get to the android with the triangle and hold vol up + power and my phone just turns off. What the heck am I doing wrong?
Click to expand...
Click to collapse
You hold power and press volume up, not the other way around.
@efrant
Glad to see you again old buddy--
You were of tremendous help guiding me in my early N1 days and pushing me into learning the correct ways to do things sdk/adb/fastboot etc, not the shortcuts some were taking
I am sure many others have been helped also--
Don't think you were a Mod back then, so congrats on that also--
I am currently active in the One S Forum. But, follow the N4 and GN2 as one of them will be my next phone in the near future--
Ken
Amazing... There should be a thread like this on every Nexus device, or at least the most popular Nexi this days, it would be really helpful
efrant said:
What is fastboot?
Fastboot can refer to three things: the actual interface between your PC and phone; the fastboot.exe file; or the “mode” of your device. For you to be able to use fastboot commands: your device has to be booted in fastboot mode, the fastboot driver for your PC needs to be installed, and the fastboot.exe file needs to be on your PC.
Click to expand...
Click to collapse
Thanks man, thats a great guide...
Just one thing, Fastboot IS NOT exclusive for windows system, even for PC.
Cheers
d.terenzzo said:
Thanks man, thats a great guide...
Just one thing, Fastboot IS NOT exclusive for windows system, even for PC.
Cheers
Click to expand...
Click to collapse
You are right, it is for Windows, Linux and MacOS. I have a habit of using "PC" to mean "computer". I will adjust the wording in the first post.
this is very useful. thanks!
I have a question that wasn't answered in this FAQ. I was hoping someone could shed some light on the issue, then the OP could update the post to help others...
Basically, on my last Android phone my nandroid backups were all located on my SD card, under clockworkmod/backups. Now, they are located under mnt/shell/emulated.
I am new to emulated partitions and don't really get what is going on. I seem to be able to access various contents of my SD from the following directories:
mnt
sdcard
storage - which also has emulated and sdcard0 subfolders
The contents of these locations is not identical though! Could someone please explain what is actually going on?
Many thanks
1234568 said:
I have a question that wasn't answered in this FAQ. I was hoping someone could shed some light on the issue, then the OP could update the post to help others...
Basically, on my last Android phone my nandroid backups were all located on my SD card, under clockworkmod/backups. Now, they are located under mnt/shell/emulated.
I am new to emulated partitions and don't really get what is going on. I seem to be able to access various contents of my SD from the following directories:
mnt
sdcard
storage - which also has emulated and sdcard0 subfolders
The contents of these locations is not identical though! Could someone please explain what is actually going on?
Many thanks
Click to expand...
Click to collapse
This is new in Jelly Bean. Not sure why Google changed it. That said, they are all symlinks for compatibility with various apps. You data is actually stored in /data/media/0. This is your "sdcard" and the other locations should be pointing to that, so the contents of the "other locations" should be identical to that.
Sent from my Galaxy Nexus using Tapatalk 2
efrant said:
This is new in Jelly Bean. Not sure why Google changed it. That said, they are all symlinks for compatibility with various apps. You data is actually stored in /data/media/0. This is your "sdcard" and the other locations should be pointing to that, so the contents of the "other locations" should be identical to that.
Click to expand...
Click to collapse
Thanks for the answer. I will try and express my current understanding in a few statements. If any of it is wrong I would appreciate someone putting me correct.
The N4 has one large 16Gb drive.
On this drive is the data/media folder, which is preserved when full wiping, flashing roms, etc.
The /data/media/0 folder is meant to represent the SD card. Without root access this is all file explorers will see.
Instead of saving to data/media/0/clockworkmod/backup, CWM now backs up to data/media/clockworkmod/backup. This is why you need a root file explorer to see the backups.
The 'SD card', 'mnt' and 'storage' folders are all symlinks to /data/media.
Assuming all that is correct how, how would an unrooted user delete folders from data/media, other than data/media/0.
Also, will it be possible for CWM to change their backup directory to what it has always been?
1234568 said:
Thanks for the answer. I will try and express my current understanding in a few statements. If any of it is wrong I would appreciate someone putting me correct.
The N4 has one large 16Gb drive.
On this drive is the data/media folder, which is preserved when full wiping, flashing roms, etc.
The /data/media/0 folder is meant to represent the SD card. Without root access this is all file explorers will see.
Instead of saving to data/media/0/clockworkmod/backup, CWM now backs up to data/media/clockworkmod/backup. This is why you need a root file explorer to see the backups.
The 'SD card', 'mnt' and 'storage' folders are all symlinks to /data/media.
Assuming all that is correct how, how would an unrooted user delete folders from data/media, other than data/media/0.
Also, will it be possible for CWM to change their backup directory to what it has always been?
Click to expand...
Click to collapse
There are a few points that are not exactly correct in your post. I'll explain when I'm in front of a computer.
Sent from my Galaxy Nexus using Tapatalk 2
I came across this comment in another thread that answered one of my questions:
"I believe the location was changed because of the multiple users feature that has been incorporated into android.
If you go into storage you'll notice a folder called sdcard0. This is how android handles multiple users the next user would have a folder called sdcard1 and the next sdcard2 so forth and so on.
CWM had problems handling this so Koush changed the location to get around the problem."
1234568 said:
I came across this comment in another thread that answered one of my questions:
"I believe the location was changed because of the multiple users feature that has been incorporated into android.
If you go into storage you'll notice a folder called sdcard0. This is how android handles multiple users the next user would have a folder called sdcard1 and the next sdcard2 so forth and so on.
CWM had problems handling this so Koush changed the location to get around the problem."
Click to expand...
Click to collapse
That's pretty much correct, although I believe the actual folders are /data/media/0, /data/media/1, etc. Everything else is just symlinks.
Sent from my Galaxy Nexus using Tapatalk 2
Cool. And was everything else in my previous post correct then? Just trying to puzzle out exactly how this all works. Thanks for giving your time for this one on one teaching!
1234568 said:
Cool. And was everything else in my previous post correct then? Just trying to puzzle out exactly how this all works. Thanks for giving your time for this one on one teaching!
Click to expand...
Click to collapse
The other thing that wasn't quite correct is that data/media is NOT preserved when doing a wipe if you are using the stock recovery, but is preserved if you are using a custom recovery like cwm or twrp.
Sent from my Galaxy Nexus using Tapatalk 2
Once i fgured out that i could not use adb shell su -c but had to drop su -c from the commands the entire update proccess took no more than 20 minutes (i did not back up my old rom etc with back up prob take 40 minutes to a hour)
Any ways here it is again thanks to seokhun for his original guide i only modded the adb shell commands in this one.
Also thanks to every one who answered questions regarding this mess. Even answers that did not get it rerooted etc helped to find the answers that got this thing back to usable.
word to the wise do not buy display units or "refurbs" from bestbuy good chance a scammer returned it after adding insurance etc you will be left with something you can do nothing with in most cases. This type of scammy nonsense is very common here in northeast ohio at the very least
Taken from forums here most if not all from seokhun's guide "[REF] Installing Kindle Fire HD 8.9" 2nd-Bootloader + TWRP Complete Tutorial"
located http://forum.xda-developers.com/showthread.php?t=2277105
again i had to remove su -c from the adb commands and that was really the only change. They may work on some if not most other kindle fire hd 8.9 with 8.4.9 software update
First step you need to enable fastboot (kfhd 8.9) using kindle fire srt ver 2.1 (option 1) you can test fast boot if you like with getvar etc etc
What i did notice was the commands from the instructions i pulled from the forums here that included adb shell su -c would not work as wrote i had to remove the su -c at that point they worked flawlessly. If i can find all the sources for the instructions ill give props where props are do. So if any of you all who wrote the guids see your stuff please do take credit where do. I spent hours sifting the forums for various guids etc.
After enabling fastboot go ahead and root with Root_with_Restore_by_Bin4ry option 1 your kfhd 8.9 with 8.4.9 is going to run stupid slow and painfully. Do not worry it works fine through adb and fastboot commands just dont freak out when it runs dead snail slow.
1
Introducing: Kindle Fire 2nd-bootloader + TWRP 2.7.0.0 for the Kindle Fire HD
8.9
*** USE AT YOUR OWN RISK! WHILE I TRY MY BEST TO PROVIDE WORKING KERNELS/ROMS,
I AM NOT RESPONSIBLE IF THIS SOFTWARE OR ANYTHING I'VE WORKED ON SUDDENLY FRIES
YOUR DEVICE. ***
** THESE FILES WILL ONLY WORK ON A KINDLE FIRE HD 8.9. DO NOT ATTEMPT TO USE
THESE FILES ON ANY OTHER DEVICE. **
** WHEN MODDING THE KFIRE HD YOU SHOULD HAVE WORKING FASTBOOT DRIVERS ON YOUR
PC. **
FASTBOOT CABLES ARE NOT REQUIRED FOR USING FASTBOOT MODE ON THE KINDLE FIRE HD
8.9.
DOWNLOAD THE ANDROID SDK AND GO FROM THERE.
POSSIBLE ALSO THAT USING A FASTBOOT CABLE ON THE 8.9 WILL CAUSE DAMAGE.
http://developer.android.com/sdk/index.html
MAC USERS: USEFUL LINKS
http://forum.xda-developers.com/show...&postcount=230
Q: How do I know if my fastboot works?
A: With the Kindle powered down, type the following command into a cmd/terminal
window on your PC (should return with: < waiting for device> ):
fastboot -i 0x1949 getvar product
Then connect USB to the Kindle and reboot. It *SHOULD* show a Fastboot screen
and your terminal window should show something like:
product: Jem-PVT-Prod-04
Type this to reboot out of fastboot mode:
fastboot -i 0x1949 reboot
** IF YOU HAVE QUESTIONS, RE-READ THROUGH THE THREAD FOR ANSWERS. WHEN YOU'RE
ABSOLUTELY SURE NO ONE HAS ASKED YOUR QUESTION, GO AHEAD AND RE-READ THE THREAD
AGAIN AND USE THE SEARCH FEATURE. THEN POST YOUR QUESTION IF YOU STILL CAN'T
FIND THE ANSWER **
INSTRUCTIONS FOR INSTALLING A 2ND-BOOTLOADER TO LOAD CUSTOM KERNELS / ROMS /
RECOVERY:
*** BE SURE YOU HAVE A GOOD CHARGE ON THE DEVICE ***
STEP 1. Backup your stock partitions to your own HD for later if you need
disaster recovery:
Code:
adb shell "dd if=/dev/block/mmcblk0boot0 of=/sdcard/boot0block.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/boot
of=/sdcard/stock-boot.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/recovery
of=/sdcard/stock-recovery.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/system
of=/sdcard/stock-system.img" # This will take a few minutes
adb pull /sdcard/boot0block.img
adb pull /sdcard/stock-boot.img
adb pull /sdcard/stock-recovery.img
adb pull /sdcard/stock-system.img # This will take a few minutes
Take those files and put them somewhere safe.
**** MAC USERS MAY NEED TO SPARSE THE FILES FOR RE-FLASHING TO THE DEVICE. I
NEED A MAC USER TO PROBABLY WORK THROUGH THAT PROCESS AND I CAN POST BACKUP
COPIES OF THE STOCK PARTITIONS FOR DISASTER RECOVERY ****
STEP 2: Download the files you will need to install 2nd-bootloader, TWRP and
CM11.0:
Stack override file: http://goo.im/devs/Hashcode/jem/stack
[12/09] kfhd8-freedom-boot-8.4.6.img (USED ONLY THE FIRST TIME -- .zip files
will have their own boot.img's from now on):
Mirror 1: Download (Goo.im)
md5sum: 8374cf88e75abda8c374044a1f0daa5f
[04/16] TWRP Recovery 2.7.0.0:
Mirror 1: Download (Goo.im)
md5sum: a0c7533fd853849184850580350abd18
CM-11.0 for the Kindle Fire HD 8.9 (choose the latest version from):
Mirror 1: Browse (Goo.im)
Google Apps from:
http://www.androidfilehost.com/?fid=23311191640114013 (This version for CM-
11.0!)
Download the older 8.1.4 bootloader file and flash to your device via fastboot:
Mirror 1: Download (Goo.im)
md5sum a56f24c0c01aaea4bf408bc710faadaa
(You SHOULD check this before using fastboot -- downloads CAN be corrupted)
Place the CM-11.0 ROM and the gapps .zip on your device in the /sdcard area
STEP 3. Install the stack override in /system:
ADB commands entered while booted up into STOCK *rooted* Amazon Kindle OS --
May need to enable ADB debugging in Settings:
[2013-08-21] edited the location where stack is placed on device due to
permissions changes
Code:
adb push stack /sdcard/
adb shell "dd if=/sdcard/stack
of=/dev/block/platform/omap/omap_hsmmc.1/by-name/system bs=6519488 seek=1"
STEP 4. Stop the auto recovery update script (this file may or may not be
present):
Code:
adb shell "mount -o remount,rw ext4 /system"
adb shell "mv /system/etc/install-recovery.sh /system/etc/install-
recovery.sh.bak"
adb shell "mount -o remount,ro ext4 /system"
STEP 5:
[ With the device powered off: Issue the following commands into your
command/terminal window on your PC. Start with the first command and press
enter. Then connect USB to the Kindle and power on ]
Code:
fastboot -i 0x1949 flash bootloader kfhd8-u-boot-prod-8.1.4.bin
fastboot -i 0x1949 flash boot kfhd8-freedom-boot-8.4.6.img
fastboot -i 0x1949 flash recovery kfhd8-twrp-2.7.0.0-recovery.img
fastboot -i 0x1949 reboot
*DONT RE-FLASH FREEDOM-BOOT.IMG LATER AFTER FLASHING CM11.0 -- IT'S FOR STOCK
AMAZON OS ONLY / FIRST INSTALL ONLY*
** If everything was done correctly your Kindle will reboot and you will at
first see the normal Kindle Fire ORANGE logo and then it will fade and come
back as a BLUE logo. **
TO ENTER RECOVERY:
Press the left volume button (volume up) while the logo is still YELLOW and
keep pressing until the logo turns BLUE. Wait a moment and you should enter
recovery.
STEP 6:
CM-11.0 AND GAPPS INSTALLATION:
(OPTIONAL) Make a backup by selecting "Backup" and then slide your finger to
the right on the "Swipe to Back Up"
Once complete use the pentagon "Home" icon in the upper right corner of the
screen (next to the back arrow and terminal icon)
Now, select "Wipe"
Swipe the "Swipe to Factory Reset"
Use the "Home" icon
Select "Install"
Browse to the location on your device where you saved the CM-11.0 / GAPPS .ZIP
files
Select the CM11.0 .ZIP file in the list by touching it, then confirm it says
the name of the CM-11.0 .ZIP file on the next screen under "File to flash:"
Select "Add More Zips"
Select the GAPPS .ZIP file in the list by touching it -- make sure it says the
name of the .ZIP again under "File to flash:"
Swipe the "Swipe to Confirm Flash", and wait for it to finish.
If the screen is blank at any time you can hit the power button to "wake up"
the device
Once the flash is done, you'll see a "Home" and "Reboot" buttons at the bottom
of the screen
Select "Reboot"
CONGRATULATIONS YOU NOW HAVE THE ABILITY TO INSTALL CUSTOM KERNELS / RECOVERY
AND ROMS.
Nanaki-seto said:
Once i fgured out that i could not use adb shell su -c but had to drop su -c from the commands the entire update proccess took no more than 20 minutes (i did not back up my old rom etc with back up prob take 40 minutes to a hour)
Any ways here it is again thanks to seokhun for his original guide i only modded the adb shell commands in this one.
Also thanks to every one who answered questions regarding this mess. Even answers that did not get it rerooted etc helped to find the answers that got this thing back to usable.
word to the wise do not buy display units or "refurbs" from bestbuy good chance a scammer returned it after adding insurance etc you will be left with something you can do nothing with in most cases. This type of scammy nonsense is very common here in northeast ohio at the very least
Taken from forums here most if not all from seokhun's guide "[REF] Installing Kindle Fire HD 8.9" 2nd-Bootloader + TWRP Complete Tutorial"
located http://forum.xda-developers.com/showthread.php?t=2277105
again i had to remove su -c from the adb commands and that was really the only change. They may work on some if not most other kindle fire hd 8.9 with 8.4.9 software update
First step you need to enable fastboot (kfhd 8.9) using kindle fire srt ver 2.1 (option 1) you can test fast boot if you like with getvar etc etc
What i did notice was the commands from the instructions i pulled from the forums here that included adb shell su -c would not work as wrote i had to remove the su -c at that point they worked flawlessly. If i can find all the sources for the instructions ill give props where props are do. So if any of you all who wrote the guids see your stuff please do take credit where do. I spent hours sifting the forums for various guids etc.
After enabling fastboot go ahead and root with Root_with_Restore_by_Bin4ry option 1 your kfhd 8.9 with 8.4.9 is going to run stupid slow and painfully. Do not worry it works fine through adb and fastboot commands just dont freak out when it runs dead snail slow.
1
Introducing: Kindle Fire 2nd-bootloader + TWRP 2.7.0.0 for the Kindle Fire HD
8.9
*** USE AT YOUR OWN RISK! WHILE I TRY MY BEST TO PROVIDE WORKING KERNELS/ROMS,
I AM NOT RESPONSIBLE IF THIS SOFTWARE OR ANYTHING I'VE WORKED ON SUDDENLY FRIES
YOUR DEVICE. ***
** THESE FILES WILL ONLY WORK ON A KINDLE FIRE HD 8.9. DO NOT ATTEMPT TO USE
THESE FILES ON ANY OTHER DEVICE. **
** WHEN MODDING THE KFIRE HD YOU SHOULD HAVE WORKING FASTBOOT DRIVERS ON YOUR
PC. **
FASTBOOT CABLES ARE NOT REQUIRED FOR USING FASTBOOT MODE ON THE KINDLE FIRE HD
8.9.
DOWNLOAD THE ANDROID SDK AND GO FROM THERE.
POSSIBLE ALSO THAT USING A FASTBOOT CABLE ON THE 8.9 WILL CAUSE DAMAGE.
http://developer.android.com/sdk/index.html
MAC USERS: USEFUL LINKS
http://forum.xda-developers.com/show...&postcount=230
Q: How do I know if my fastboot works?
A: With the Kindle powered down, type the following command into a cmd/terminal
window on your PC (should return with: < waiting for device> ):
fastboot -i 0x1949 getvar product
Then connect USB to the Kindle and reboot. It *SHOULD* show a Fastboot screen
and your terminal window should show something like:
product: Jem-PVT-Prod-04
Type this to reboot out of fastboot mode:
fastboot -i 0x1949 reboot
** IF YOU HAVE QUESTIONS, RE-READ THROUGH THE THREAD FOR ANSWERS. WHEN YOU'RE
ABSOLUTELY SURE NO ONE HAS ASKED YOUR QUESTION, GO AHEAD AND RE-READ THE THREAD
AGAIN AND USE THE SEARCH FEATURE. THEN POST YOUR QUESTION IF YOU STILL CAN'T
FIND THE ANSWER **
INSTRUCTIONS FOR INSTALLING A 2ND-BOOTLOADER TO LOAD CUSTOM KERNELS / ROMS /
RECOVERY:
*** BE SURE YOU HAVE A GOOD CHARGE ON THE DEVICE ***
STEP 1. Backup your stock partitions to your own HD for later if you need
disaster recovery:
Code:
adb shell "dd if=/dev/block/mmcblk0boot0 of=/sdcard/boot0block.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/boot
of=/sdcard/stock-boot.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/recovery
of=/sdcard/stock-recovery.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/system
of=/sdcard/stock-system.img" # This will take a few minutes
adb pull /sdcard/boot0block.img
adb pull /sdcard/stock-boot.img
adb pull /sdcard/stock-recovery.img
adb pull /sdcard/stock-system.img # This will take a few minutes
Take those files and put them somewhere safe.
**** MAC USERS MAY NEED TO SPARSE THE FILES FOR RE-FLASHING TO THE DEVICE. I
NEED A MAC USER TO PROBABLY WORK THROUGH THAT PROCESS AND I CAN POST BACKUP
COPIES OF THE STOCK PARTITIONS FOR DISASTER RECOVERY ****
STEP 2: Download the files you will need to install 2nd-bootloader, TWRP and
CM11.0:
Stack override file: http://goo.im/devs/Hashcode/jem/stack
[12/09] kfhd8-freedom-boot-8.4.6.img (USED ONLY THE FIRST TIME -- .zip files
will have their own boot.img's from now on):
Mirror 1: Download (Goo.im)
md5sum: 8374cf88e75abda8c374044a1f0daa5f
[04/16] TWRP Recovery 2.7.0.0:
Mirror 1: Download (Goo.im)
md5sum: a0c7533fd853849184850580350abd18
CM-11.0 for the Kindle Fire HD 8.9 (choose the latest version from):
Mirror 1: Browse (Goo.im)
Google Apps from:
http://www.androidfilehost.com/?fid=23311191640114013 (This version for CM-
11.0!)
Download the older 8.1.4 bootloader file and flash to your device via fastboot:
Mirror 1: Download (Goo.im)
md5sum a56f24c0c01aaea4bf408bc710faadaa
(You SHOULD check this before using fastboot -- downloads CAN be corrupted)
Place the CM-11.0 ROM and the gapps .zip on your device in the /sdcard area
STEP 3. Install the stack override in /system:
ADB commands entered while booted up into STOCK *rooted* Amazon Kindle OS --
May need to enable ADB debugging in Settings:
[2013-08-21] edited the location where stack is placed on device due to
permissions changes
Code:
adb push stack /sdcard/
adb shell "dd if=/sdcard/stack
of=/dev/block/platform/omap/omap_hsmmc.1/by-name/system bs=6519488 seek=1"
STEP 4. Stop the auto recovery update script (this file may or may not be
present):
Code:
adb shell "mount -o remount,rw ext4 /system"
adb shell "mv /system/etc/install-recovery.sh /system/etc/install-
recovery.sh.bak"
adb shell "mount -o remount,ro ext4 /system"
STEP 5:
[ With the device powered off: Issue the following commands into your
command/terminal window on your PC. Start with the first command and press
enter. Then connect USB to the Kindle and power on ]
Code:
fastboot -i 0x1949 flash bootloader kfhd8-u-boot-prod-8.1.4.bin
fastboot -i 0x1949 flash boot kfhd8-freedom-boot-8.4.6.img
fastboot -i 0x1949 flash recovery kfhd8-twrp-2.7.0.0-recovery.img
fastboot -i 0x1949 reboot
*DONT RE-FLASH FREEDOM-BOOT.IMG LATER AFTER FLASHING CM11.0 -- IT'S FOR STOCK
AMAZON OS ONLY / FIRST INSTALL ONLY*
** If everything was done correctly your Kindle will reboot and you will at
first see the normal Kindle Fire ORANGE logo and then it will fade and come
back as a BLUE logo. **
TO ENTER RECOVERY:
Press the left volume button (volume up) while the logo is still YELLOW and
keep pressing until the logo turns BLUE. Wait a moment and you should enter
recovery.
STEP 6:
CM-11.0 AND GAPPS INSTALLATION:
(OPTIONAL) Make a backup by selecting "Backup" and then slide your finger to
the right on the "Swipe to Back Up"
Once complete use the pentagon "Home" icon in the upper right corner of the
screen (next to the back arrow and terminal icon)
Now, select "Wipe"
Swipe the "Swipe to Factory Reset"
Use the "Home" icon
Select "Install"
Browse to the location on your device where you saved the CM-11.0 / GAPPS .ZIP
files
Select the CM11.0 .ZIP file in the list by touching it, then confirm it says
the name of the CM-11.0 .ZIP file on the next screen under "File to flash:"
Select "Add More Zips"
Select the GAPPS .ZIP file in the list by touching it -- make sure it says the
name of the .ZIP again under "File to flash:"
Swipe the "Swipe to Confirm Flash", and wait for it to finish.
If the screen is blank at any time you can hit the power button to "wake up"
the device
Once the flash is done, you'll see a "Home" and "Reboot" buttons at the bottom
of the screen
Select "Reboot"
CONGRATULATIONS YOU NOW HAVE THE ABILITY TO INSTALL CUSTOM KERNELS / RECOVERY
AND ROMS.
Click to expand...
Click to collapse
Any update to this? Like for lineage 0s? and twrp 3.02????
Nanaki-seto said:
Once i fgured out that i could not use adb shell su -c but had to drop su -c from the commands the entire update proccess took no more than 20 minutes (i did not back up my old rom etc with back up prob take 40 minutes to a hour)
Any ways here it is again thanks to seokhun for his original guide i only modded the adb shell commands in this one.
Also thanks to every one who answered questions regarding this mess. Even answers that did not get it rerooted etc helped to find the answers that got this thing back to usable.
word to the wise do not buy display units or "refurbs" from bestbuy good chance a scammer returned it after adding insurance etc you will be left with something you can do nothing with in most cases. This type of scammy nonsense is very common here in northeast ohio at the very least
Taken from forums here most if not all from seokhun's guide "[REF] Installing Kindle Fire HD 8.9" 2nd-Bootloader + TWRP Complete Tutorial"
located http://forum.xda-developers.com/showthread.php?t=2277105
again i had to remove su -c from the adb commands and that was really the only change. They may work on some if not most other kindle fire hd 8.9 with 8.4.9 software update
First step you need to enable fastboot (kfhd 8.9) using kindle fire srt ver 2.1 (option 1) you can test fast boot if you like with getvar etc etc
What i did notice was the commands from the instructions i pulled from the forums here that included adb shell su -c would not work as wrote i had to remove the su -c at that point they worked flawlessly. If i can find all the sources for the instructions ill give props where props are do. So if any of you all who wrote the guids see your stuff please do take credit where do. I spent hours sifting the forums for various guids etc.
After enabling fastboot go ahead and root with Root_with_Restore_by_Bin4ry option 1 your kfhd 8.9 with 8.4.9 is going to run stupid slow and painfully. Do not worry it works fine through adb and fastboot commands just dont freak out when it runs dead snail slow.
1
Introducing: Kindle Fire 2nd-bootloader + TWRP 2.7.0.0 for the Kindle Fire HD
8.9
*** USE AT YOUR OWN RISK! WHILE I TRY MY BEST TO PROVIDE WORKING KERNELS/ROMS,
I AM NOT RESPONSIBLE IF THIS SOFTWARE OR ANYTHING I'VE WORKED ON SUDDENLY FRIES
YOUR DEVICE. ***
** THESE FILES WILL ONLY WORK ON A KINDLE FIRE HD 8.9. DO NOT ATTEMPT TO USE
THESE FILES ON ANY OTHER DEVICE. **
** WHEN MODDING THE KFIRE HD YOU SHOULD HAVE WORKING FASTBOOT DRIVERS ON YOUR
PC. **
FASTBOOT CABLES ARE NOT REQUIRED FOR USING FASTBOOT MODE ON THE KINDLE FIRE HD
8.9.
DOWNLOAD THE ANDROID SDK AND GO FROM THERE.
POSSIBLE ALSO THAT USING A FASTBOOT CABLE ON THE 8.9 WILL CAUSE DAMAGE.
http://developer.android.com/sdk/index.html
MAC USERS: USEFUL LINKS
http://forum.xda-developers.com/show...&postcount=230
Q: How do I know if my fastboot works?
A: With the Kindle powered down, type the following command into a cmd/terminal
window on your PC (should return with: < waiting for device> ):
fastboot -i 0x1949 getvar product
Then connect USB to the Kindle and reboot. It *SHOULD* show a Fastboot screen
and your terminal window should show something like:
product: Jem-PVT-Prod-04
Type this to reboot out of fastboot mode:
fastboot -i 0x1949 reboot
** IF YOU HAVE QUESTIONS, RE-READ THROUGH THE THREAD FOR ANSWERS. WHEN YOU'RE
ABSOLUTELY SURE NO ONE HAS ASKED YOUR QUESTION, GO AHEAD AND RE-READ THE THREAD
AGAIN AND USE THE SEARCH FEATURE. THEN POST YOUR QUESTION IF YOU STILL CAN'T
FIND THE ANSWER **
INSTRUCTIONS FOR INSTALLING A 2ND-BOOTLOADER TO LOAD CUSTOM KERNELS / ROMS /
RECOVERY:
*** BE SURE YOU HAVE A GOOD CHARGE ON THE DEVICE ***
STEP 1. Backup your stock partitions to your own HD for later if you need
disaster recovery:
Code:
adb shell "dd if=/dev/block/mmcblk0boot0 of=/sdcard/boot0block.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/boot
of=/sdcard/stock-boot.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/recovery
of=/sdcard/stock-recovery.img"
adb shell "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/system
of=/sdcard/stock-system.img" # This will take a few minutes
adb pull /sdcard/boot0block.img
adb pull /sdcard/stock-boot.img
adb pull /sdcard/stock-recovery.img
adb pull /sdcard/stock-system.img # This will take a few minutes
Take those files and put them somewhere safe.
**** MAC USERS MAY NEED TO SPARSE THE FILES FOR RE-FLASHING TO THE DEVICE. I
NEED A MAC USER TO PROBABLY WORK THROUGH THAT PROCESS AND I CAN POST BACKUP
COPIES OF THE STOCK PARTITIONS FOR DISASTER RECOVERY ****
STEP 2: Download the files you will need to install 2nd-bootloader, TWRP and
CM11.0:
Stack override file: http://goo.im/devs/Hashcode/jem/stack
[12/09] kfhd8-freedom-boot-8.4.6.img (USED ONLY THE FIRST TIME -- .zip files
will have their own boot.img's from now on):
Mirror 1: Download (Goo.im)
md5sum: 8374cf88e75abda8c374044a1f0daa5f
[04/16] TWRP Recovery 2.7.0.0:
Mirror 1: Download (Goo.im)
md5sum: a0c7533fd853849184850580350abd18
CM-11.0 for the Kindle Fire HD 8.9 (choose the latest version from):
Mirror 1: Browse (Goo.im)
Google Apps from:
http://www.androidfilehost.com/?fid=23311191640114013 (This version for CM-
11.0!)
Download the older 8.1.4 bootloader file and flash to your device via fastboot:
Mirror 1: Download (Goo.im)
md5sum a56f24c0c01aaea4bf408bc710faadaa
(You SHOULD check this before using fastboot -- downloads CAN be corrupted)
Place the CM-11.0 ROM and the gapps .zip on your device in the /sdcard area
STEP 3. Install the stack override in /system:
ADB commands entered while booted up into STOCK *rooted* Amazon Kindle OS --
May need to enable ADB debugging in Settings:
[2013-08-21] edited the location where stack is placed on device due to
permissions changes
Code:
adb push stack /sdcard/
adb shell "dd if=/sdcard/stack
of=/dev/block/platform/omap/omap_hsmmc.1/by-name/system bs=6519488 seek=1"
STEP 4. Stop the auto recovery update script (this file may or may not be
present):
Code:
adb shell "mount -o remount,rw ext4 /system"
adb shell "mv /system/etc/install-recovery.sh /system/etc/install-
recovery.sh.bak"
adb shell "mount -o remount,ro ext4 /system"
STEP 5:
[ With the device powered off: Issue the following commands into your
command/terminal window on your PC. Start with the first command and press
enter. Then connect USB to the Kindle and power on ]
Code:
fastboot -i 0x1949 flash bootloader kfhd8-u-boot-prod-8.1.4.bin
fastboot -i 0x1949 flash boot kfhd8-freedom-boot-8.4.6.img
fastboot -i 0x1949 flash recovery kfhd8-twrp-2.7.0.0-recovery.img
fastboot -i 0x1949 reboot
*DONT RE-FLASH FREEDOM-BOOT.IMG LATER AFTER FLASHING CM11.0 -- IT'S FOR STOCK
AMAZON OS ONLY / FIRST INSTALL ONLY*
** If everything was done correctly your Kindle will reboot and you will at
first see the normal Kindle Fire ORANGE logo and then it will fade and come
back as a BLUE logo. **
TO ENTER RECOVERY:
Press the left volume button (volume up) while the logo is still YELLOW and
keep pressing until the logo turns BLUE. Wait a moment and you should enter
recovery.
STEP 6:
CM-11.0 AND GAPPS INSTALLATION:
(OPTIONAL) Make a backup by selecting "Backup" and then slide your finger to
the right on the "Swipe to Back Up"
Once complete use the pentagon "Home" icon in the upper right corner of the
screen (next to the back arrow and terminal icon)
Now, select "Wipe"
Swipe the "Swipe to Factory Reset"
Use the "Home" icon
Select "Install"
Browse to the location on your device where you saved the CM-11.0 / GAPPS .ZIP
files
Select the CM11.0 .ZIP file in the list by touching it, then confirm it says
the name of the CM-11.0 .ZIP file on the next screen under "File to flash:"
Select "Add More Zips"
Select the GAPPS .ZIP file in the list by touching it -- make sure it says the
name of the .ZIP again under "File to flash:"
Swipe the "Swipe to Confirm Flash", and wait for it to finish.
If the screen is blank at any time you can hit the power button to "wake up"
the device
Once the flash is done, you'll see a "Home" and "Reboot" buttons at the bottom
of the screen
Select "Reboot"
CONGRATULATIONS YOU NOW HAVE THE ABILITY TO INSTALL CUSTOM KERNELS / RECOVERY
AND ROMS.
Click to expand...
Click to collapse
That don't work, followed step 5 to a T. Just stuck the tablet at kindle logo.
READ THIIS!
*this thread is for desire 510. it will NOT work on m7,or any older device. please check the general forum for your particular device for a similar thread.
this thread will let you unlock your bootloader without htcdev,or let you change your hboot watermark from relocked or unlocked back to stock.
advantages
-no hassle with htcdev,tokens,or unlock codes
-no submitting your phones personal info to htc
-the ability to get back to 100% stock without any visual traces or records of having been s off or unlocking your bootloader.
*you must be s off.
*you must have superuser installed
read this:
this will not work if your s on. its not a way to magically unlock
the usual disclaimers:
use this info at your own risk. if it melts your phone into a little pile of plastic goo,its not my fault.
credits
-beaups for schooling me on echo comand protocol
-strace for originally discovering the location of the lock status flag(check out this thread for more info)
*i have tested this on my gsm cricket desire 510 variant(a11_ul). let me know if you try it on a different variant,or if youd like to dump partitions and have me take a look
IF you are an advanced user with adb/fastboot set up and some basic knowlede of the cmd window,you can skip to #2
1)set up adb(windows 7 and older)
-download this file
-install drivers: if you have htc sync installed,you should allready have drivers. if not,you can install htc sync,or install these modified htc drivers from revolutionary (driver mirror)
-unzip your miniadb_v1031.zip file. this is native funtionality in windows 7. you otherwise may need a utility such as "7-zip" to extract,or unzip it. place the unzipped folder onto the root of your C drive on your PC. root means the top level,not inside any folders. so just copy and paste,or drag and drop the folder onto C with everything else that is there. you may want to rename it to "miniadb_m7" since youll be putting some device specific files in here.
-open a command window. on windows 7,click the start bubble in the lower left and type "command" in the search box. xp i believe is similar or the same. doing this should open a small black command window.
-change to your miniadb_m7 directory. type the following at the prompt in your cmd window:
cd c:\miniadb_m7
your command promt should change to "c:miniadb_m7>" provided you: 1)unzipped the miniadb_v1031 zip file,and 2)put the folder on your c drive,and 3)entered the name of the folder correctly ("miniadb_m7" in this case)
-now make sure usb debugging is checked in developer options(you will need to turn it on first),and plug your phone into your PC with a usb cable
-make sure your phone is being recognized- type:
adb devices
if your drivers are installed correctly,this should return your phones serial number. you should hear the "found device" noises when you plug your phone in. if it starts installing drivers,wait for it to finish before typing the adb devices command.
if you get your serial number back,then enter this command:
adb reboot bootloader
this should take your phone to the "fastboot" screen,wich is white with colored letters. this is one mode of your bootloaders interactive modes. at the top youll see fastboot devices as confirmation youre in fastboot.
now enter:
fastboot devices
again,this should return your phones serial number. you should hear the "found device" noises when you plug your phone in. if it starts installing drivers,wait for it to finish before typing the adb devices command.
if you get your serial number back,you can enter the following to boot back to the phones OS:
fastboot reboot
and now,youve installed adb/fastboot and tested youre phones drivers. if at either spot,you have trouble and dont get your serial number back,there is some sort of connection issue. use these steps to troubleshoot:
troubleshooting connectivity issues:
-try a reboot of the PC
-try different usb cables and ports
-dont use a usb hub
-dont use usb 3.0
-make sure nothing capable of comunicating with the phone is enabled and running. htc sync,pdanet,easy tether,and even itunes have all been known to cause issues.
-windows 8 has been known to have issues. try a windows 7 or older machine
failing the above,
-i use these drivers for fastboot and adb(donwload and run as admin): http://downloads.unrevoked.com/HTCDriver3.0.0.007.exe (mirror)
failing that,try manually updating the drivers in the following manner:
-put the phone in fastboot mode(select fastboot from the hboot menu)
-open device manager on the PC
-plug in phone,watch for it to pop up in device manager.
-update drivers with device manager,pointing the wizard to the extracted
driver download folder from above
note that you can check the connectivity of the phone,and make sure drivers are working by in the following manner:
-open cmd window. change to directory containing adb/fastboot utilities
-adb with the phone in the booted OS,usb debug enabled,enter:
adb devices in a cmd window
-fastboot with phone in fastboot,enter:
fastboot devices in cmd window
in either case,a properly connected phone with working drivers installed should report back the phones serial number.
Click to expand...
Click to collapse
this process,in your cmd window,should look something like this:
Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Scott>[COLOR="red"]cd c:\miniadb_m7[/COLOR]
c:\miniadb_m7>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
FAxxxxxxxxxx device
c:\miniadb_m7>[COLOR="red"]adb reboot bootloader[/COLOR]
c:\miniadb_m7>[COLOR="red"]fastboot devices[/COLOR]
FAxxxxxxxxxx fastboot
c:\miniadb_m7>[COLOR="red"]fastboot reboot[/COLOR]
rebooting...
finished. total time: 0.037s
c:\miniadb_m7>
2)reset your "lock status flag"
to LOCK your bootloader,enter the following:
adb devices
adb shell
su (if needed to get a # prompt)
echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
(i would very strongly recomend you copy/paste this)
exit
(exit a second time if you need to to get back to a normal > prompt)
adb reboot bootloader
verify you are now locked
_____________________________________________________________________________________________
to UNLOCK your bootloader,enter the following:
adb devices
adb shell
su (if needed to get a # prompt)
echo -ne "HTCU" | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
(i would very strongly recomend you copy/paste this)
exit
(exit a second time if you need to to get back to a normal > prompt)
adb reboot bootloader
verify you are now unlocked
other useful threads:
remove your tampered banner: http://forum.xda-developers.com/desire-510/general/how-to-remove-tampered-banner-t3179866
mine too