From 39f2a662033225014b0a7dd96e2f3a7d5797f954 Mon Sep 17 00:00:00 2001 From: archandanime <36922812+archandanime@users.noreply.github.com> Date: Wed, 4 Oct 2023 00:50:07 +0700 Subject: [PATCH] Make running upgrade-run.sh more convenient for users who use overlay image --- SD_ROOT/wz_mini/bin/upgrade-run.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/SD_ROOT/wz_mini/bin/upgrade-run.sh b/SD_ROOT/wz_mini/bin/upgrade-run.sh index 2ec7779..723af8e 100755 --- a/SD_ROOT/wz_mini/bin/upgrade-run.sh +++ b/SD_ROOT/wz_mini/bin/upgrade-run.sh @@ -2,9 +2,21 @@ if df / | grep -q overlayfs; then echo "Unable to upgrade because rootfs is overlay" - echo "Please disable rootfs overlay by setting ENABLE_OVERLAY_FOR_ROOTFS=\"false\" in wz_mini.conf and reboot first" + echo "Please disable rootfs overlay by setting ENABLE_OVERLAY_FOR_ROOTFS=\"false\" in wz_mini.conf and reboot first" echo "You can change it back after upgrade is finished" - exit 1 + read -r -p "Do you want to disable overlay and reboot now? [y/N]" response + case "$response" in + [yY][eE][sS]|[yY]) + sed -i 's/ENABLE_OVERLAY_FOR_ROOTFS=\"true\"/ENABLE_OVERLAY_FOR_ROOTFS=\"false\"/g' /opt/wz_mini/wz_mini.conf + echo "You can run upgrade-run.sh to start upgrade after the camera reboots" + reboot + exit 0 + ;; + *) + echo "Aborting upgrade" + exit 1 + ;; + esac fi if [ -L /dev/fd ]; then