I have been looking into putting a better OS on my phone, I am already comfortable with Linux and I really like what I have heard about PureOS.
So can I put PureOS on another phone?
Simple answer: No
Longer answer: Not because Purism or anyone else doesn’t want you to do that but because of the complexity and impenetrability of the task.
As a hypothetical case study, let’s say you want to put PureOS on your iPhone (how I would like to do that!).
First challenge: You would need to understand and have documentation for the boot environment.
The boot environment would have to be "unlocked " so that you could even install and boot software other than what the manufacturer forces up on you.
If the “disk” from which you are booting is not compatible with the boot disk in the Librem 5 then you would also need driver code for that disk.
Next challenges: You will need open source drivers for all the other hardware components and yet there is no publicly available documentation from Apple (intentionally so), let alone any open source code.
If I know Apple, probably eventually the CPU in the iPhone won’t even be fully ARM-compatible.
This really only scratches the surface. It would be a major undertaking.
Is it actually impossible? If the bootloader is locked, it might literally be impossible. Otherwise no it’s not impossible, just very difficult.
This might be more practical with some phones than others. For example, if the phone already has ports of other open source operating systems, you are more likely to succeed. If your starting point were an unlockable Android phone that already has ports, this would be much friendlier than the iPhone example that I deliberately used above for illustration purposes.
I would suppose that the majority of the code in PureOS would work unchanged. It’s just the nasty bits at the lower level that directly deal with the hardware.
If you are genuinely interested in going down this path, a good starting task would be to download the entire PureOS source, build it and install it on your Librem 5. Then make a minor cosmetic change to the source and repeat the build and install.
You can in principle install PureOS on another phone, if the phone manufacturer at least provides documentation and specs for the hardware. The only other phone fitting here is Pinephone, and it can run PureOS. See here how it differs from Liberm 5: Comparing specs of upcoming Linux phones.
Librem / Other OSes
I guess category “PureOS” fits better for this topic.
Well actually yes because most other manufacturers don’t want you to run PureOS (or any other OS than what they shipped). That’s why they release no documentation, and why they often lock their hardware altogether.
Then there’s open phones, where it becomes a question of “who’s going to do the work”. Sadly, EBBR is still not a widespread platform (guilty as charged).
People have been installing PureOS on the PinePhone. See: https://pizzalovingnerd.com/pinephone-oses-pureos/
Clover, who was maintaining the PureOS port for the PinePhone, has stopped working on it, but he says that he will start working on it again with Byzantium. See: http://forum.pine64.org/showthread.php?tid=9361&page=9
However, you can basically get PureOS by installing Mobian on the PinePhone. Mobian is based on Debian just like PureOS, and both use the Phosh mobile interface. Mobian preinstalls a few more apps than pureOS, but the Mobian developers participate in the development of Phosh, and Purism recently hired one of the Mobian developers, so if you want PureOS on the PinePhone, you should install Mobian.
The issue is that Qualcomm, MediaTek, Samsung and UNISOC only provide Android drivers for their Snapdragon, Helio/Dimensity, Exynos and Tiger processors, so most phones don’t have a processor that can run on mainline Linux drivers. In contrast, NXP, Allwinner, Amlogic, Rockchip, Broadcom and Nvidia release both Android and Linux drivers for their ARM processors, but their processors aren’t generally used in phones (the Librem 5 and PinePhone are the exception).
Many Snapdragon and some Exynos processors do eventually get supported in mainline Linux 2-4 years after they are released, but it takes a while for the community to take the source code that Qualcomm releases on CodeAurora and Samsung releases and adapt it to work in mainline Linux. Check out PostmarketOS’s pages on mainlining Exynos processors and mainlining Snapdragon processors. Once a phone’s processor starts to be supported in mainline Linux, then projects like PostmarketOS can start working on porting their OS to it, and PostmarketOS supports many interfaces, including Phosh, so you can run something like PureOS on your phone (although PostmarketOS is based on Alpine, so it pretty different from Debian derivatives).
The other option is to use the Android kernel and drivers provided by the SoC manufacturer, and then use libhybris, so that the standard Linux stack can run on top of it. Ubuntu Touch, Sailfish OS and WebOS/LuneOS use libhybris (and Plasma Mobile used to), so they can be installed on existing phones. Another option is to fork glibc to make it run on the Android kernel and drivers (which is what Google did by forking OpenBSD’s libc to create Bionic). The problem is that then you are dependent on the phone manufacturer to release updates, and most SoC’s for mobile phones are only supported for 2.5-3.5 years.