Skip to content

Instantly share code, notes, and snippets.

@Merlin04
Last active September 10, 2020 17:13
Show Gist options
  • Save Merlin04/99433a1eef945ecd944ce58f40dc6b3f to your computer and use it in GitHub Desktop.
Save Merlin04/99433a1eef945ecd944ce58f40dc6b3f to your computer and use it in GitHub Desktop.
Shell script to patch and recompile Phosh for Mobian on PineTab so that the display isn't upside down
#!/bin/bash
echo "This script will install dependencies and compile/install a slightly modified phosh"
echo "Run this script with sudo"
echo "This will install to /usr/local/bin/phosh, the original will be located at /usr/bin/phosh"
if [ "$EUID" -ne 0 ]
then echo "Please rerun as root"
exit
fi
echo "Installing dependencies"
apt install git -y
git clone https://source.puri.sm/Librem5/phosh.git
cd phosh
apt install meson build-essential cmake libgcr-3-dev libgnome-desktop-3-dev libpulse-dev libnm-dev libpolkit-agent-1-dev libsecret-1-dev libupower-glib-dev libpam-dev -y
echo "Applying patch"
wget https://gist.githubusercontent.com/Merlin04/1a7236c1d8bf1d5626535b6800022d74/raw/1f7a713dc584c0108ff7829b339a31847da90321/shell.c.patch
echo "This might produce an error but it should still work"
patch -u src/shell.c shell.c.patch
echo "Compiling (this might take a while)"
meson . _build
ninja -C _build
echo "Installing new version"
ninja -C _build install
echo "Done! Reboot your device to use the new version of phosh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment