Browse Source

Don't move docker at ota

reccomended-parts-fix
Luke Childs 4 years ago
parent
commit
ca6ac88609
  1. 68
      scripts/update/01-run.sh

68
scripts/update/01-run.sh

@ -123,40 +123,40 @@ cd "$UMBREL_ROOT"
# Move Docker data dir to external storage now if this is an old install. # Move Docker data dir to external storage now if this is an old install.
# This is only needed temporarily until all users have transitioned Docker to SSD. # This is only needed temporarily until all users have transitioned Docker to SSD.
DOCKER_DIR="/var/lib/docker" # DOCKER_DIR="/var/lib/docker"
MOUNT_POINT="/mnt/data" # MOUNT_POINT="/mnt/data"
EXTERNAL_DOCKER_DIR="${MOUNT_POINT}/docker" # EXTERNAL_DOCKER_DIR="${MOUNT_POINT}/docker"
if [[ ! -z "${UMBREL_OS:-}" ]] && [[ ! -d "${EXTERNAL_DOCKER_DIR}" ]]; then # if [[ ! -z "${UMBREL_OS:-}" ]] && [[ ! -d "${EXTERNAL_DOCKER_DIR}" ]]; then
echo "Attempting to move Docker to external storage..." # echo "Attempting to move Docker to external storage..."
cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json # cat <<EOF > "$UMBREL_ROOT"/statuses/update-status.json
{"state": "installing", "progress": 72, "description": "Migrating Docker install to external storage", "updateTo": "$RELEASE"} # {"state": "installing", "progress": 72, "description": "Migrating Docker install to external storage", "updateTo": "$RELEASE"}
EOF # EOF
#
echo "Stopping Docker service..." # echo "Stopping Docker service..."
systemctl stop docker # systemctl stop docker
#
# Copy Docker data dir to external storage # # Copy Docker data dir to external storage
copy_docker_to_external_storage () { # copy_docker_to_external_storage () {
mkdir -p "${EXTERNAL_DOCKER_DIR}" # mkdir -p "${EXTERNAL_DOCKER_DIR}"
cp --recursive \ # cp --recursive \
--archive \ # --archive \
--no-target-directory \ # --no-target-directory \
"${DOCKER_DIR}" "${EXTERNAL_DOCKER_DIR}" # "${DOCKER_DIR}" "${EXTERNAL_DOCKER_DIR}"
} # }
#
echo "Copying Docker data directory to external storage..." # echo "Copying Docker data directory to external storage..."
copy_docker_to_external_storage # copy_docker_to_external_storage
#
echo "Bind mounting external storage over local Docker data dir..." # echo "Bind mounting external storage over local Docker data dir..."
mount --bind "${EXTERNAL_DOCKER_DIR}" "${DOCKER_DIR}" # mount --bind "${EXTERNAL_DOCKER_DIR}" "${DOCKER_DIR}"
#
# Ensure fs changes are registered # # Ensure fs changes are registered
sync # sync
sleep 1 # sleep 1
#
echo "Starting Docker service..." # echo "Starting Docker service..."
systemctl start docker # systemctl start docker
fi # fi
# Overlay home dir structure with new dir tree # Overlay home dir structure with new dir tree
echo "Overlaying $UMBREL_ROOT/ with new directory tree" echo "Overlaying $UMBREL_ROOT/ with new directory tree"

Loading…
Cancel
Save