This document describes how to use FUSE OverlayFS to link your global Firefox installation with the PWAsForFirefox runtime.
- Your OS uses systemd.
- Firefox is installed (without Snap or Flatpak).
fuse-overlayfs
is installed (instructions below).
sudo apt-get install fuse-overlayfs
sudo pacman -S fuse-overlayfs
sudo dnf -y install fuse-overlayfs
sudo yum -y install fuse-overlayfs
sudo zypper install fuse-overlayfs
-
Copy the provided
firefoxpwa-runtime-overlayfs.service
to$HOME/.config/systemd/user
.With CURL:
mkdir -p $HOME/.config/systemd/user curl https://gist.githubusercontent.com/filips123/29fb511a01ee8016a927a614f32979d3/raw/0987fde6dd9b15283014f22a3d9b3f90a36431fc/firefoxpwa-runtime-overlayfs.service -o $HOME/.config/systemd/user/firefoxpwa-runtime-overlayfs.service
With Wget:
mkdir -p $HOME/.config/systemd/user wget https://gist.githubusercontent.com/filips123/29fb511a01ee8016a927a614f32979d3/raw/0987fde6dd9b15283014f22a3d9b3f90a36431fc/firefoxpwa-runtime-overlayfs.service -O $HOME/.config/systemd/user/firefoxpwa-runtime-overlayfs.service
-
Modify
AssertPathIsDirectory=
andlowerdir=
paths to point to your normal Firefox runtime. This is commonly/usr/lib/firefox
:export FIREFOX_RUNTIME=/usr/lib/firefox sed -i -e "s|%RUNTIME-PATH%|$FIREFOX_RUNTIME|" $HOME/.config/systemd/user/firefoxpwa-runtime-overlayfs.service
-
Create an empty runtime directory:
mkdir -p $HOME/.local/share/firefoxpwa/runtime
-
Install and enable the service:
systemctl --user enable --now firefoxpwa-runtime-overlayfs.service
-
Check that the runtime overlay was installed correctly.
-
Enable "Always patch runtime and profile" in the extension settings.
You can make an equivalent script which runs when you log in (a form that is run as the logged in user is preferred). This section will try to be POSIX-compliant to help the most people.
When preparing the script, make sure to:
-
Create an empty runtime directory:
mkdir -p $HOME/.local/share/firefoxpwa/runtime
-
Enable "Always patch runtime and profile" in the extension settings.
When logging in, your script should:
- Create
upper/
andwork/
directories under$XDG_RUNTIME_DIR/firefoxpwa/overlayfs
.$XDG_RUNTIME_DIR
may be substituted for any tmpfs, ramdisk, or equivalent ephemeral directory if/run/user/$(id -u)
is not used by your OS. - Run
fuse-overlayfs -f -o squash_to_uid=$(id -u),squash_to_gid=$(id -g),lowerdir=%RUNTIME-PATH%,upperdir=$XDG_RUNTIME_DIR/firefoxpwa/overlayfs/upper,workdir=$XDG_RUNTIME_DIR/firefoxpwa/overlayfs/work $HOME/.local/share/firefoxpwa/runtime
, replacing%RUNTIME-PATH%
with the path to your normal Firefox runtime.
When logging out, your script should:
- Run
fusermount -u $HOME/.local/share/firefoxpwa/runtime
to unmount the runtime overlayfs. - Destroy the
upper/
andwork/
directories, or leave them if your OS destroys them for you.