Skip to content

Commit

Permalink
Mount other directories necessary for flatpak to function
Browse files Browse the repository at this point in the history
  • Loading branch information
TingPing committed Jul 5, 2024
1 parent 2cfd45f commit 5280819
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions scripts/container-only/.wkdev-sync-runtime-state
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,24 @@ try_mount_host_pipewire() {
}

mount_host_flatpak_instance_data() {
local host_flatpak_instance_dir="/host/run/.flatpak"
local container_flatpak_instance_dir="${XDG_RUNTIME_DIR}/.flatpak"

# WebKit's sandbox writes to this directory for xdg-desktop-portal to read
# WebKit's sandbox writes to .flatpak for xdg-desktop-portal to read
# our bwrapinfo.json file from to map PIDs. This works as our podman container
# is not in its own pidns.

if [ -d "${container_flatpak_instance_dir}" ]; then
rm -r "${container_flatpak_instance_dir}"
fi
# The others are just needed for flatpaks to function in general.

for dir in '.flatpak' '.flatpak-helper' 'doc'; do
local host_flatpak_instance_dir="/host/run/${dir}"
local container_flatpak_instance_dir="${XDG_RUNTIME_DIR}/${dir}"

if [ -d "${container_flatpak_instance_dir}" ]; then
rm -r "${container_flatpak_instance_dir}"
fi

mkdir --mode=0700 --parents "${host_flatpak_instance_dir}"
ln -s "${host_flatpak_instance_dir}" "${container_flatpak_instance_dir}"
mkdir --mode=0700 --parents "${host_flatpak_instance_dir}"
ln -s "${host_flatpak_instance_dir}" "${container_flatpak_instance_dir}"
done
}

# Main functionality
Expand Down

0 comments on commit 5280819

Please sign in to comment.