Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[BOOTLOADER] 2nd-bootloader for Custom ROMs on KFireHD 8.9 [05/27 CM11/TWRP 2.7.x.x]

OP Hashcode

1st February 2013, 10:57 AM   |  #1  
Hashcode's Avatar
OP Recognized Developer
Thanks Meter: 22,511
 
3,233 posts
Join Date:Joined: Sep 2011
Donate to Me
More
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 su -c "dd if=/dev/block/mmcblk0boot0 of=/sdcard/boot0block.img"
adb shell su -c "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/boot of=/sdcard/stock-boot.img"
adb shell su -c "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/recovery of=/sdcard/stock-recovery.img"
adb shell su -c "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:
  1. Stack override file: http://goo.im/devs/Hashcode/jem/stack
  2. [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
  3. [04/16] TWRP Recovery 2.7.0.0:
    Mirror 1: Download (Goo.im)
    md5sum: a0c7533fd853849184850580350abd18
  4. CM-11.0 for the Kindle Fire HD 8.9 (choose the latest version from):
    Mirror 1: Browse (Goo.im)
  5. Google Apps from:
    http://www.androidfilehost.com/?fid=23311191640114013 (This version for CM-11.0!)
  6. 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 su -c "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 su -c "mount -o remount,rw ext4 /system"
adb shell su -c "mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak"
adb shell su -c "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.


FLASHING BACK TO STOCK:
** FIND THE FILES WE BACKED UP IN STEP #1: ** OR Follow this thread's instructions:
http://forum.xda-developers.com/show....php?t=2011126


**** 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 ****


Once you have these files (we'll name them boot.img/recovery.img and system.img for the purpose of these instructions, but they could be different on your system).

Plug in your fastboot cable and reboot so that you see the fastboot screen and enter the following commands:
Code:
fastboot -i 0x1949 flash boot boot.img
fastboot -i 0x1949 flash recovery recovery.img
fastboot -i 0x1949 flash system system.img # This one will take a few minutes
fastboot -i 0x1949 reboot

THANKS TO:
  • fattire for finding the original bootloader exploit
  • verygreen for doing some initial work on the 2nd-bootloader and fixing bugs (and letting me copy some of his bootloader installation instructions)
Attached Thumbnails
Click image for larger version

Name:	kfhd8-initlogo-new2-rotated.jpg
Views:	5442
Size:	6.5 KB
ID:	1695133  
Last edited by Hashcode; 28th May 2014 at 07:42 AM.
The Following 75 Users Say Thank You to Hashcode For This Useful Post: [ View ]
1st February 2013, 10:57 AM   |  #2  
Hashcode's Avatar
OP Recognized Developer
Thanks Meter: 22,511
 
3,233 posts
Join Date:Joined: Sep 2011
Donate to Me
More
RESERVED
The Following 7 Users Say Thank You to Hashcode For This Useful Post: [ View ]
1st February 2013, 03:53 PM   |  #3  
Member
Thanks Meter: 7
 
76 posts
Join Date:Joined: Aug 2008
Thumbs up
WOW.....
Finally.


Quote:
Originally Posted by Hashcode

*** 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 (UNTESTED ON THE LTE VERSION). DO NOT ATTEMPT TO USE THESE FILES ON ANY OTHER DEVICE. **

** WHEN MODDING THE KFIRE HD YOU SHOULD HAVE A WORKING FASTBOOT CABLE + FASTBOOT DRIVERS/ACCESS ON YOUR PC. **


Q: How do I know if my fastboot works?
A: Plug the cable into your device and then reboot the Kindle. It *SHOULD* show a Fastboot screen.

Once at the screen use this command on your computer:
fastboot devices

You should see something like this:
0123456789ABCDEF fastboot

Q: How is this different than the 2nd-bootloader from verygreen's thread?
A: Verygreen's 2nd-bootloader was more of a proof of concept and doesn't allow for button entry into recovery and may have issues booting from custom sized boot.imgs. I've been using this one for about a month during my CM10.1 development.


** 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 pull /dev/block/platform/omap/omap_hsmmc.1/by-name/boot
adb pull /dev/block/platform/omap/omap_hsmmc.1/by-name/recovery
adb pull /dev/block/platform/omap/omap_hsmmc.1/by-name/system # 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 CM10.1:
  1. Stack override file: http://goo.im/devs/Hashcode/jem/stack
  2. kfhd8-freedom-boot.img (USED ONLY THE FIRST TIME -- .zip files will have their own boot.img's from now on): http://goo.im/devs/Hashcode/jem/kfhd8-freedom-boot.img
  3. TWRP Recovery: http://goo.im/devs/Hashcode/jem/kfhd...0-recovery.img
  4. CM-10.1 for the Kindle Fire HD 8.9 (choose the latest version from): http://goo.im/devs/Hashcode/jem/cm10.1
  5. Google Apps from: http://goo.im/gapps (choose the top rom CM10.1 version)
Place the CM-10.1 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:
Code:
adb push stack /data/local/tmp/
adb shell su -c "dd if=/data/local/tmp/stack of=/dev/block/platform/omap/omap_hsmmc.1/by-name/system bs=6519488 seek=1"

STEP 4. Connect fastboot cable OR if you have fastboot drivers setup correctly you can use a standard USB cable to issue the following commands. Start with the first command and press enter. This will show <waiting for device> and then power on the Kindle. Once the fastboot screen is shown and the first command completes you can enter the rest of the commands.
*DONT RE-FLASH FREEDOM-BOOT.IMG LATER AFTER FLASHING CM10.1 -- IT'S FOR STOCK AMAZON OS ONLY / FIRST INSTALL ONLY*
Code:
fastboot -i 0x1949 flash boot kfhd8-freedom-boot.img
fastboot -i 0x1949 flash recovery kdh8-twrp-2.3.3.0-recovery.img
fastboot -i 0x1949 reboot
** 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. **

CONGRATULATIONS YOU NOW HAVE THE ABILITY TO INSTALL CUSTOM KERNELS / RECOVERY AND ROMS.


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.


FLASHING BACK TO STOCK:
** FIND THE FILES WE BACKED UP IN STEP #1: **

**** 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 ****


Once you have these files (we'll name them boot.img/recovery.img and system.img for the purpose of these instructions, but they could be different on your system).

Plug in your fastboot cable and reboot so that you see the fastboot screen and enter the following commands:
Code:
fastboot -i 0x1949 flash boot boot.img
fastboot -i 0x1949 flash recovery recovery.img
fastboot -i 0x1949 flash system system.img # This one will take a few minutes
fastboot -i 0x1949 reboot

THANKS TO:
  • fattire for finding the original bootloader exploit
  • verygreen for doing some initial work on the 2nd-bootloader and fixing bugs (and letting me copy some of his bootloader installation instructions)

The Following User Says Thank You to timnan For This Useful Post: [ View ]
1st February 2013, 05:06 PM   |  #4  
Senior Member
Thanks Meter: 17
 
149 posts
Join Date:Joined: Mar 2008
Sweet! Can't wait to try. Just got my ebay fastboot cable last night. Time to finally open the KF.
1st February 2013, 06:47 PM   |  #5  
Hashcode's Avatar
OP Recognized Developer
Thanks Meter: 22,511
 
3,233 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Quote:
Originally Posted by supernoman

Sweet! Can't wait to try. Just got my ebay fastboot cable last night. Time to finally open the KF.

And of course, when I go to actually test a fastboot cable on the KFHD8: it does NOT automatically place you in fastboot mode. So you make sure you have the Android SDK installed:
http://developer.android.com/sdk/index.html
The Following User Says Thank You to Hashcode For This Useful Post: [ View ]
1st February 2013, 10:19 PM   |  #6  
Hashcode's Avatar
OP Recognized Developer
Thanks Meter: 22,511
 
3,233 posts
Join Date:Joined: Sep 2011
Donate to Me
More
I added a missing step where the auto recovery updater runs in the OS on stock boot:

To disable this auto recovery installer do this via adb:
Code:
adb shell su -c "mount -o remount,rw ext4 /system"
adb shell su -c "mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak"
adb shell su -c "mount -o remount,ro ext4 /system"
The Following 2 Users Say Thank You to Hashcode For This Useful Post: [ View ]
2nd February 2013, 08:52 AM   |  #7  
Born2BeMild's Avatar
Member
Thanks Meter: 8
 
90 posts
Join Date:Joined: Mar 2011
More
Re: [BOOTLOADER] Install 2nd-bootloader for Custom ROMs on KFireHD 8.9
Neat, gonna get around to this later on tomorrow. Thanks man!

Sent from my KFJWI
2nd February 2013, 02:57 PM   |  #8  
slacka-vt's Avatar
Senior Member
Flag Southern Vermont
Thanks Meter: 130
 
367 posts
Join Date:Joined: Nov 2009
More
Thumbs up
well, it was a three hour epic battle but I finally got the boot and recovery installed. getting into fastboot and having the device recognized was pretty darn hard. i found using the recovery tool found here: http://forum.xda-developers.com/show....php?t=2011126 to be invaluable for getting into fastboot with a non fastboot cable. Also, eveytime I tried to flash the recovery, i kept getting an error complaining about the file size being too big to upload to my device. oddly enough, I downloaded the TWRP recovery once more and renamed it "recovery.img" and was able to flash. not sure if that was coincidence. another trick is to keep device manager open, in fast boot, the kindle will show up as "Jem -XXX-XXX" and you need to use the "Android ADB Composite USB" driver. right now I'm in recovery and about to flash CM10.1 BUT, ONE IMPORTANT QUESTION - WILL WIPING PARTITIONS DO IRREVERSIBLE DAMAGE ? sorry for yelling and thanks so much for your hard work -it's greatly appreciated.
2nd February 2013, 05:53 PM   |  #9  
Hashcode's Avatar
OP Recognized Developer
Thanks Meter: 22,511
 
3,233 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Re: [BOOTLOADER] Install 2nd-bootloader for Custom ROMs on KFireHD 8.9
If you make a backup in TWRP, you can always restore it later.

Hold off on CM10.1, I'm rebuilding.

Sent from my DROID RAZR HD using Tapatalk 2
2nd February 2013, 06:51 PM   |  #10  
FroyoShark's Avatar
Senior Member
Flag South Dakota
Thanks Meter: 30
 
218 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Can't get fastboot working...
Tried 2 different 8.9's, with 3 different USB cables on Windows 7 and Linux with each.
EDIT: Nevermind, finally got it working
Last edited by FroyoShark; 2nd February 2013 at 07:00 PM.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes