Running postmarketOS on any Andrid devices without rooting or flashing custom ROM.
1. Prerequisites#
- Termux
- Termux X11
- Hacker’s keyboard if you don’t have keyboard and mouses.
2. Install Proot Alpine Linux#
The Stable Channel version number of postmarketOS can be found in Wiki. Currently it is v22.12.
The defaut installation of Proot Apline in Termux uses Edge repositories. However the Edge branch is very unstable, therefore I choose 3.17 (postmarketOS v22.12)
- Install Proot Alpine Linux
pkg update
pkg install proot-distro pulseaudio
echo "pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 && pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1 " >> .profile
proot-distro install alpine
- Change repositories to v3.17
proot-distro login alpine --shared-tmp
apk add vim
vim /etc/apk/repositories
# Change "http://dl-cdn.alpinelinux.org/alpine/edge/main" to "http://dl-cdn.alpinelinux.org/alpine/v3.17/main"
apk update
apk upgrade
- Add a user and setup timezone.
apk add sudo
addgroup storage
adduser -g wheel,storage,video,audio user
visudo
passwd
sudo ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime
sudo setup-timezone
- Enable sshd in Termux proot.
sudo vim /etc/ssh/sshd_config
# Change `Port` from 22 to 8023
ssh-keygen -A
/usr/sbin/sshd
echo "/usr/sbin/sshd" >> /home/user/.profile
# Check IP address
ip addr
3. Convert Alpine installation to postmarketOS#
- Add postmarketOS v22.12 (Alpine v3.17) repositories
vim /etc/apk/repositories
# Add this:
https://mirror.postmarketos.org/postmarketos/v22.12
- Add postmarketos-keys
apk add -u --allow-untrusted postmarketos-keys
apk update && apk upgrade
- Add following lines to
/etc/os-release
PRETTY_NAME="postmarketOS v22.12"
NAME="postmarketOS"
VERSION_ID="v22.12"
VERSION="v22.12"
ID="postmarketos"
ID_LIKE="alpine"
HOME_URL="https://www.postmarketos.org/"
SUPPORT_URL="https://gitlab.com/postmarketOS"
BUG_REPORT_URL="https://gitlab.com/postmarketOS/pmaports/issues"
LOGO="postmarketos-logo"
4. Install Deskop Environment#
To launch a desktop Environment in Termux proot, execute the following commands:
proot-distro login --user user --shared-tmp
: Log into Proottermux-x11 &
: Start X serverexport DISPLAY=:0
dbus-launch --exit-with-session <desktop environment> &
: Start desktop environment
Traditional desktops, such as XFCE and LXQT work in proot environment; nevertheless I want to try mobile-friendly interfaces, let’s see the results.
Phosh#
Phosh is a fork of GNOME, optimized for mobile devices.
The package name is postmarketos-ui-phosh
.
The startup command is phosh-session
. Not working. Maybe the X11 beckend flag needs to be passed?
Plasma Mobile#
The packae name is postmarketos-ui-plasma-mobile
.
It can be launched by executing dbus-launch --exit-with-session startplasma-x11 &
Login screen works, but it turns black after login.
BTW, in 2022, I had successfully started Plasma Mobile in Proot Arch Linux (the package plasma-mobile
is available on AUR); however it was very unstable.
SXMO#
The package name is postmarketos-ui-sxmo
but Termux X11 only support X applications so I choose postmarketos-ui-sxmo-de-dwm
.
- Install SXMO packages
sudo apk add postmarketos-ui-sxmo-de-dwm postmarketos-tweaks-sxmo-x11 feh dwm svkbd conky clickclack
Execute:
export XDG_RUNTIME_DIR=/tmp
before launching SXMO.SXMO can be launched by executing
dbus-launch --exit-with-session /usr/bin/sxmo_xinit.sh &
The configuration files of SXMO is located at
~/.config/sxmo/
. Hooks are at/usr/share/sxmo/default_hooks/
.
Gestures are not working.
You may modify dwm source code to change default keybindings.
git clone [email protected]:~mil/sxmo-dwm
# Modify config.def.h then reinstall dwm
Uninstall sxmo-dwm
package before installing your cutsom dwm.
Or you can just install vanilla dwm
package and use default dwm keybindings.