FireTV 2 (sloane) Recovery [v6] - 3.0.0-5

Search This thread

rbox

Recognized Developer
Apr 22, 2011
1,776
2,612
Hi @rbox,
I looked at 2ndinit at github and I have a question.
You are using some code from phh's SuperUser to disable SELinux of init, ueventd, recovery and the shell from recovery. My question is, can this code be applied to get a full SELinux Permissive at boot? Just wondering cause we are trying to boot custom ROM on it and well, locked bootloader has his limitations...
I was about to pick up a commit from ggow (netd binary that loads at boot from init.rc) that injects some code to netd to disable SELinux at boot but the commit is gone. Will your 2ndinit help to get a full permissive SELinux at boot? It can be a good option since it runs directly after mount the system (ext4_resize).
Cheers and sorry for the OT.

Possibly. You can try calling setenforce after you've disabled it for init.
 
  • Like
Reactions: Rortiz2

Rortiz2

Senior Member
Possibly. You can try calling setenforce after you've disabled it for init.

Yep, I tought that. I will give it a try. Another question (sorry xD). I replaced lineages ext4_resize by yours one and same for pppd. There's no more files to replace? I mounted your unbrick img and I can see a few libs in lib64 and linker64. They need to be replaced too?
Cheers!
 

rbox

Recognized Developer
Apr 22, 2011
1,776
2,612
Yep, I tought that. I will give it a try. Another question (sorry xD). I replaced lineages ext4_resize by yours one and same for pppd. There's no more files to replace? I mounted your unbrick img and I can see a few libs in lib64 and linker64. They need to be replaced too?
Cheers!

Those should just be standard android stuff. The only things you should need are 2ndinitstub and 2ndinit.
 
  • Like
Reactions: Rortiz2

Rortiz2

Senior Member
Those should just be standard android stuff. The only things you should need are 2ndinitstub and 2ndinit.

Yupp, thanks you :)
Finally got to work boot menu in Lineage. My issue was that I was using system/etc/recovery instead of system/recovery :p
Now going to play with the 2ndinit to try what you said before about setenforce:good:
Cheers!
 
  • Like
Reactions: CFKod
Any one Pls help me rooting my fire TV 2, Ios 5.2.7.2
 

Attachments

  • 20191209_171922.jpg
    20191209_171922.jpg
    256.5 KB · Views: 178

Rortiz2

Senior Member
Hey all,

I'm facing a problem while wiping any partition in TWRP.
When I need to wipe data or cache I go (as usual) to the wipe option, I select them and I swipe to wipe.
The problem is, when I swipe, it stucks there with "Formatting cache/data using make_ext4fs..." (10 mins and more..)
Since it gets stuck on there, I tried running
Code:
killall recovery
(to "restart" TWRP as OP says) but that makes things worse as ADB stops working and the GUI freezes at the splash screen and I'm basically forced to unplug the power supply causing "damage" to the partitions I was wiping leaving them corrupted and in next boot seeing errors like "cannot mount /data" and so on...
As a "note", I'm able to wipe the partitions "manually" with adb shell using
Code:
make_ext4fs /dev/block/platform/mtk-msdc.0/by-name/partition_name
and that works just fine.
There's something I can do..? Or I just keep wiping the partitions manually with adb?

EDIT: Ignore all, fixed it.

Regards.
 
Last edited:
Im searching for a way to remove twrp and go back fully stock. Im able to successfully download the latest OS OTA, but when it reboots to install it hits TWRP and then boots up into the launcher without installing. Ive tried the factory reset option. Still have TWRP. Any help appreciated.
 

Sus_i

Senior Member
Apr 9, 2013
1,966
902
Anyone know a way to get into twrp without using boot menu on 3.0.05 , I haven't got a keyboard that works and my mouse doesn't work on the usb port either so I always get kicked into system instead of recovery.

Yes, you're able to switch the bootmenu without a keyboard but with adb.
Easiest way, extract the force_recovery.img file out of the sloane amonet/bin zip folder, push it to your sd and then dd it to cache, then reboot...
If you're done playing with TWRP, wipe cache, in order to switch the boot menu back to system.
 
Yes, you're able to switch the bootmenu without a keyboard but with adb.
Easiest way, extract the force_recovery.img file out of the sloane amonet/bin zip folder, push it to your sd and then dd it to cache, then reboot...
If you're done playing with TWRP, wipe cache, in order to switch the boot menu back to system.

Hi @Sus_i thanks again for replying,

So in theory could I be able to put the spare force_recovery.img I have on my pc to /sdcard and dd it to cache mate or does it have to come from flashed bin folder?

chmod 777 /cache/force_recovery.img

I think I know that not sure if it's correct
 

Sus_i

Senior Member
Apr 9, 2013
1,966
902
Hi @Sus_i thanks again for replying,

So in theory could I be able to put the spare force_recovery.img I have on my pc to /sdcard and dd it to cache mate or does it have to come from flashed bin folder

The force_recovery.img is an (almost empty) image file with only one file in it... ;)
Can't remember in detail, but I think it was something like this: /cache/bootmenu_recovery
That file will switch the bootmenu to TWRP at every boot, as long the file is there.
You need to use the one from sloanes amonet... (via dd command to cache) or you can create the file by hand...
Both should work fine :good:

Edit: You can run something like this:
Code:
adb shell
su
dd if=/sdcard/force_recovery.img of=/dev/block/platform/mtk-msdc.0/by-name/cache
exit
exit
 
Last edited:
The force_recovery.img is an (almost empty) image file with only one file in it... ;)
Can't remember in detail, but I think it was something like this: /cache/bootmenu_recovery
That file will switch the bootmenu to TWRP at every boot, as long the file is there.
You need to use the one from sloanes amonet... (via dd command to cache) or you can create the file by hand...
Both should work fine :good:

Edit: You can run something like this:
@Sus_i thanks again my friend you're a diamond :good:

Updated Sloane to 5.2.7.1 r1 hopefully if its possible it will update USB driver, don't know why my keyboard/air mouse ain't showing up, shows up in twrp but not on boot menu screen.

Edit ## updated SU with 2.79 SR3 ZIP as it was old version, what's difference between flashing the supersu zip and magisk? Cos the supersu is already bound into ramdisk?
 
Last edited:

Sus_i

Senior Member
Apr 9, 2013
1,966
902
@Sus_i thanks again my friend you're a diamond :good:

Updated Sloane to 5.2.7.1 r1 hopefully if its possible it will update USB driver, don't know why my keyboard/air mouse ain't showing up, shows up in twrp but not on boot menu screen.

Edit ## updated SU with 2.79 SR3 ZIP as it was old version, what's difference between flashing the supersu zip and magisk? Cos the supersu is already bound into ramdisk?

No, there isn't any update for usb. ;)
The mouse won't work at all at the 'bootmenu', most of the keyboard won't work too, except (or only) the two arrow keys (left/right) are working.
Maybe try pressing two times the 'left arrow' key, should do the trick.

You can update chainfires SuperSU, the latest version is SR5-SuperSU-v2.82-SR5-20171001224502.zip, grab it from here. It is normal that the SuperSU App won't open, it's somehow blocked by the fireOS. Just ignore the update messages...

Magisk won't work on the locked bootloader. Roger needs a new development box ;)
 
Last edited:
No, there isn't any update for usb. ;)
The mouse won't work at all at the 'bootmenu', most of the keyboard won't work too, except (or only) the two arrow keys (left/right) are working.
Maybe try pressing two times the 'left arrow' key, should do the trick.

You can update chainfires SuperSU, the latest version is SR5-SuperSU-v2.82-SR5-20171001224502.zip, grab it from here. It is normal that the SuperSU App won't open, it's somehow blocked by the fireOS. Just ignore the update messages...

Magisk won't work on the locked bootloader. Roger needs a new development box ;)


Haha sound advice m8. Was wondering wtf was happening, been round everyone stealing their keyboards n mouse today and wondering if it was fire os needing update,

I can't even get any to work on Sloane once he boots up to homescreen, at least the sdcard is expandable eh?..

As for supersu yeah I noticed it didn't do anything when I flashed it. So I'll update to 2.82 and get rid of some bloat, job done.
Wouldnt mind magisk though would be better :good:

Cheers again Sus_i
 
Have you tried an usb stick or keyboard in fireOS? You have to disable usb debugging in order to use it...

Ah well @Sus_i everyday is a schoolday mate (except a saturday and sunday) :laugh: i neverr knew adb had to be switched off .
Will try it out shortly when i finish using keyboard on pi . :good:

Yeah it's working with USb debugging off

Ta much :good:
 
Last edited:

ldeveraux

Senior Member
Nov 20, 2008
2,622
940
Lenovo Thinkpad Tablet
Nexus Q
Hey all,

I'm facing a problem while wiping any partition in TWRP.
When I need to wipe data or cache I go (as usual) to the wipe option, I select them and I swipe to wipe.
The problem is, when I swipe, it stucks there with "Formatting cache/data using make_ext4fs..." (10 mins and more..)
Since it gets stuck on there, I tried running
Code:
killall recovery
(to "restart" TWRP as OP says) but that makes things worse as ADB stops working and the GUI freezes at the splash screen and I'm basically forced to unplug the power supply causing "damage" to the partitions I was wiping leaving them corrupted and in next boot seeing errors like "cannot mount /data" and so on...
As a "note", I'm able to wipe the partitions "manually" with adb shell using
Code:
make_ext4fs /dev/block/platform/mtk-msdc.0/by-name/partition_name
and that works just fine.
There's something I can do..? Or I just keep wiping the partitions manually with adb?

EDIT: Ignore all, fixed it.

Regards.
How did you fix this? I tried upgrading my rom in twrp, wiped cache, and it hung. I foolishly rebooted and now it only boots to twrp and won't mount cache.
 

Rortiz2

Senior Member
How did you fix this? I tried upgrading my rom in twrp, wiped cache, and it hung. I foolishly rebooted and now it only boots to twrp and won't mount cache.
I don't really know, that was long time ago and now my box it's hard bricked.
I'd recommend you to manually format cache with make_ext4fs as the op says in the first post.
Regards.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 46
    It's finally here! Recovery for the Fire TV 2. This is based off of TWRP and the way versions will work is I will increment the last digit in the version as I make updates. So 3.0.0-1 is my first release based off of 3.0.0. The downloads will be numbered starting at v1, and at the bottom of the post it will explain what is contained within each version.

    attachment.php

    As usual, this WILL void your warranty and I am NOT responsible for anything you do with this. Installing it properly won't brick your Fire TV, but doing stupid things with it might.

    Installing this requires root. If you are not rooted, please see my FireTV 2 Recovery Installer page.

    Installation
    1. You can copy the files to /sdcard, a USB storage device, or an sdcard. I will be using /sdcard in the instructions, but you can replace it with /storage/usbotg for USB or /storage/sdcard1 for an sdcard.
    2. Copy the zip file to your destination.
    3. Connect adb
      Code:
      adb connect IPADDRESS
    4. Open an adb shell
      Code:
      adb shell
    5. Run the zip file (replace vX with the actual version you downloaded). This will automatically run su, so make sure to accept the prompt if necessary.
      Code:
      sh /sdcard/firetv2_recovery_vX.zip
    6. Reboot

    Upgrade
    You may repeat this to upgrade to a newer version, or you can install an updated pre-rooted rom, as I will be uploading new versions of those with every version of recovery.

    Notes
    This includes bootmenu. For everyone that loved the old FireTV 1 bootmenu with Comic Sans, I'm sorry to disappoint you, but the Comic Sans is gone. When the FireTV boots, it will present you with the bootmenu where you can leave it alone and it will boot normally or you can select recovery and it will boot in to recovery. You do need a USB keyboard to interact with the bootmenu. To force it to boot in to Recovery, you can create a file /cache/bootmenu_recovery.

    DHCP for Ethernet is enabled, and if there is enough demand I may add in wifi at some point. The IP address should show up in the top left corner.

    USB storage, USB keyboard/mice, and sdcards should all work. Hotplugging works, so you should be able to plug and unplug devices as needed.

    You can use a USB keyboard, mouse, or the mouse emulator to interact with it. To use a keyboard, you can use the arrow keys to move the cursor and the enter key to select buttons. Sliders don't require sliding, so you can just hit enter/click on them. To use the mouse emulator, use adb shell and then run the program mouse and follow the instructions.

    ROMs
    Recovery must be included in all ROMs. If you want to develop a ROM, please contact me about including recovery in it.

    Kernels
    The bootloader is locked and you cannot flash kernels. If you do attempt to flash a kernel, you will brick it.

    Installing zips
    You can push zips to /sdcard, put it on a USB storage, put it on an sdcard, or use adb sideload. Do note you need adb version 1.0.32 to use adb sideload.


    Stuck in a loop?
    If you cannot boot normally and keep going back to the bootmenu, wipe Cache from Wipe -> Advanced Wipe.
    If that doesn't work, ensure Cache is not mounted from in the 'Mount' menu and run this from an adb shell:
    Code:
    mke2fs /dev/block/platform/mtk-msdc.0/by-name/cache


    Source Code
    You can find the source code here:
    https://github.com/androidrbox/sloane-2ndinit
    https://github.com/androidrbox/android_bootable_recovery

    WARNINGS

    • It is extremely important you never reboot after a failure. This will most likely lead to a brick. If recovery is hung, you can use adb shell to run
      Code:
      killall recovery
      to restart it
    • It is also extremely important to never reboot after wiping /system.
    • If you wind up bricking, you must use the Unbrick Image to unbrick.


    Finally, thanks to everyone who has donated to me and those that helped to get me my FireTV 2.

    Changelog and Downloads:
    • April 8, 2016 - v6 (md5sum: 79c1a3efbac86618fa2cdbb4901fbd77)
      • This should prevent auto flashing amazon updates.
      • This includes 2ndinit version dee776 and TWRP version 3.0.0-5.
    • February 14, 2016 - v5 (md5sum: 16c957c86f1f61160e14a55819610707)
      • This should fix the problems certain keyboard were having in recovery.
      • This includes 2ndinit version dee776 and TWRP version 3.0.0-4.
    • February 12, 2016 - v4 (md5sum: 15c6d375607839cac4b186a2b68b8b0d)
      • This includes 2ndinit version 743aa4 and TWRP version 3.0.0-3.
        • These are just changes related to the unbricking image. No other functional changes.
    • February 8, 2016 - v3 (md5sum: b39a4dbe0c19080a97f602f37fda63ec)
      • This includes an updated script. You can now just run the zip instead of needing the zip and the script.
      • This includes TWRP 3.0.0-2.
        • Added a reboot recovery option in addition to reboot system. Now reboot system will reboot straight in to Android. Reboot recovery will reboot to the bootmenu.
        • Fixed restoring backups.
      • This includes the same version of 2ndinit.
    • February 7, 2016 - v2 (md5sum: 762621104d158d7ce4010bea725f7181)
      • This includes an automated script.
      • This has the same versions of 2ndinit and recovery as v1.
    • February 6, 2016 - v1 (md5sum: 7be673dd24489080eacdd0ad00feda51)
      • This comes with 2ndinit version fe3362 and recovery version 3.0.0-1
    6
    I just updated the OP with v6/3.0.0-5. This blocks TWRP from auto installing Amazon updates.
    3
    I added v3 to the OP. Now you only need to copy the zip file whole and just run it. Additionally, I updated TWRP to 3.0.0-2. The changes are listed in the OP.
    3
    Hi, @rbox - FYI, I think that the posted v6 ZIP file is corrupt in some way. When I tried to unzip it using 7Zip, I always see the following error:



    The posted v6 ZIP file did pass the MD5 check on my PC, so I don't think it is corrupted - It may have been an error in the ZIP file creation (maybe a file was still open when created?). There are 3 files that are extracted with 7Zip.

    The files also do extract using the Windows 7 Explorer OK, but I wouldn't expect Win7 to be very expressive if there was a lower-level error during the extraction process.

    Also, the 3 extracted files are binary identical between the 7Zip extraction and the Win7 extraction.

    Just letting you know,

    ¿GJ?

    Depending on the quality of the program you're using, and how it follows the zip standard, determines if it believes the zip is corrupt. I don't really know if according to the standard it is or not, but most programs will extract it. I do know some program on mac will refuse to unzip it. It actually consists of a shell script, followed by an unzip binary, followed by the actual zip file. And, looking at your screenshot, your program is just warning you that there is an offset. It's not an error per se, and having an offset is perfectly valid, because I'm using a standard method of "fixing" the zip to apply the offset.
    3
    I'm sure this has been asked, but I couldn't find it in the thread. Was this updated to the same 3.0.0-7 that we have for the FireTV 1, or is it an insignificant change?

    The changes from 5 to 7 don't matter for sloane. In theory I should rebuild all 3 devices with the same version, but I haven't really had a need.