Resisting software driven hardware obsolescence

Resisting software driven hardware obsolescence

Considering the sheer volume of mobile phones, and the high greenhouse gas emissions resulting from their manufacture, it is imperative to extend their useful life by several decades. What would it take?

Hardware obsolescence

Computer hardware, which includes phones and IoT devices, exists to run software. When hardware becomes obsolete, it is therefore often because the software is no longer supporting it. There are of course other reasons for hardware obsolescence such as changes in standards (e.g. very soon 3G phones will be obsolete because there will be no 3G networks left), or fashion (it has the wrong colour, is considered too big/too small, the camera is not good enough, …). Addressing this requires a change in consumer attitudes. And of course the hardware can fail or break, and not be repairable at the moment. The EU directive on repair of goods will come into force next year and will go some way to address physical hardware repairs. It requires amongst other things at least 7 years availability of spare parts for most common repairs. What is also very interesting is that it comes with a mandatory Repairability Index and Energy Efficiency Index.

I will focus on software driven hardware obsolescence of mobile phones, but the problem exists for other hardware (e.g. laptops, TVs,…) as well.

Extending phone lifetimes to reduce emissions

Currently, most users replace their phones after two to three years. However, most of the greenhouse gas emissions related to phones are incurred during their manufacturing. To minimise the overall emissions, phones should be used for much longer. According to the European Environmental Bureau report “Coolproducts don’t cost the Earth” (from 2019):

from a global warming perspective our phones should last at least 20 years longer than they currently do

For a phone to last 20-25 years, there would be a need for hardware repairs, and the device would have to designed for repairability. At the very least, the battery should be replaceable. But that is not enough. Current devices typically get 4 years of software updates. The EU directive on repair of goods requires at least 5 years. Recently, both Apple and Samsung have increased after-sales software update support to 7 years, which is a considerable improvement and hopefully indicates a trend of users holding on to their phones for longer, but is still not long enough by far.

The result of the short replacement cycles is that there are lots of perfectly good phones out there, if you don’t mind being behind the curve. Buying a used phone means prolonging that phone’s useful life and avoiding manufacturing of a new phone, so it is a good way to reduce emissions.

Ideological detour

I don’t mind being “behind the curve” at all. The curve is a scoial construct created to make you replace your technology early. My previous phone was from 2011 and it lasted until about 2022, when the USB connector finally failed completely. I moved on to an old iPhone which I got from a colleague, until the physical buttons on that one started to fail. Now I have a used phone from 2017. It’s an Android phone but I have not created a Google account on it. I use my phone effectively as barely more than a dumb phone. I don’t have a contract and I very rarerly use data, positioning, Bluetooth or even Wifi. I find there is no need. I also often walk around without a phone. It is hard to avoid all interaction with the likes of Google and Apple, but I don’t have to play their game.

Upgrading the phone software

Older phones will be running older software versions and therefore be of limited use. One option is to install a newer operating system on the phone (more on the terminology later). This is possible for Android devices (and also old Windows phones) but not for Apple devices.

Upgrading the phone software means upgrading the operating system. The operating system is the software that makes it possible to make phone calls, use wifi or bluetooth, run apps etc.

Android, AOSP, LineageOS, /e/

Android is an operating system for mobile phones. It is developed by the Open Handset Alliance, led by Google. The core system is known as the Android Open Source Project (AOSP) and is free/open-source software. Alternatives such as /e/ or LineageOS are based on AOSP and typically support a more recent version of Android.

Even though AOSP is technically free and open, Google drives the development as they have the contracts with the phone makers. If Google would disappear, AOSP and therefore LineageOS and /e/ would no longer progress. Not that this is to my mind a big issue, but it is important to realise that the phone makers will always rely on a large company to provide their OS, rather than on an open soource project, unless such a project would have the backing of a powerful entity (for example, if the EU would sponsor AOSP, it could exists independently of Google).

In an ideal world, upgrading to LineageOS or /e/ or any such alternative would be supported as part of the regular update mechanism of your phone: when the commercial software support is discontinued, you would be given to option to upgrade to an open source variant. In the real world, as the phone manufacturers profit from the short replacement cycles, this is not the case. As a result, while it is techically possible to upgrade the phone software, the process is not seamless. There are many barriers to upgrading your phone.

Terminology

First of all there is the terminology, which speaks of “ROMs”, “flashing”, “sideloading” and a lot besides.

“ROM” stands for Read-Only Memory, but “a ROM” means the file that contains the software to run on your phone. In the olden days, the system software of a computer would be stored in ROM memory.

A phone has internal storage. Part of this storage is used for the operating system. On Samsung phones this is software called Android, as mentioned above this is effectively made and controlled by Google.

“Flashing” derives from “flash memory”, a kind of non-volatile memory that can be erased in a flash. The typical storage in a phone is a kind of flash memory, and “flashing” is the process of writing the ROM in the appropriate locations on that storage.

Tools

When you search on line, you will come across a bewildering array of tools that are all used in the process of upgrading a phone, for example Odin, Fastboot,Freya,OrangeFox, Heimdall, TWRP, adb, Magisk, and many more besides. You only need a few of them, but finding the right ones can be hard.

Finding the right version for your phone

Different models of phones run a slightly different variant of the operating system, even for same verions of Android, because they have slightly different specifications. You have to find the exact version of the software for your phone or the upgrade will fail. (This is changing through the move towards what is called “Generic System Image”, a single ROM that works on many devices, but as far as I can tell neither LineageOS nor /e/ are using this approach yet.)

Just finding out exactly what device you have is not trivial. Consider even the bluff old “Samsung Galaxy A3”. It is not simply that: at the very least it is a “2016” or “2017” (and the difference is not apparent); and the “2017” can be a SM-A320 F,FL, FL/DS, Y or Y/DS; the “2016” has 10 different models. And the “ROM” you need for it will have yet another name.

The upgrade process

Let’s suppose you identified your phone, found a ROM and found appropriate versions of all the tools. What’s next?

To replace the operating system, the phone has a special “recovery mode”, which the user can activate by pressing specific keys. In this recovery mode the phone runs special “recovery” software that can install updates and wipe data. This is what the engineer in the shop uses when your phone is “bricked” because of a software problem.

It is possible to replace this recovery software by different software that can be used to install a different operating system on the phone. For this, the phone has a “download mode”, again activated by pressing specific keys. In that mode, when the phone is connected to a computer, yet another a special program on the computer can install this new recovery software, which can then be used to install the new operating system. Some phones have a “fastboot” mode which has a similar purpose.

In my case, the alternative recovery software I used is called TWRP; the program running on my laptop to install this new recovery software is called Heimdall, the program to install the new operating system is called adb and the new operating system itself is called LineageOS. So what I had to do is to find the correct versions of TWRP and LineageOS for my phone, as well as versions of Heimdall and adb that would work with those, and then carefully follow instructions – and hope for the best.

Case Study: LineageOS on a Samsung Galaxy A3

What is to be gained?

The most recent version of LineageOS I found for the Samsung Galaxy A3 2017 is LineageOS 19.1. This version corresponds to Android Open Source Project version 12.1. The phone came with Android 6.0.1, upgradable to Android 8, so the LineageOS version is four generations more recent. Official Android security updates for this model in stopped 2021. LineageOS stopped updates for 19.1 on officially supported devices in 2024. The Samsung Galaxy A3 2017 was never officially supported, but beggars can’t be choosers. Meanwhile, LineageOS is at 23 and AOSP at version 16, so the updated device is still four generations behind, but that is still better than eight generations. For example, UK Government apps work on anything from Android 10 upwards. (They are only available on Google Play but that’s another story.)

In any case, the limited support (both from Google and from LineageOS) is an organisational decision, it is not because of any device limitations. Ironically, the Samsung Galaxy A3 2016 is supported by AOSP up to version 13. But in principle, they could be supporting the most recent version, even on much older devices. Maybe we’ll live to see that day.

Why do this at all?

The main reason for this experiment was to see what the skills and knowledge are that are needed to do this.

The actual experience

Frankly, it was a bit of a nightmare.

First I tried OpenAndroidInstaller, “The graphical installer that makes installing alternative Android distributions nice and easy”. It runs on Windows and Linux. I am using the Ubuntu flavour of Linux, and installation was easy, but to run it I still needed to open a terminal and type

flatpak run org.openandroidinstaller.OpenAndroidInstaller

First hurdle was that it turned out I had the wrong version of LineageOS (“ROM”). I had searched for “lineageos samsung galaxy A3” and, after some persevering, found the “latest unofficial release” (the “latest official release” was no longer there). Turns ot this file is for a3xelte (i.e. the 2016 version of the A3) and I needed a3y17lte (because it turned out at that point that my device was a 2017 A3). I found lineage-19.1-20220904-UNOFFICIAL-a3y17lte.zip and I also found twrp-3.7.0_9-0-a3y17lte.img, so all was well.

Then it got stuck because of insufficient permissions on the USB device. Thank you, detailed log info! OK, I know how to use sudo and chmod, so I fixed that.

Then it got stuck at the actual OS installation, detailed log said adb -d wait-for-recovery, and waiting it did, forever, because by the time it issued that command the phone was already past the recovery stage. How a simple race condition can throw a spanner in the works. So that was the end of my attempt using the OpenAndroidInstaller. I don’t want to blame the project, It is a really good effort to make things easier. They listed this phone under “Officially supported devices” as “tested”, so it is a bit odd that it did not work for me.

My next attempt was to use TWRP (version twrp-3.7.0_9-0-a3y17lte). I used the “adb sideload” method as explained on the LineageOS wiki. I found it very hard to find this info on the wiki. There is no support for the A3 2017 but there is for the A3 2016, but even that is not official so there is no link there from the landing page.

I did all the wiping etc. using TWRP as instructed, enabled adb sideload, issued

adb -d sideload  lineage-19.1-20220904-UNOFFICIAL-a3y17lte.zip

And that failed, “E2001: Failed to update vendor image.”

Some more internet searching got me both the explanation and the solution, after a fashion.

The problem is that the ROM expects a vendor partition and this was not present. This is because a crucial difference between the A3 2016 and A3 2017: Google introduced Project Treble, a major change to the Android OS to make it easier and faster for manufacturers to update devices to a new version of Android. Crucially, this involved the introduction of a new partition called “vendor”. The factory version of the A3 2017 doesn’t have this, as it predates this change. So the solution is to add this partition and the poster provided a script to do this.

The explanation of how to use the script was “Flash attached zip file”. It did not specify how to flash it. I flashed it with Heimdall, and it did not work. At this point the phone was a brick: it had been wiped completely. I could not get back into the recovery mode or even switch it off.

I re-flashed TWRP and could get back into recovery mode when connected to USB. The phone showed up on my computer so I copied the repartitioner_a3y17lte.zip file to it and ran the script using TWRP’s “Install” function.

This worked, but it installed an older version of TWRP in the process, and on that version, adb sideload did not work.

I found a more recent version of TWRP with support for the vendor partition and flashed that using Heimdall. Now I could finally sideload the actual LineageOS zip file using adb, and it worked.

Required skills and knowledge

I think the most important skill needed to successfully upgrade a phone when things don’t go smoothly is debugging. This is not something you can teach quickly, it is a skill acquired through practice. You need to formulate a hypothesis of what went wrong, and try to test it and then remedy it. But to do that requires an understanding of what is supposed to happen, and that in turn requires an understanding of the overall system and the tools.

In my case, I needed to know how to install and use a series of command-line tools. Without an understanding of what partitions are, I would not have been able to solve the problem as I would not have understood the proposed solution. I also needed to know how to deal with Linux device permissions.

If I hadn’t found that handy partition script, I would have had to repartition the disk myself. This requires quite a bit of detailed Linux knowledge as it is a very critical step.

Finally, if my phone was not supported, e.g. if I wanted the most recent version of LineageOS on it, I would have to change LineageOS software to work with my phone. This requires detailed knowledge and understanding of both the phone hardware and the Android operating system. Android is based on Linux, so it also requires detailed knowledge and understanding of the Linux kernel, which is the part of the operating system that interfaces with the hardware. It also requires familiarity with the process to create a ROM. And it requires programming skills.

If we were serious about the circular economy, we should train the specialists to install upgrades. I think this should not take more than a week. Training the developers of the upgrades would of course take a lot longer, but there might not really be a need. It would be more important to ensure they are properly paid. In this way we would get more recent upgrades, as developers would be paid to create and support them, as well as professionals to install them. In this way anyone could easily prolong the life of their phones through software upgrades.

The banner picture shows a very blurry picture of person seen from the back, on the phone in a busy street.