Skip to content

Commit

Permalink
init: fix runtime sync fallback
Browse files Browse the repository at this point in the history
Example: distrobox create -i ubuntu:18.04 -n ubuntu18
  • Loading branch information
xz-dev authored Nov 27, 2024
1 parent 18053c2 commit 82c823c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -1777,8 +1777,9 @@ for host_mount_ro in ${HOST_MOUNTS_RO}; do
printf "Warning: %s integration with the host failed, runtime sync for %s disabled.\n" "${host_mount_ro}" "${host_mount_ro}"
# Fallback options for files, we do a hard copy of it
if [ -f /run/host"${host_mount_ro}" ]; then
rm -f "${host_mount_ro}"
cp -f /run/host"${host_mount_ro}" "${host_mount_ro}"
if ! (rm -f "${host_mount_ro}" && cp -f /run/host"${host_mount_ro}" "${host_mount_ro}"); then
printf "Warning: Hard copy failed. Error: %s\n" "$(cp -f /run/host"${host_mount_ro}" "${host_mount_ro}" 2>&1)"
fi
fi
fi
done
Expand Down

0 comments on commit 82c823c

Please sign in to comment.