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>
This commit is contained in:
Daniel Golle 2021-08-04 19:03:16 +01:00
parent b37f0dde78
commit e67865c569
No known key found for this signature in database
GPG Key ID: 5A8F39C31C3217CA

View File

@ -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