diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/automount_mtd.sh b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/automount_mtd.sh index ed1be95ba..6a5c555ac 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/automount_mtd.sh +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/automount_mtd.sh @@ -43,6 +43,7 @@ if is_update_device; then fi else echo "ERROR: Could not mount '${PARTITION_NAME}' partition, volume not found" + ubidetach -p "/dev/${MDEV}" >/dev/null 2>&1 rmdir --ignore-fail-on-non-empty ${UPDATE_MOUNTPOINT} fi fi diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 882059b47..12e68ea36 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -194,8 +194,8 @@ format_ubi_volume() { if grep -qs "${1}" /proc/mounts; then local path="$(sed -ne "s/.*:${1} \(.*\) ubifs.*/\1/g;T;p" /proc/mounts 2>/dev/null)" umount "${path}" >/dev/null 2>&1 - ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1 fi + ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1 # Format MTD partition. if ! ubiformat "/dev/mtd${mtd_num}" -q -y; then quit_with_error "Error erasing '/dev/mtd${mtd_num}' block"