Recently, I was scrolling through Twitter when I came across this tweet, by @HackerFantastic:
Which got me curious. A portable hacking setup in a 2000-era phone by Nokia sounded pretty awesome to me, so I went on eBay and ordered one. When I got it, I started reading about cool stuff I could run on it.
My initial plan was to find/build a version of Kali Linux that could run on the N900, but after researching the options it seemed that a Kali setup won’t be a good idea due to the lack of support for many of the built-in features of the phone (mainly the radios - WiFi, GSM etc).
Therefor, I found myself reading about an open-source project called postmarketOS. PMOS is a linux distro specifically designed for running on mobile phones, and it seems to have a lot of support for the N900 - many of the components of the phone were already implemented, according to the wiki. I decided that this looks good enough - let’s install!
The installation process for pmOS is pretty straight forward:
or… so I thought ☹️
After running the
init script and creating the config, trying to build the image for the Nokia results in an error:
I checked out the issues on the project’s GitLab page, and as they say - timing is everything in life.
Installing pmOS (Thanos Edition)
Let’s start by figuring out what the problem is. As the log tells us, seems like the script can’t find a package that is required for installation. Trying to browse to that URL using a reguler browser (http://postmarketos1.brixit.nl/postmarketos/master/armv7/APKINDEX.tar.gz) does seems to result in a 404. As a matter of face, the entire armv7 folder is inaccessible (Which makes sense, given the above information about armv7 needing a rebuilt).
So what is accessible? Well, if we go just
cd ../.. , we will find that the master branch does in fact hold an armv7 folder. However, trying to run the init script (
pmbootstrap init) tells us that this is an invalid option - since there is no available build for the N900:
So we have a place from which we can get the packages from, however the script won’t allow it.
What now? We have three options here:
- Wait until the problem will be resolved in the stable channel.
- Look into the script and understand what is happing under the hood, understand what is required in order to solve the issue, and fix that problem.
- Hack away.
I went with option 3, obviously.
If we go to the root of the repository, we will find out that this mirror supports replication using the
rsync utility. This is nice - it means we can setup our own repository on the local machine! And if we swap the v20.05 with the master folder, we could trick the script into fetching whatever it needs from this repository instead. How? we will edit our
/etc/hosts file and point
postmarketos1.brixit.nl at our local machine. We will than run a web server on localhost, and voila! - The installation script now fetches it’s files from our machine! I tried it, and it worked…almost.
Still missing packages. Dang.
Asking for help
Afterwards, I tried installing U-Boot (required to boot from the microSD card) using the installer, however…
Another solution was to install using apt-get. Sadly, this required root access and I am but a normal user…oh wait right this is a phone from 2009, before security was a thing. One Google later, and I found out that you can literally install root. Yup:
Amazing. One boot later, and…
This was a wild ride. I think the key takeaways I have from this quest are the following:
- RTFM - I could've spared myself a lot of messing around if only I would've read the issues page right away when I encountered, well, an issue.
- Ask around - My breakthrough was reached when I went out to the IRC to ask the people who actually maintain this project. Not everything needs to be done on a DIY approach, sometimes asking for help can save you quite a bit of time.
- Timing is everything - As I said already, timing is everything. Had I started out three hours earlier, this whole mess would've been averted. But hey, it wouldn't be fun if everything would just work, now would it?