Mainline Linux (postmarketOS) on my Amazon Fire HD 10 (2017). Post #1
(I started writing this post August 30, how naive of me)
After writing my blog post regarding my summer happenings, I pretty much immediately jumped into a new big project - attempting to bring mainline Linux to my old Amazon Fire HD 10 (2017).
Sporting a Mediatek MT8173 SoC, a whopping 2GB RAM, 32GB eMMC, and running the greatest operating system: Amazon FireOS

Just look at that *cough*, beautif- *cough* I’m so sorry
Fire OS is Amazon’s heavily branded, ad-ridden, fork of Android, and as soon as 17 year old me got the tablet, I was already sick of it.
The OS is slow, doesn’t even support most android apps (you have to jump through hoops to get real apps), and became out-of-date really quick, meaning apps that it did support probably wouldn’t be supported for long.
So, the tablet naturally began to collect dust after less than a year of usage. At some point I ran the amonet exploit to unlock the bootloader and installed Lineage OS on the device, but I still didn’t really use it all that much.
I’ve gotten very interested in mobile Linux, so much so that a year or two ago I bought a OnePlus 6T off of eBay to put postmarketOS on it. I’ve also been interested in getting into kernel development. What better way to do so than to work on mainlining a device I have laying around? Plus, if I got it working, I’d probably actually use the thing. The hardware is absolutely wasted on the OS it comes with. Also, at work, I am going to be transitioning to a position where I’ll be working more intimately with the Linux kernel, so this could be a good opportunity to get some early practice.
And so, I set my mind to it; but, how do I get started?
Step 1: What’s out there?
Easy, postmarketOS already has a port for amazon-suez
But wait, it isn’t that easy.

Look at how much is broken! And wait, it’s running a 3.18.19 kernel?? Aren’t we at 7.2 now? Also, it’s in the “Archived” category. Hmmmm, this is starting to look a bit more complicated.
Let’s go through each part of this step by step.
First, the archived status. Archived devices in postmarketOS are devices that are no longer maintained, and can’t be built properly anymore. If we go to the kernel package in pmaports, we can see that Hadi Charara was the maintainer, and he had a kernel tree on GitHub we can use.
If we go to Hadi Charara’s GitHub, he no longer has his kernel tree public on his page.
Normally that’d be a roadblock, becuase he could have all sorts of enablement patches on there; however, I’m inclined to believe it’s literally just the android kernel that was used for amazon-suez by Amazon. For one, the repo name was android_kernel_amazon_suez, named similarly to other projects on GitHub that appear to just be the vendor kernel imported into a repository:
- https://github.com/chaosmaster/android_kernel_amazon_suez
- https://github.com/MarvelMathesh/android_kernel_amazon_suez
- https://github.com/Matze-S/android_kernel_amazon_suez
With this in mind, I forked one of those repositories to start working with.
When working on a postmarketOS port for a device, the porting guide suggests starting with a vendor (downstream) kernel.
Luckily, I only had to make a few patches to pmaports to get the device booting postmarketOS from the downstream kernel, mainly figuring out regions in RAM for where to load the kernel. Great success!

This isn’t our final destination though, now that we have the downstream kernel running, we know we have a baseline for booting Linux on this device. It might be a really old kernel version, with a bunch of vendor-specific code, and a large device tree to parse through, but it’s the start we need, because almost everything will be described in the code, and we can (hopefully) fill in the rest.
As a spoiler for the next blog posts, I’m already much further than the downstream kernel. I’m actually now working on grooming out my patches for mainline submission (with at least one of the smaller patches already merged in a subsystem maintainer’s tree!). You’ll just have to wait for the next few blog posts for the progress in-between. It’s super late on a Friday night here, and I already intended this to be in multiple posts anyways, since this is a huge project. Anyways, hope you enjoyed!