From 5280819054a1b9bec319916c0bd2bc88f8f74b8f Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Fri, 5 Jul 2024 17:06:33 -0500 Subject: [PATCH] Mount other directories necessary for flatpak to function --- .../container-only/.wkdev-sync-runtime-state | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/container-only/.wkdev-sync-runtime-state b/scripts/container-only/.wkdev-sync-runtime-state index 06874ee..2320fab 100755 --- a/scripts/container-only/.wkdev-sync-runtime-state +++ b/scripts/container-only/.wkdev-sync-runtime-state @@ -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