Monsters that you can summon by performing the alchemical process of turning an old brick into a magnificent server.
Published on April 07, 2024 by Tomek Tomasik
Node.js Termux TWRP Android SuperSu Magisk nginx CORS LineageOS Acme.sh Certbot ADB DNS DDNS SSL
Mighty adventures you can experience, being someone like me.
Reading this post may help you avoid some of the problems if you ever decide to convert an old phone into a server. I did it because I am crazy. Don’t be like me.
While trying to get my vintage LG G2 d802 to work as a server, I stumbled across a few difficulties that consumed several hours of time, which I am perpetually short of. The first obstacle was a damaged display, which meant I had to use a mouse during the initial setup (luckily it already had USB OTG). In addition, the phone had a screen lock on (pattern). It was returned to me in this condition, by the previous owner. I did not want to do a hard reset to avoid losing data. The phone had debug mode disabled and could not be seen through ADB. It dawned on me that the phone should have TWRP installed. So I finally pressed the magic combination used for a hard reset (volume down + power on a turned-off phone and pressing power again when the logo appears). I selected the restore option and…. eureka! To my eyes appeared the TWRP logo. I ran TWRP’s file explorer and deleted several files responsible for storing the screen lock.
I restarted the phone and the lock did not appear. I made a copy of the phone’s contents and this time performed a hard reset.
From that point on, it should have been smooth sailing… or so I thought. Another obstacle was the Android version itself: 5.0.2 “Lolipop.” This was the latest version the manufacturer had released. Unfortunately, the Termux, to work properly, needs Android version at least 7.0. And here I made my first major mistake. Instead of trying to upgrade the Android, I decided to install a relic version of Termux. After running it, it turned out that half of the packages did not work, or would not download…. There was no way out, there had to be some way to update the Android…. I searched the forums and found a promising candidate, it was LineageOS. However, it turned out that the developers no longer supported the system for the LG G2 and removed the files from the site. However, XDA did not fail and I managed to find a man who was developing the project on the side. I found what I wanted, but Intuition told me not to install the latest version on such an old phone. I chose Lineage OS version 15.1 with Android 8.1.0, which was one of the few good decisions I made during the process. In order to install Lineage I needed to update TWRP to version 3.3.1-0. I downloaded “some” version and tried to install, unfortunately, an error appeared during the process.
The phone caught a bootloop, and I already knew that I had turned it into a brick. That was indeed the case. Normally I would have thrown it out the window, unfortunately I have a grille in it (did I tell you I’m crazy?), so there was another problem to solve. I had to go to the basement to get a hacksaw. It turned out that I was too lazy to get up from my chair and fatigue myself to get the tools, so I decided to resurrect the ill-fated phone. Fortunately, after removing the lock, I enabled developer mode and debugging and made sure the phone had root (Super SU). This allowed me to complete the next steps. There was nothing left for me to do but to find and install the drivers for the chip (Qualcomm) and expect to detect it in a state that would save me from taking the phone apart and making a jumper.
After connecting the phone via USB, a million partitions appeared in the system, and happily the chipset signature indicated grace. All that was left was to run SRKtool_2.0 and run the repair process, after which I was able to (finally) install a working TWRP and LineageOS and again root the phone, this time using the MAGISK package.
The next steps I took are described in this post.
Several configurations still need to be done to get the server working properly and allow it to handle queries.
That’s all, you may have found tips here that you found useful. With this post, I wanted to point out that every process is fraught with pitfalls and can create problems, but problems are something we deal with more easily every time. It is something inevitable. It’s time for you to like them.