Installing postmarketOS on the Nokia N900

PostmarketOS is a touch-optimized, preconfigured Alpine Linux distro for your phone. With support for mainline kernels, this distro may very well become the last OS actively maintained on the N900.

Requirements

 * You must use a GNU/Linux distro. If you don't have a GNU/Linux distro, you can virtualize one with VirtualBox.
 * At least an 8GB microSD card
 * Python 3.4+ and git
 * Nokia N900 with pali's uboot preinstalled

Initialization
First initialize pmbootstrap for building.

git clone https://github.com/postmarketOS/pmbootstrap cd pmbootstrap ./pmbootstrap.py init

Type the device name and a username.

Available (50): amazon-thor, asus-flo, asus-grouper, asus-tf101, fairphone-fp2... Device [nokia-rx51]: nokia-rx51 Username [user]: yourusernamegoeshere

Interface
Choose  or   as the user interface and add video drivers. I prefer mate since it appears to be more stable and looks better

Available user interfaces (6): * none: No graphical environment * hildon: (X11) Lightweight GTK+2 UI (optimized for single-touch touchscreens) * luna: (Wayland) webOS UI, ported from the LuneOS project (Not working yet) * mate: (X11) MATE Desktop Environment, fork of GNOME2 (stylus recommended) * plasma-mobile: (Wayland) Mobile variant of KDE Plasma, optimized for touchscreen * weston: (Wayland) Reference compositor (demo, not a phone interface) * xfce4: (X11) Lightweight GTK+2 desktop (stylus recommended) User interface [none]: mate Additional packages that will be installed to rootfs. Specify them in a comma separated list (e.g.: vim,file) or "none" Extra packages []: xf86-video-vesa,mesa-egl,linux-firmware

Flashing onto the sdcard
Finally, install postmarketOS onto the microSD card.

./pmbootstrap.py install --sdcard=/dev/sdX
 * 1) Replace sdX with the location of your sdcard device
 * 2) To disable full disk encryption add --no-fde

Boot

 * Now boot up postmarketOS by plugging in the sdcard and booting with the keyboard slide open.
 * Select u-boot shell and enter

SSH through USB
SSH is incredibly important for setting up postmarketOS since

During installation, you choose whether you wanted to upload your private keys so you could connect to your device securely. If you do not have an ssh private key, it is strongly recommended that you generate and upload one.

To connect, make sure your n900 was unplugged during boot, plug it into the computer you will ssh from, and connect with:

ssh yourusernamegoeshere@172.16.42.1

Touchscreen
As a result of Linux kernel mainlining, the touchscreen was renamed from TSC200X to TSC2005 likely causing an inversion of the y-axis.

export DISPLAY=:0.0

Setting the id number of the  property to   flips the y-axis.

xinput --set-prop --type=int "TSC2005 touchscreen" "Evdev Axis Inversion" 0 1

Keyboard Configuration
By default, the most UIs will use their own  layout which makes it impossible to type certain important characters on the keyboard, thus making it essentially useless when using a terminal.

To switch keyboard layouts, use setxkbmap to set the keyboard to the  layout.

setxkbmap -rules evdev -model nokiarx51 -option grp:ctrl_shift_toggle -layout us,cz -variant ",qwerty"

Wifi
The wifi service should already be running on boot, just create a wpa_supplicant config file and place it in  and restart the service.

$ sudo su 
 * 1) wpa_passphrase $YOUR_SSID > /etc/wpa_supplicant/wpa_supplicant.conf
 * 1) rc-service wpa_supplicant restart
 * 2) exit

Audio
Sound modules are ready to use, and the speaker is set to on by default. To use headphones you must turn on the headphones using  and shut the speakers off.