User:Rage/Drafts/Amazon Fire Phone (Kodiak)
Rooting
Root access is needed before continuing.
There are several methods for gaining root access, but unfortunately, they all seem to require a proprietary apk to do that.
I've typically factory reset a device, attempted to gain root access via such a tool, then flash with new rom. That way, those apps do not have access to any personal data. I can also verify that any left over surprises are overwritten by the new rom.
This project seeks to remedy this.
Emerge
Installing sources from custom ebuild repositories
Currently, these kernel sources are only supported by an ebuild in the rage-overlay.
To enable a custom ebuild repository, create the proper repos.conf file and emerge it as shown here for the rage-overlay:
[rage]
location = /usr/local/portage/rage
sync-type = git
sync-uri = https://gitlab.com/oxr463/overlay.git
auto-sync = yes
For using sync-type = git
the package dev-vcs/git needs to be installed. Alternatively, layman can be used for adding the repository.
root #
emerge --ask sys-kernel/kodiak-sources
Installing crossdev for cross compiling
root #
emerge --ask crossdev
root #
crossdev --stable -v -t arm-linux-gnueabihf --gcc 4.9.4
Building a Kernel
root #
eselect python set python2.7
root #
emerge -av sys-devel/gcc
root #
cd /usr/src/linux
root #
zcat /proc/config.gz > .config
root #
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
USB OTG
config USB_OTG
bool "OTG support"
depends on PM
default n
help
The most notable feature of USB OTG is support for a
"Dual-Role" device, which can act as either a device
or a host. The initial role is decided by the type of
plug inserted and can be changed later when two dual
role devices talk to each other.
Select this only if your board has Mini-AB/Micro-AB
connector.
Kexec
Due to the bootloader being locked on this device,
kexec
is need to execute custom kernels.
However, it will need to be built as a module and loaded dynamically.
System kernel config options
1) Enable "kexec system call" in "Processor type and features."
CONFIG_KEXEC=y
See also
- Cross-compiling - It may be useful to cross compile from a more powerful system.
- Embedded_Handbook
- GLEP 26 - This GLEP proposes to create a more consistent handling of kernels and kernel building.
- Project:Android - Using ebuilds to track patchsets and customized sources is the Gentoo-preferred way to handle Android-specific customizations to the official Linux kernel.
- SharkBait User Guide
- SharkBait Porter's Guide
External resources
- https://forum.xda-developers.com/fire-phone
- https://forum.xda-developers.com/fire-phone/development/dev-building-custom-kernel-kernel-t3195492
- https://gitlab.com/lramage94/overlay/tree/master/sys-kernel/kodiak-sources
- https://ruedigergad.com/2012/12/09/nexus-7-easily-flashaccess-entire-userdata-partition
- https://forum.xda-developers.com/showthread.php?t=2104706
- http://www.phoronix.com/scan.php?page=news_item&px=MTUzNDk
- https://community.kde.org/Plasma/Mobile/Porting