From 24e222045ac511cd4fbb3be66e57eb678a29d854 Mon Sep 17 00:00:00 2001 From: Felipe Lalanne <1822826+pipex@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:09:04 -0300 Subject: [PATCH] Fix support for rsync deltas Rsync (v2) deltas have been broken since [Supervisor v14](https://github.com/balena-os/balena-supervisor/commit/460c3ba0aab31d18a02e3f5dda1838691768c494). While considered legacy, they are still used by a few customers with devices running OS < 2.47.1. This should fix v2 delta support for those devices until we can completely remove rsync deltas from the supervisor Change-type: patch --- entry.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/entry.sh b/entry.sh index ee1459fd..8a95abd2 100755 --- a/entry.sh +++ b/entry.sh @@ -15,6 +15,19 @@ source ./mount-partitions.sh [ -d "${ROOT_MOUNTPOINT}"/tmp/balena-supervisor ] || mkdir -p "${ROOT_MOUNTPOINT}"/tmp/balena-supervisor +# If DOCKER_ROOT isn't set then default it +DOCKER_LIB_PATH="/var/lib/docker" +if [ -z "${DOCKER_ROOT}" ]; then + DOCKER_ROOT="${ROOT_MOUNTPOINT}${DOCKER_LIB_PATH}" +fi + +# Mount the DOCKER_ROOT path equivalent in the container fs +# this is necessary as long as the supervisor still has support +# for rsync deltas +if [ ! -d "${DOCKER_LIB_PATH}" ]; then + ln -s "${DOCKER_ROOT}" "${DOCKER_LIB_PATH}" +fi + # Include self-signed CAs, should they exist if [ -n "${BALENA_ROOT_CA}" ]; then if [ ! -e '/etc/ssl/certs/balenaRootCA.pem' ]; then