-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.xml
175 lines (167 loc) · 15.7 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>lowendlibre Blog</title>
<link>http://lowendlibre.github.io/</link>
<description>Recent content on lowendlibre Blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en</language>
<lastBuildDate>Sun, 03 Sep 2023 15:58:15 -0400</lastBuildDate><atom:link href="http://lowendlibre.github.io/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>MediaTek Mainlining Madness</title>
<link>http://lowendlibre.github.io/posts/mediatek-mainlining-madness/</link>
<pubDate>Sun, 03 Sep 2023 15:58:15 -0400</pubDate>
<guid>http://lowendlibre.github.io/posts/mediatek-mainlining-madness/</guid>
<description>MediaTek Mainlining Madness Long time no see! We have a lot to cover, so let&rsquo;s get right into it.
We have two devices booting the mt6765 kernel. The Nokia 3.1 Plus (Roo) and the TCL A3 (bangkok_tf). Out of these two devices, the Nokia 3.1 Plus has better support due to being easier to get logs from.
What is working? You won&rsquo;t be replacing your daily driver just yet, but basic computer features are available.</description>
<content><h1 id="mediatek-mainlining-madness">MediaTek Mainlining Madness</h1>
<p>Long time no see! We have a lot to cover, so let&rsquo;s get right into it.</p>
<p>We have two devices booting the mt6765 kernel. The Nokia 3.1 Plus (Roo) and the TCL A3 (bangkok_tf). Out of these two devices, the Nokia 3.1 Plus has better support due to being easier to get logs from.</p>
<h3 id="what-is-working">What is working?</h3>
<p>You won&rsquo;t be replacing your daily driver just yet, but basic computer features are available.</p>
<ul>
<li>postmarketOS rootfs
<ul>
<li>This is the big one. The kernel is able to load the rootfs from an sdcard. It might be able to load from the emmc, but that is untested.</li>
</ul>
</li>
<li>USB
<ul>
<li>Both connection and USB Networking works, allowing for internet connection.</li>
</ul>
</li>
<li>4 CPU Cores
<ul>
<li>These are only half of the cores available on the mt6765, but they are enough for basic initialization.</li>
</ul>
</li>
<li>Haptics
<ul>
<li>I honestly have no idea why these work, but they do. Nice?</li>
</ul>
</li>
<li>SD-Card
<ul>
<li>The mounting of the sdcard and booting of operating systems of of it works.</li>
</ul>
</li>
<li>PMIC Buttons (Hardware Buttons)
<ul>
<li>You can actually click buttons and they do stuff. Wow.</li>
</ul>
</li>
<li>Real Time Clock
<ul>
<li>Basic ARM stuff that nobody cares about.</li>
</ul>
</li>
<li>Thermal
<ul>
<li>The CPU reports thermals of the device to the kernel. It doesn&rsquo;t report the correct values though, so this will require some tweaking.</li>
</ul>
</li>
<li>i2c
<ul>
<li>This was a pain to get working, but it was required for display.</li>
</ul>
</li>
<li>Backlight
<ul>
<li>The screen actually has brightness. Wow.</li>
</ul>
</li>
<li>Flashlight
<ul>
<li>Another one of those: I honestly have no idea why this works.</li>
</ul>
</li>
<li>Charger
<ul>
<li>The battery is able to get voltage higher than what it is discharging and can handle charging correctly. I am unsure if it is able to charge while suspended as we don&rsquo;t have that implemented yet, so just assume it cannot.</li>
</ul>
</li>
<li>EMMC
<ul>
<li>This was a huge surprise to find working. Not even the mt6763 (which the vollaphone uses) has this working. Apparently the SOC handles EMMC in the same way it handles sdcards, so it was just a process of changing around a few values and we got it working.</li>
</ul>
</li>
<li>Framebuffer
<ul>
<li>Simplefb works but causes a huge kernel panic, so it is almost useless for getting logs. It should be possible to fix it through some switching of the dts memory maps, but that is to be seen.</li>
</ul>
</li>
</ul>
<h3 id="upstreaming">Upstreaming</h3>
<p>While I would love to be able to bring these patches to the true mainline Linux kernel, the way that the kernel handles the SOC is just incompatible with the main tree. Maybe in a few years time it would be possible if the code was cleaned up as much as possible, but even then, the dts files for the phones would not be accepted due to bootloader hacks.</p>
<h3 id="postmarketos-upstreaming">postmarketOS Upstreaming</h3>
<p>On the other hand, JustSoup is in the process of writing a kernel package to send upstream to postmarketOS so new ports can make use of this mainline kernel fork. If you are interested in porting a new mt6765/mt6762 device to postmarketOS, keep an eye out for said kernel package, message JustSoup on Mastodon or Matrix, or just ask in the postmarketOS mainlining channel on Matrix.</p>
<h3 id="conclusion">Conclusion</h3>
<p>While this post was short, I hope it was enough to bring some light to our progress here at lowendlibre. If you have any questions, feel free to ask on the Mastodon post.</p>
<p>Until next time!</p>
</content>
</item>
<item>
<title>From Zero to Kernel</title>
<link>http://lowendlibre.github.io/posts/from-zero-to-kernel/</link>
<pubDate>Wed, 09 Aug 2023 20:27:55 -0400</pubDate>
<guid>http://lowendlibre.github.io/posts/from-zero-to-kernel/</guid>
<description>From Zero to Kernel Hi! This is going to be the first real post of the lowendlibre blog, so just bear with me if anything is weird. My name is JustSoup321, the maintainer of the TCL A3 (tcl-bangkok_tf), and-
Alright. I know you just want to hear about postmarketOS, let&rsquo;s get to the good stuff.
Introduction I have been interested in postmarketOS for a long time, have been daily driving it on my Oneplus 6T for about half a year now.</description>
<content><h1 id="from-zero-to-kernel">From Zero to Kernel</h1>
<p><img src="http://lowendlibre.github.io/posts/images/bangkok.jpg" alt="TCL A3 Booting pmOS"></p>
<p>Hi! This is going to be the first real post of the lowendlibre blog, so just bear with me if anything is weird. My name is JustSoup321, the maintainer of the <a href="https://wiki.postmarketos.org/wiki/TCL_A3_(tcl-bangkok_tf)">TCL A3 (tcl-bangkok_tf)</a>, and-</p>
<p>Alright. I know you just want to hear about postmarketOS, let&rsquo;s get to the good stuff.</p>
<h3 id="introduction">Introduction</h3>
<p>I have been interested in postmarketOS for a long time, have been daily driving it on my Oneplus 6T for about half a year now. Safe to say, I love it. Thus, I was interested in getting it working on one of my devices. I chose a tablet I had with an unlockable bootloader. Safe to say, the stock bootloader was so glitchy it overwrote the boot partition and broke it. Although, through that endeavor, I found MTKClient. MTKClient is a really nice tool that allows the user to manipulate MediaTek SOCs to gain access to their partitions and some other nice boot parameters. As such, I was able to unlock my only other MediaTek device that originally had a non-unlockable bootloader, the TCL A3.</p>
<h3 id="counting-kernels">Counting Kernels</h3>
<p>Now, that is amazing, but an unlocked bootloader does not equal a postmarketOS port. No, that was only the beginning. Next I had to find the kernel source in the first place. So I searched and eventually found the <a href="https://github.com/MediaTek-Labs/common-kernel-4.19">MediaTek Common Kernel</a>, which seemed to support my SOC. Of course, this didn&rsquo;t work, so I thought all was lost. Turns out, TCL release their kernels on <a href="https://sourceforge.net/projects/tcl-mobile/files/">SourceForge</a>, so I was actually able to find a kernel for my device.</p>
<p>With the kernel, I could actually begin the porting process. Here is where I met another issue. The kernel doesn&rsquo;t compile. It seems TCL must have either used some kind of proprietary compiler (which, I know, is against GPL don&rsquo;t yell at me) or had some weird glue code. This was very bad. Without a compiling kernel, it was as good as no kernel at all. Thus, I had to put on my best kernel dev hat (they aren&rsquo;t that expensive actually) and get to work.</p>
<h3 id="mo-kernel-mo-problems">Mo&rsquo; Kernel Mo&rsquo; Problems</h3>
<p>Bad news. I don&rsquo;t know C.</p>
<p>I had to use my knowledge of Rust and guesswork to be able to understand what each function does and what is wrong with it. You may ask: &ldquo;why didn&rsquo;t you just mainline if the downstream kernel is broken?&rdquo; Well, little Jimmy (give anyone reading named Jimmy a jumpscare), I couldn&rsquo;t. See, MediaTek mt6762, which the TCL A3 uses, has zero, and I mean ZERO mainline support. There is very basic support for the mt6765, which mt6762 is compatible with, but that isn&rsquo;t enough to get a booting system, let alone find a compatible device tree. No, I had to fix the kernel.</p>
<p>And fix it I did! I was actually able to get the kernel compiling after about 30 hours of work. (I was left with a lot of patches in my kernel folder.) So all I had to do was select the correct DTS, flash, and watch the device bootloop&hellip;</p>
<h3 id="the-dtb">The DTB&hellip;</h3>
<p>That was odd to me. Why using the stock Android kernel with a DTS that is literally named after the device does the device not boot? I checked through kernel configs and I swear I reread every single postmarketOS wiki page 5 times, yet no luck. It wasn&rsquo;t until in the porting Matrix room somebody pointed me to using <code>tar tvf</code> on the Alpine kernel package (which uses .apk and has nothing to do with Android&rsquo;s .apk; are you confused yet?). After doing that, it turns out the kernel was hard-coded to compile with the wrong DTBs.</p>
<p>Why that is and who at TCL decided upon that? We will never know. What we do know is that the device will not boot with a DTB that only has 7 lines in it and is a placeholder. Thus, I needed to figure out how to get the correct DTS to be compiled. I tried editing makefiles, I tried editing kernel options, I even tried using Clang as a compiler. I did have a little success creating a bootimg with the precompiled Android kernel and Android DTB, but nothing worked except the USB being able to say it&rsquo;s serial number is postmarketOS. But still, nothing worked. Nothing. Then I had an idea.</p>
<p>What if I just deleted the offending DTS and renamed the DTS I need compiled to the previously deleted DTS? It was definitely a dirty hack, but it actually worked! The device booted, the postmarketOS splash screen showed up, it found the rootfs, and XFCE4 booted for a moment and then crashed!</p>
<h3 id="if-you-are-lucky-your-screen-may-give-some-clues-that-you-are-booted-into-pmos">&ldquo;If you are lucky, your screen may give some clues that you are booted into pmOS.&rdquo;</h3>
<p>That was to be expected though. Android doesn&rsquo;t use xorg, so it is no surprise that the device isn&rsquo;t very well optimized for it yet. I had to do that manually. So I plugged in my usb cord and fired up ssh and&hellip; it hung. There was no output and I can put no input. I was able to use the password, and ssh did connect to the device, but somewhere along the way the device starts ignoring the usb requests and leaves ssh, both figuratively and literally, hanging. Thus, I couldn&rsquo;t debug at all, and no matter what I tried, I still couldn&rsquo;t get ssh nor telnet (which is just another protocol to get a shell if you don&rsquo;t know what it is) to work. It seems the downstream kernel has a broken usb stack. It barely even works under Android.</p>
<p>Thus, we are now at current day, with my only choice to be mainlining.</p>
<h3 id="conclusion">Conclusion</h3>
<p>This is not the type of posts I have planned for this blog. I am going to be doing more technical posts soon enough, but I thought it best if I started with a full run-down of the process I have gone through. 90 hours of my life spent porting this device, and I am excited for the next 90.</p>
<p>Thanks for reading! Tschüss!</p>
</content>
</item>
<item>
<title>Hello World</title>
<link>http://lowendlibre.github.io/posts/hello-world/</link>
<pubDate>Tue, 08 Aug 2023 21:08:21 -0400</pubDate>
<guid>http://lowendlibre.github.io/posts/hello-world/</guid>
<description>Welcome to the lowendlibre blog! Here we post about our efforts porting mobile Linux distros to a variety of low-end (generally) MediaTek based devices. We mostly focus on postmarketOS for the main porting effort, but we plan to support Mobian and maybe a few other distros. ;) If this interests you, then welcome! Strap in and get ready for a bumpy ride because&hellip;
HERE BE DRAGONS </description>
<content><p>Welcome to the lowendlibre blog! Here we post about our efforts porting mobile Linux distros to a variety of low-end (generally) MediaTek based devices. We mostly focus on postmarketOS for the main porting effort, but we plan to support Mobian and maybe a few other distros. ;) If this interests you, then welcome! Strap in and get ready for a bumpy ride because&hellip;</p>
<h5 id="here-be-dragons"><strong>HERE BE DRAGONS</strong></h5>
</content>
</item>
<item>
<title></title>
<link>http://lowendlibre.github.io/about/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>http://lowendlibre.github.io/about/</guid>
<description>About _ _ _ _ __ __ _ _ | | | | | | | \ \ / / | | | | | |__| | ___| | | ___ \ \ /\ / /__ _ __| | __| | | __ |/ _ \ | |/ _ \ \ \/ \/ / _ \| &#39;__| |/ _` | | | | | __/ | | (_) | \ /\ / (_) | | | | (_| | |_| |_|\___|_|_|\___/ \/ \/ \___/|_| |_|\__,_| Hi!</description>
<content><h1 id="about">About</h1>
<pre tabindex="0"><code> _ _ _ _ __ __ _ _
| | | | | | | \ \ / / | | | |
| |__| | ___| | | ___ \ \ /\ / /__ _ __| | __| |
| __ |/ _ \ | |/ _ \ \ \/ \/ / _ \| &#39;__| |/ _` |
| | | | __/ | | (_) | \ /\ / (_) | | | | (_| |
|_| |_|\___|_|_|\___/ \/ \/ \___/|_| |_|\__,_|
</code></pre><p>Hi! Thanks for checking out the lowendlibre project.</p>
<h3 id="who-are-we">Who are we?</h3>
<p>This project is headed by <a href="https://mstdn.social/@justsoup">justsoup</a> and <a href="https://mstdn.social/@hexaheximal@mastodon.social">hexaheximal</a>. Our main goal is to bring the mobile Linux ecosystem to low-end and generally MediaTek based devices. lowendlibre was founded on July 10, 2023 when our two separate projects merged with the same goal in mind. Linux.</p>
</content>
</item>
</channel>
</rss>