summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/upgrade/stage2
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-08-04 19:03:16 +0100
committerDaniel Golle <daniel@makrotopia.org>2021-08-04 19:12:34 +0100
commite67865c569c0cbdc452c63b54b02f5c3cc4d247a (patch)
tree44d4af55c7fc50dcb4de5b22530f6216638ad65c /package/base-files/files/lib/upgrade/stage2
parentb37f0dde78656a352914c4d01010979530589103 (diff)
downloadopenwrt-e67865c569c0cbdc452c63b54b02f5c3cc4d247a.tar.gz
openwrt-e67865c569c0cbdc452c63b54b02f5c3cc4d247a.tar.bz2
openwrt-e67865c569c0cbdc452c63b54b02f5c3cc4d247a.zip
base-files: upgrade: try umount lvm and loop devices
Try umount on device mapper and loop devices still mounted, so the subsequent call to disactivate all physical volumes and delete all loop devices is more likely to succeed. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/base-files/files/lib/upgrade/stage2')
-rwxr-xr-xpackage/base-files/files/lib/upgrade/stage24
1 files changed, 4 insertions, 0 deletions
diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index 30ad19f7f1..45fb98d889 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -64,6 +64,10 @@ switch_to_ramfs() {
/bin/mount -o remount,ro /mnt
/bin/umount -l /mnt
+ grep -e "^/dev/dm-.*" -e "^/dev/loop.*" /proc/mounts | while read bdev mp _r; do
+ umount $mp
+ done
+
[ "$RAMFS_COPY_LOSETUP" ] && losetup -D
[ "$RAMFS_COPY_LVM" ] && {
mkdir -p /tmp/lvm/cache