Running postmarketOS on a Nokia N900
5 min read

Running postmarketOS on a Nokia N900

My advantures trying to install postmarketOS on a Nokia N900
Running postmarketOS on a Nokia N900

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.

postmarketOS

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!

Installing pmOS

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.

I picked the wrong day to receive that phone 🙃

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:

Dude where's my N900?
Dude where's my 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:

  1. Wait until the problem will be resolved in the stable channel.
  2. 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.
  3. 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.

rsyncing to the incorrect path on purpose
rsyncing to the incorrect path on purpose
Fooling the script to use a local server

Still missing packages. Dang.

Asking for help

I was about to give up and wait, but than I entered pmOS’s IRC channel and asked around, and I got a tip - this page. I downloaded one of the images, and burned it onto my microSD using Etcher:

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…

Booting...
Booting...
Victory!
Victory!

Conclusion

This was a wild ride. I think the key takeaways I have from this quest are the following:

  1. 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.
  2. 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.
  3. 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?