Here's some useful tips I collected about Ubuntu Touch. I used for a little, but decided agains it because the version for my Redmi 9 didn't have working Libertine (the Linux app container), making it unable to run Linux apps in the default DE.
I also tried to set up a custom window manager, but the ofono system is pure pain. Would not recommend this OS to the kind of nerd who would install Linux on their phone (wait a minute...)
Making the root partition read-write
Enable temporarily
- Open "System Settings"
- In "About" enable "Developer Mode"
- Install "UT Tweak Tool" from OpenStore
- Open "UT Tweak Tool"
- In the menu (top-left) select "System"
- In "Make image writable" select "[Read-Write]"
I do not recommend enabling this permanently. You should probably add individual writable directories
SSH Access
- Open "System Settings"
- In "About" enable "Developer Mode"
- Install "UT Tweak Tool" from OpenStore
- Open "UT Tweak Tool"
- In the menu (top-left) select "System"
- In "SSH Settings" enable SSH access
Installing packages
- Make the root partition read-write
- Run
sudo apt update - Install using
sudo apt install (package)
Create writable directories in root
- Make the root partition read-write
- Run
sudo nano /lib/systemd/system/(service name, arbitrary).mount - Enter the following:
[Unit] Before=local-fs.target [Mount] Where=(target location) What=/userdata/system-data/(target location) Type=none Options=bind [Install] WantedBy=local-fs.target
- Run
sudo systemctl enable (service name) - Run
sudo systemctl start (service name)
Changing the desktop environment
Note: many Ubuntu Touch ports do not have DRM support, so a lot of DEs will not work
- Make the root partition read-write
- Run
sudo systemctl stop lightdm - Run
sudo systemctl disable lightdm - Run
sudo nano /lib/systemd/system/desktop.service - Enter the following:
[Unit] Description=User Session Starter Conflicts=getty@tty7.service plymouth-quit.service After=systemd-user-sessions.service getty@tty7.service plymouth-quit.service [Service] ExecStart=/usr/bin/su phablet -c (session command e.g. startx) Restart=always [Install] WantedBy=graphical.target
- Run
sudo systemctl enable desktop - Run
sudo systemctl start desktop
Setting up startx
- Make the root partition read-write
- Install xinit
- Set up your .xinitrc
- Edit
/etc/X11/Xwrapper.config - Change
allowed_users=consoletoallowed_users=anybody
The screen turns off after a minute
To fix permanently
- Make the root partition read-write
- Run
sudo rm /lib/systemd/system/lightdm.service
The screen does not update when running an X11 WM
To update the screen once run:
cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode
(as root)
To fix permanently
- Make the root partition read-write
- Run
sudo nano /lib/systemd/system/fb-refresher.service - Enter the following:
[Unit] Description=Fix the screen [Service] ExecStart=/usr/bin/sh -c "while [ ! ]; do cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode; done" [Install] WantedBy=multi-user.target
- Run
sudo systemctl enable fb-refresher - Run
sudo systemctl start fb-refresher
Enable swap
Enable temporarily
- Run
sudo dd if=/dev/zero of=/userdata/swapfile bs=1024 count=(desired size in kilobytes) status=progress - Run
sudo chmod 600 /userdata/swapfile - Run
sudo mkswap /userdata/swapfile - Run
sudo swapon /userdata/swapfile
Enable permanently:
- Make the root partition read-write
- Run
sudo nano /lib/systemd/system/swap.service - Enter the following:
[Unit] Description=Enable swap [Service] Type=oneshot ExecStart=/usr/sbin/swapon /userdata/swapfile RemainAfterExit=yes [Install] WantedBy=multi-user.target
- Run
sudo systemctl enable swap - Run
sudo systemctl start swap
Installing nix and home-manager
Installing nix:
- Create /nix
- Install curl
- Install xz-utils
- Disable writable root
- Run
sudo chown -R phablet /nix - Run
sh <(curl -L https://nixos.org/nix/install) --no-daemon
You might get
ERROR: ld.so: object 'libtls-padding.so' from LD_PRELOAD cannot be codeloaded.
It can be safely ignored. To disable this warning:
- Add
unset LD_PRELOADto the end of~/.bashrc
Installing home-manager:
- Follow the home-manager standalone guide
highghlow