[Fire TV General] mrchrister:
Hey guys,

I was looking for a way to install some Linux applications on the FireTV. After trying out optware (which installs a package manager to android systems) with little success, I ended up installing a Debian Chroot on the external USB. The following is a list of apps which now run almost natively on the firetv:

- Transmission 2.82/couchpotato/sickbeard

- openssh

- nano

- x11 environment

- vnc server

- ftp server

I hope these instructions will be useful for some people. Your firetv needs to be rooted for this to work. The process is relatively quick and as easy as it can get. The tricky part is to let The Debian environment boot when the FireTV boots. Here we go:

1. First, get DebKit from Google Play

2. Sideload DebKit onto the FireTV and start it up

3. Grant DebKit Root Permissions

4. Push the Menu Button on your FireTV remote and go to settings

5. Select the image Location. I created a folder called debian on the external USB device. The USB works natively through the new FireTV firmware.

6. For the image size I decided to make it 2GB. At first I had a 1GB image but I quickly ran out of space installing the x11 environment

7. Under Debian Distribution I would recommend installing Jessie since it gives you the latest Transmission version. With wheezy you get v 2.6 which does not let you choose folders through the web ui.

8. Go back to the main menu and choose "Install". Follow the onscreen instructions.

At this point you should have a working Debian installation on your FireTV.

9. The first thing we want to do is install openssh to create a login into the chroot. To log into your new Debian installation use

"adb connect 192.168.1.x" (firetv ip) and "adb shell"

10. Once you are logged into the firetv shell, execute "debkit mount" , then "debkit chroot".

11. Inside the chroot execute "apt-get update && apt-get install openssh". You will see a few error messages which are caused by the environment variables of the android shell. When using nano for example you'll notice that the enter key doesn't work. On a full size keyboard you can use the other enter key to confirm though.

12. Now try logging in to your debian chroot with ssh root@192.168.1.x" (firetv ip)

AUTOSTART

In order to autostart your debian chroot I created the following script.

1. Go to the android shell and remount /system in rw ( mount -o remount,rw /system )

2. Create or edit /system/etc/install-recovery-2.sh which will autostart (vi /system/etc/install-recovery-2.sh, then chmod 755 /system/etc/install-recovery-2.sh)

3. Here is my complete autostart script. I have all my media connected to my router which has a NFS server running:

#!/system/bin/sh
sleep 20
busybox mount -o remount,rw /
busybox mkdir -p /mnt/nfs.TV
busybox mkdir -p /mnt/nfs.Movies
busybox chmod 777 /mnt/nfs.TV
busybox chmod 777 /mnt/nfs.Movies
busybox remount,ro /
su --mount-master -c "busybox mount -o nolock,hard,intr,rw -t nfs 192.168.10.1:/mnt/TV /mnt/nfs.TV"
su --mount-master -c "busybox mount -o nolock,hard,intr,rw -t nfs 192.168.10.1:/mnt/Movies /mnt/nfs.Movies"

/data/data/com.mizusoft.debkit/files/debkit mount
sleep 5
busybox mount --bind /mnt/nfs.TV /data/data/com.mizusoft.debkit/files/mnt/mnt/TV
busybox mount --bind /mnt/nfs.Movies /data/data/com.mizusoft.debkit/files/mnt/mnt/Movies
busybox mount --bind /mnt/nfs.Movies/Music /sdcard/MPD/music
sleep 5
/data/data/com.mizusoft.debkit/files/bin/chroot /data/data/com.mizusoft.debkit/files/mnt/ /bin/bash -c "/home/ssh.sh"

4. I mount my nfs shares to the FireTV and then bind them inside the chroot.

5. Here are the contents of /home/ssh.sh which is a script to start the chroot ssh

/usr/sbin/sshd
sleep 10
/usr/bin/ssh root@localhost "/home/startup.sh"

6. and the contents of /home/startup.sh

/etc/init.d/transmission-daemon start
/etc/init.d/couchpotato start
/etc/init.d/cron start

7. What you end up with is a FireTV which runs Debian on the side. I've had this setup for the last two months and can say that so far the performance of Kodi does not seem to suffer of having the Debian Chroot running at the same time.

I hope this tutorial will be helpful for people who are looking for ways to extend the use of their FireTV.

Cheers,

Chris