From 5d6b90868504e6d7551446e990abb1f9719e59b4 Mon Sep 17 00:00:00 2001 From: Simon Long Date: Wed, 2 Oct 2019 10:13:49 +0100 Subject: [PATCH] Add some error trapping --- raspi-config | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/raspi-config b/raspi-config index d09d530..ee1d66a 100755 --- a/raspi-config +++ b/raspi-config @@ -1811,7 +1811,7 @@ enable_overlayfs() { if get_bootro_now ; then if ! mount -o remount,rw /boot 2>/dev/null ; then echo "Unable to mount boot partition as writable - cannot enable" - return + return 1 fi BOOTRO=yes else @@ -1913,7 +1913,7 @@ disable_overlayfs() { if get_bootro_now ; then if ! mount -o remount,rw /boot 2>/dev/null ; then echo "Unable to mount boot partition as writable - cannot disable" - return + return 1 fi BOOTRO=yes else @@ -1958,11 +1958,17 @@ do_overlayfs() { fi if [ $RET -eq $CURRENT ]; then if [ $RET -eq 0 ]; then - enable_overlayfs - STATUS="enabled" + if enable_overlayfs; then + STATUS="enabled" + else + STATUS="unchanged" + fi elif [ $RET -eq 1 ]; then - disable_overlayfs - STATUS="disabled" + if disable_overlayfs; then + STATUS="disabled" + else + STATUS="unchanged" + fi else return $RET fi