From 944c9a7217309451dfb73a92ec09f12e6772dbc1 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 2 Apr 2023 10:07:18 +0200 Subject: T5136: properly unmount filesystems after installation (cherry picked from commit f34e9028252034cf17dbf380a2cded8bf14c71c2) --- scripts/install/install-image-existing | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts/install/install-image-existing') 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.' -- cgit v1.2.3 From 36f08f78b806639827c9ae3a81275e057309bb1d Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 3 Apr 2023 08:02:24 +0200 Subject: T5136: do not rm -rf if unmount fails Commit f34e9028 ("T5136: properly unmount filesystems after installation") assumed it would be a good idea to simply rm -rf the new root folder. This could have a bad, non booting side effect. Warn user if unmount fails but the filesystem is synced anyway. The rest is handled by the Kernel on reboot. (cherry picked from commit 964e06bc3404b096d55e939b2bdb8d9c61a6a9b9) --- scripts/install/install-image-existing | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts/install/install-image-existing') diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index abbd1421..feba6683 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -280,7 +280,6 @@ 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 -- cgit v1.2.3