mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
Add some error trapping
This commit is contained in:
parent
5d7664812b
commit
5d6b908685
14
raspi-config
14
raspi-config
@ -1811,7 +1811,7 @@ enable_overlayfs() {
|
|||||||
if get_bootro_now ; then
|
if get_bootro_now ; then
|
||||||
if ! mount -o remount,rw /boot 2>/dev/null ; then
|
if ! mount -o remount,rw /boot 2>/dev/null ; then
|
||||||
echo "Unable to mount boot partition as writable - cannot enable"
|
echo "Unable to mount boot partition as writable - cannot enable"
|
||||||
return
|
return 1
|
||||||
fi
|
fi
|
||||||
BOOTRO=yes
|
BOOTRO=yes
|
||||||
else
|
else
|
||||||
@ -1913,7 +1913,7 @@ disable_overlayfs() {
|
|||||||
if get_bootro_now ; then
|
if get_bootro_now ; then
|
||||||
if ! mount -o remount,rw /boot 2>/dev/null ; then
|
if ! mount -o remount,rw /boot 2>/dev/null ; then
|
||||||
echo "Unable to mount boot partition as writable - cannot disable"
|
echo "Unable to mount boot partition as writable - cannot disable"
|
||||||
return
|
return 1
|
||||||
fi
|
fi
|
||||||
BOOTRO=yes
|
BOOTRO=yes
|
||||||
else
|
else
|
||||||
@ -1958,11 +1958,17 @@ do_overlayfs() {
|
|||||||
fi
|
fi
|
||||||
if [ $RET -eq $CURRENT ]; then
|
if [ $RET -eq $CURRENT ]; then
|
||||||
if [ $RET -eq 0 ]; then
|
if [ $RET -eq 0 ]; then
|
||||||
enable_overlayfs
|
if enable_overlayfs; then
|
||||||
STATUS="enabled"
|
STATUS="enabled"
|
||||||
|
else
|
||||||
|
STATUS="unchanged"
|
||||||
|
fi
|
||||||
elif [ $RET -eq 1 ]; then
|
elif [ $RET -eq 1 ]; then
|
||||||
disable_overlayfs
|
if disable_overlayfs; then
|
||||||
STATUS="disabled"
|
STATUS="disabled"
|
||||||
|
else
|
||||||
|
STATUS="unchanged"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
return $RET
|
return $RET
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user