Installing Recovery for Amazon Kindle Fire

Root Device and Install Custom Bootloader

1. Root the device (http://rootkindlefire.com/category/kindle-fire-root/) and install the FireFireFire custom bootloader (http://forum.xda-developers.com/showthread.php?p=23492717). FireFireFire will enable easy booting to recovery.

Download Recovery Image

2. Download a suitable recovery image (e.g. openrecovery-twrp-2.5.0.0-otter.img from http://techerrata.com/browse/twrp2/blaze/).

Boot to Fastboot

3. Change boot mode so that the device will boot to fastboot.

$ sudo ./adb shell
# idme bootmode 4002
<idme> write 4002 to offset 0x1000

4. Reboot device to enter fastboot.

Install Recovery

5. Flash device with the downloaded recovery image.

$ sudo ./fastboot -i 0x1949 flash recovery openrecovery-twrp-2.5.0.0-otter.img
sending 'recovery' (6144 KB)...
OKAY [  1.540s]
writing 'recovery'...
OKAY [  0.691s]
finished. total time: 2.231s

where openrecovery-twrp-2.5.0.0-otter.img is the downloaded image.

6. Change back the boot mode.

$ sudo ./fastboot -i 0x1949 oem idme bootmode 4000
...
OKAY [  0.080s]
finished. total time: 0.080s

Boot to Recovery

7. Reboot device. To boot to recovery, press the power button when the FireFireFire appears upon device start up.

References

[1] http://rootkindlefire.com/category/kindle-fire-root/
[2] http://forum.xda-developers.com/showthread.php?p=23492717
[3] http://techerrata.com/browse/twrp2/blaze/
[4] http://forum.xda-developers.com/showthread.php?t=1369405

Installing CyanogenMod 10.1 on HTC One X

Backup

1. Backup applications and settings using Titanium Backup, do a NANDroid backup in recovery, and/or do a manual backup of the sdcard partition.

Check and Upgrade Bootloader (HBOOT) Version

2. Check the bootloader version using adb.

$ sudo ./adb shell
shell@android:/ $ getprop ro.bootloader
1.27.0000
shell@android:/ $ exit

If the bootloader version number (1.27.0000 in this case) is lower than 1.28.0000, then it needs to be updated.

3. Check the device carrier ID using fastboot.

$ sudo ./fastboot oem readcid
...
(bootloader) DEBUG: cid: HTC__044
OKAY [  0.015s]
finished. total time: 0.015s

In this case, the carrier ID is HTC__044.

4. Download the firmware corresponding to the device carrier ID (HTC__044) from http://forum.xda-developers.com/showthread.php?t=1957376.

5. If the bootloader has previously been unlocked, it needs to be re-locked using fastboot.

$ sudo ./fastboot oem lock
...
(bootloader) Lock successfully...
OKAY [  0.143s]
finished. total time: 0.146s

6. Reboot the RUU using fastboot.

$ sudo ./fastboot oem rebootRUU
...
(bootloader) Save data from original MSC...
(bootloader) Save data from SIF...
(bootloader) Update partition data to SIF partition
(bootloader) offset = 0
(bootloader) Update partition data from original MSC...
(bootloader) offset = 0
(bootloader) [MSG] OKAY
OKAY [  0.210s]
finished. total time: 0.210s

7. Flash the device with the downloaded firmware using fastboot.

$ sudo ./fastboot flash zip firmware.zip
sending 'zip' (12875 KB)...
OKAY [  1.619s]
writing 'zip'...
(bootloader) adopting the signature contained in this image...
(bootloader) signature checking...
(bootloader) checking model ID...
(bootloader) checking custom ID...
(bootloader) checking main version...
(bootloader) checking hboot version...
(bootloader) start image[boot] unzipping & flushing...
(bootloader) Format partition LNX done
(bootloader) [RUU]WP,boot,100
(bootloader) start image[recovery] unzipping & flushing...
(bootloader) Format partition SOS done
(bootloader) [RUU]WP,recovery,100
(bootloader) ERASE backup cid
OKAY [  3.170s]
finished. total time: 4.790s

where firmware.zip is the downloaded firmware package.
IMPORTANT: If this step fails, repeat the command (to flash the device) IMMEDIATELY.

Unlock Bootloader

8. Unlock the bootloader using fastboot.

$ sudo ./fastboot flash unlocktoken Unlock_code.bin
sending 'unlocktoken' (0 KB)...
OKAY [  0.008s]
writing 'unlocktoken'...
(bootloader) unlock token check successfully
FAILED (status read failed (No such device))
finished. total time: 19.736s

where Unlock_code.bin is the unlock code from HTC. The bootloader is now unlocked again.

Install Recovery

9. Flash the device with the recovery image using fastboot.

$ sudo ./fastboot flash recovery recovery-clockwork-touch-5.8.4.0-endeavoru.img 
sending 'recovery' (5742 KB)...
OKAY [  0.731s]
writing 'recovery'...
(bootloader) Format partition SOS done
OKAY [  0.552s]
finished. total time: 1.283s

where recovery-clockwork-touch-5.8.4.0-endeavoru.img is the recovery image (in this case, ClockworkMod 5.8.4.0 for HTC One X).

Install CyanogenMod

10. Download the CyanogenMod package from http://download.cyanogenmod.org/?type=stable&device=endeavoru.

11. Flash the device with the boot image from the CyanogenMod package using fastboot.

$ sudo ./fastboot flash boot boot.img 
sending 'boot' (4960 KB)...
OKAY [  0.626s]
writing 'boot'...
(bootloader) Format partition LNX done
OKAY [  0.493s]
finished. total time: 1.119s

12. Boot into recovery and flash the device with the CyanogenMod package.

13. Restore the backups if necessary.

References

[1] http://wiki.cyanogenmod.org/w/Endeavoru_Info
[2] http://download.cyanogenmod.org/?type=stable&device=endeavoru
[3] http://forum.xda-developers.com/showpost.php?p=37930062&postcount=1161
[4] http://forum.xda-developers.com/showthread.php?t=1957376