summaryrefslogtreecommitdiff
path: root/scripts/install/install-image-existing
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-04-02 10:07:18 +0200
committerChristian Breunig <christian@breunig.cc>2023-04-02 10:07:18 +0200
commitf34e9028252034cf17dbf380a2cded8bf14c71c2 (patch)
treed39e60b2b76911914a3e9998dd8dd87ee9c0582c /scripts/install/install-image-existing
parent51df898e5647969cec679719b34b2f5b51318fa1 (diff)
downloadvyatta-cfg-system-f34e9028252034cf17dbf380a2cded8bf14c71c2.tar.gz
vyatta-cfg-system-f34e9028252034cf17dbf380a2cded8bf14c71c2.zip
T5136: properly unmount filesystems after installation
Diffstat (limited to 'scripts/install/install-image-existing')
-rwxr-xr-xscripts/install/install-image-existing9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing
index d00d7735..abbd1421 100755
--- a/scripts/install/install-image-existing
+++ b/scripts/install/install-image-existing
@@ -278,6 +278,15 @@ if [ -e "$DEF_GRUB" ]; then
fi
fi
+# unmount filesystems
+if ! try_unmount "--read-only $INST_ROOT $READ_ROOT"; then
+ rm -rf $REL_ROOT
+ failure_exit 'Failed to unmount new squashfs image.'
+fi
+
+# sync underlaying filesystems
+sync
+
logger -p local3.warning -t "SystemImage" "System Image $NEWNAME has been added and made the default boot image"
echo 'Done.'