Amazon Kindle Fire (amazon-otter)

== Contributors ==
* Foldmorepaper
* h_ro
== Users owning this device ==
== Root and Fastboot ==
If the device can reach fastboot mode, the device does not need to be rooted to install recovery since the stock bootloader is already unlocked. Typically, a "Motorola factory cable" is needed to power the device into fastboot mode, but with root and fbmode utility, the device can reboot into fastboot mode without the special cable.
=== Rooting with saferoot ===
Source: https://forum.xda-developers.com/t/root-saferoot-root-for-vruemj7-mk2-and-android-4-3.2565758/#post-48392009
$ wget https://forum.xda-developers.com/attachments/saferoot-zip.2760984/ -O saferoot.zip
$ mkdir saferoot
$ cd saferoot
$ unzip ../saferoot.zip
$ ./install.sh
=== Booting into fastboot from Android ===
Source: https://forum.xda-developers.com/t/fastboot-stock-6-2-1-fastboot-mode-without-rooting-or-cables.1414832/
$ wget https://forum.xda-developers.com/attachments/fbmode-zip.833582/ -O fbmode.zip
$ unzip fbmode.zip
$ adb push fbmode /data/local/tmp
$ adb shell chmod 755 /data/local/tmp/fbmode
$ adb shell /data/local/tmp/fbmode
$ adb reboot
== Custom Bootloader ==
A custom version of Hashcode's (2014) u-boot port with device tree support is required to boot mainline Linux kernel. The following steps are based off of h_ro's documentation repo.
Toolchain used: Linaro GCC4.9 ARMv7 Baremetal
=== Build steps ===
$ wget https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-eabi/gcc-linaro-4.9.4-2017.01-x86_64_arm-eabi.tar.xz
$ tar -xvf gcc-linaro-4.9.4-2017.01-x86_64_arm-eabi.tar.xz
$ export CROSS_COMPILE=$PWD/gcc-linaro-4.9.4-2017.01-x86_64_arm-eabi/bin/arm-eabi-
$ git clone https://github.com/hansemro/kf_u-boot.git u-boot
$ cd u-boot
$ make ARCH=arm distclean
$ make ARCH=arm omap4_kc1 -j$(nproc)
=== Installing bootloader ===
Set the device to fastboot mode and flash the bootloader directly with fastboot.
$ fastboot flash bootloader u-boot.bin
u-boot version should appear on the top right corner when lcd menu is entered. For postmarketOS, version L2.13 or newer is required.
== Custom Recovery: TWRP ==
Download an otter recovery image from TWRP website here.
Set the device to fastboot mode and flash the recovery with fastboot.
$ fastboot flash recovery twrp-2.8.1.0-otter.img
== Installation ==
$ pmbootstrap init
$ pmbootstrap install --split
$ pmbootstrap export
$ fastboot flash media /tmp/postmarketOS-export/amazon-otter-root.img
$ fastboot flash cache /tmp/postmarketOS-export/amazon-otter-boot.img
For more advanced installation methods, see here.
== Stock Partition Layout ==
Output of parted /dev/block/mmcblk0 print while in TWRP recovery:
Model: MMC M8G2FA (sd/mmc)
Disk /dev/block/mmcblk0: 7734MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number	Start 	End 	Size 	File system	Name 	Flags
1 	131kB 	262kB 	131kB 	 	xloader 	
2 	262kB 	524kB 	262kB 	 	bootloader	
3 	524kB 	11.0MB	10.5MB	 	dkernel 	
4 	11.0MB	212MB 	201MB 	ext4 	dfs 	
5 	212MB 	229MB 	16.8MB	 	recovery 	
6 	229MB 	296MB 	67.1MB	ext4 	backup 	
7 	296MB 	307MB 	10.5MB	 	boot 	
8 	307MB 	312MB 	5243kB	ext4 	splash 	
9 	312MB 	849MB 	537MB 	ext4 	system 	
10 	849MB 	2041MB	1192MB	ext4 	userdata 	
11 	2041MB	2309MB	268MB 	ext4 	cache 	
12 	2309MB	7690MB	5380MB	fat32 	media 	
== See also ==
* Initial merge request
* Mainlining effort and documentation