Post Reply

Firekit LiveUSB repair kit 1.1- when you're about to kill Windows

OP pokey9000

5th January 2012, 09:49 PM   |  #1  
OP Senior Member
Flag Austin
Thanks Meter: 385
 
765 posts
Join Date:Joined: Apr 2007
More
What it is

Firekit combines all the command line tools for Kindle Fire recovery with the Ubuntu LiveUSB. All you need is a USB stick and a PC that can boot off it. All files stay on the stick, so nothing on your PC is changed.

Firekit is run from the command line, but there are scripts to automate common tasks so the typical restoration involves running just two commands. A fastboot-bootable TWRP and FFF is included as well as the Rekindle USB boot tools so even the most fubared bricks can be restored.


What can it do


Fix power on problems: If the Fire's screen never seems to turn on, you may have wrecked the bootloaders or the partitioning. Fortunately most of the time this results in the CPU falling into the low level USB boot mode. Use the "usb_fix_parts_and_install_fff_twrp" to rebuild the flash enough to boot TWRP. You don't need to use the USB shorting trick for this one, just power up the Kindle after running the script.

Fix stuck-at-triangle-logo: This can be due to being stuck in fastboot or having a corrupt /system. First try getting into recovery. Press power for a few seconds just after turning on, LED should go orange and the TWRP should show up. If that works, reflash your ROM from TWRP. If not, try the "normal_boot" script to get out of being stuck in fastboot.

Fix stuck-at-Kindle Fire-logo: Similar to the above. First try the "normal_boot" script. If that doesn't work, you need to reflash the stock ROM from TWRP. But you don't have TWRP. So use the "install_fff_twrp_from_stock" script which will force the stock ROM into letting you install fastboot. Then flash a ROM.

-and more


Why

A lot of people seem to be having problems with Windows and ADB drivers needed for fastboot and adb. Linux doesn't seem to have this kind of trouble, so I threw this together. It's not pretty or menu driven, but I find that too much automation gets in the way when things are broken to begin with.

Downloading a ~600MB Ubuntu image is needed, and this has only been tested on one PC so far. Don't complain if you spend hours grabbing this only to not have it fix your problem. I thought about rolling my own USB image with debootstrap for a much smaller image but figured that a prefab Ubuntu Live image is probably best for compatibility.


Using Firekit

Making the LiveUSB

Get the latest 32-bit Ubuntu and follow the directions to make a USB stick. If you want to try this with another distro (not tested) it must be 32-bit or have full 32-bit compatibility libraries.

Then unpack the attached zip to the top of the stick. The easiest way is to open the .zip in Explorer, right-click on "fk" (the only file in the zip), and choose "Send to..."->your USB stick's drive letter. You may have to unplug and replug the stick for Windows to see the drive after Ubuntu's been installed. If you have anything else you want available on the stick (roms, other recovery/bootloader, etc) copy them here as well. When done, eject the drive.


Before Booting

Set your PC's BIOS to boot USB before your internal drive. Each PC is different, so it's up to you to figure out how to set your PC to boot from USB.


Running the tools

Always start with your Kindle turned off and unplugged from USB. These directions assume that your Fire is stuck in fastboot, has FFF installed, or you are using the USB boot shorting trick. The exception is if you're trying to install FFF/TWRP from stock Kindle OS, in which case leave it booted and plugged in.

Now boot the LiveUSB. Once the Ubuntu desktop shows up, click the Ubuntu logo in the top left (or press the Windows key) and type "term". Hit enter to run the terminal.

In the terminal window, type "sudo /cdrom/fk". This unpacks the tools and sets up your environment. You should now have a prompt that says "root@ubuntu:~/firekit#"

A list of the possible scripts should now be showing. Type the name of the script you want and hit enter. Protip: type a few letters and hit tab to autocomplete the rest of the word. If you're using any of the usb_ scripts, short the test point and plug in the Fire. As mentioned before, you should have the Fire already booted when using "install_fff_twrp_from_stock". For all the other commands, just plug the Fire in.



If this keeps you from returning or junking an otherwise good Fire, consider throwing a thanks or a beer my way.


Props to TeamWin & agraben for TWRP, everyone at Canonical


These are the commands as of 1.1:

install_fff_twrp_from_stock: Install FFF and TWRP while in stock Android. Uses fbmode to reboot. Use this to get FFF/TWRP installed on 6.2.1 stock OS.

install_fff_twrp: Install FFF and TWRP while in fastboot. Good if you're stuck in fastboot and you want FFF/TWRP.

fix_parts Restore partition table to stock while in fastboot. Do this if you're in fastboot and your partition table is screwed up.

normal_boot: Set the bootmode to boot android and reboot while in fastboot. Try this if you're stuck at the Kindle Fire logo.

usb_boot_twrp: USB boot TWRP without installing. Boot TWRP if your Kindle black screens when you try to power it on. Needs the USB boot mode trick.

usb_install_fff_twrp: USB boot FFF, install FFF and TWRP. Install / recover the bootloader and recovery if they are broken. Needs the USB boot mode trick.

usb_fix_parts_and_install_fff_twrp: USB boot FFF, restore partition table to stock, install FFF and TWRP. Fix everything if you screwed up the partition table and your Fire's screen no longer turns on. Needs the USB boot mode trick.


Changelog:

1.1:
-Add restore of mmcblk0p1 (x-loader) to the "usb_fix_parts_and_install_fff_twrp" script to recover from total brain damage. Thanks to TyHi for proving this works and may be necessary.

1.0:
-Initial release


(todo: make videos, integrate usb boot mode instructions)
Attached Files
File Type: zip fk-1.1.zip - [Click for QR Code] (5.70 MB, 11565 views)
Last edited by pokey9000; 7th January 2012 at 05:39 AM.
The Following 34 Users Say Thank You to pokey9000 For This Useful Post: [ View ]
5th January 2012, 10:41 PM   |  #2  
Member
Thanks Meter: 11
 
38 posts
Join Date:Joined: Dec 2010
Thanks for the compilation of tools and directions. Rolling up your own image with debootstrap is probably more trouble then it's worth; the images provided by Canonical might be larger -- but they will pretty much work on *.
5th January 2012, 11:48 PM   |  #3  
sarge363's Avatar
Senior Member
Flag Robstown, Tx
Thanks Meter: 12
 
230 posts
Join Date:Joined: Nov 2010
More
This is very interesting. I never really was interested in learning about Ubuntu but if it saves me worry about finally getting around to flashing FFF & TWRP then it's worth a shot.
6th January 2012, 01:27 AM   |  #4  
Senior Member
Flag Seattle
Thanks Meter: 125
 
271 posts
Join Date:Joined: Aug 2010
More
This is a very, very good idea. I spent a long time trying to get the drivers working on Windows, it seems that the ones packaged with the latest KFU are FUBAR.
Maybe you could package this with a minimal Ubuntu install, or another distro? For something with such a simple purpose Ubuntu is mighty bloated.
6th January 2012, 12:43 PM   |  #5  
Member
Thanks Meter: 10
 
65 posts
Join Date:Joined: Dec 2009
The sdk version of adb has trouble on windows too. Linux : for those who want their computer to work for them, not the other way around.
Sent from my DROID2 using xda premium
6th January 2012, 05:16 PM   |  #6  
OP Senior Member
Flag Austin
Thanks Meter: 385
 
765 posts
Join Date:Joined: Apr 2007
More
Quote:
Originally Posted by yumcax

This is a very, very good idea. I spent a long time trying to get the drivers working on Windows, it seems that the ones packaged with the latest KFU are FUBAR.
Maybe you could package this with a minimal Ubuntu install, or another distro? For something with such a simple purpose Ubuntu is mighty bloated.

Ubuntu is a known quantity, and Canonical does all the hard QA work making sure it runs on the largest swath of hardware. I put this together to be a sure thing for people having trouble in other environments, and trying to streamline the OS may compromise that.
6th January 2012, 10:52 PM   |  #7  
gett's Avatar
Senior Member
Flag Skopje
Thanks Meter: 42
 
212 posts
Join Date:Joined: Oct 2006
More
Quote:
Originally Posted by pokey9000


What can it do
These are the commands as of 1.0:

install_fff_twrp_from_stock: Install FFF and TWRP while in stock Android. Uses fbmode to reboot. Use this to get FFF/TWRP installed on 6.2.1 stock OS.

Sorry for noob questions
1. This means that it will unstall FFF and TWRP without any other downloads, or I should put another files in USB (along with attached one) It will work with 6.2 OS?
2. Should I been rooted first?
And
3. Any root method for ubuntu from USB?

Once more, sorry to ask noobs questions in developers forum

Edit:
I find answer for 3rd question here
Last edited by gett; 6th January 2012 at 11:00 PM.
7th January 2012, 03:26 AM   |  #8  
Member
Flag Nebraska
Thanks Meter: 4
 
53 posts
Join Date:Joined: Dec 2010
More
Hello,

I have my unbuntu on a bootable usb and I have the extracted kf file on the root folder right where terminal opens up to... so in the terminal I do "sudo fk" and "sudo /fk" and it just gives me command not found, could somebody give me a little help? I'm not a linux noob but I am no pro either.
7th January 2012, 03:32 AM   |  #9  
OP Senior Member
Flag Austin
Thanks Meter: 385
 
765 posts
Join Date:Joined: Apr 2007
More
Quote:
Originally Posted by bigjkcfan

Hello,

I have my unbuntu on a bootable usb and I have the extracted kf file on the root folder right where terminal opens up to... so in the terminal I do "sudo fk" and "sudo /fk" and it just gives me command not found, could somebody give me a little help? I'm not a linux noob but I am no pro either.

sudo ./fk

"sudo /fk" doesn't work because I'm guessing your file is located in /root/fk, and "sudo fk" doesn't work because executables without a path prefix are assumed to be in the $PATH, and most of the time /root and the current directory ("./") aren't in the $PATH.
The Following 2 Users Say Thank You to pokey9000 For This Useful Post: [ View ]
7th January 2012, 03:40 AM   |  #10  
Member
Flag Nebraska
Thanks Meter: 4
 
53 posts
Join Date:Joined: Dec 2010
More
Ah, I got it! the permissions needed to be changed, then I ran the sudo ./fk and it worked, thanks!

Alright here is my situation. When trying to revert to stock my brother's kindle got very screwed up, adb shell does not work at all, adb works just fine though. So I bought a factory cable and now once I do the boot sequence with that in windows adb does not recognize anymore, actually in windows it just says unknown device. So it has to be in fastboot mode, yet now that I figured this linux stuff out, it still says waiting for device when trying to install twrp. Is my brother's kindle really screwed up?
Last edited by bigjkcfan; 7th January 2012 at 04:05 AM.

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

Advanced Search
Display Modes


Top Threads in Kindle Fire Android Development by ThreadRank