From 5695cf15db1079d4667a1fd8c7dd34619ea6ed30 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Fri, 28 Jun 2024 13:07:11 +0200 Subject: [PATCH] recovery-initramfs-init: fix "update" volume wipe when singlemtdsys is enabled Currently, when wiping the update volume via the recovery partition on a ccimx6ul with singlemtdsys enabled, the procedure fails with this error: [RECOVERY] Starting recovery... [RECOVERY] Wipe 'update' partition requested [RECOVERY] Formatting 'update' ubi volume ubi0 error: ubi_open_volume.part.0: cannot open device 0, volume 3, error -16 ubiupdatevol: error!: cannot open "/dev/ubi0_3" error 16 (Device or resource busy) This is because the logic used to unmount a volume before formatting it is expecting this entry format when running "mount": ubi0:update on /mnt/update type ubifs While this is the format of the "mount" output in userspace for the rootfs volume, other trivial volumes have this format instead: ubi0_3 on /mnt/update type ubifs Adapt the logic to this format so that the "update" volume wipe procedure can take place. Signed-off-by: Gabriel Valcazar --- .../recovery/recovery-initramfs/recovery-initramfs-init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 1bde325b3..4a77b1094 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 @@ -277,8 +277,8 @@ format_ubi_volume() { volname="$(ubinfo ${v} | grep ^Name | awk '{print $(2)}')" if [ "${volname}" = "${1}" ]; then # Find mountpoint - u="$(basename ${d})" - mountpoint="$(mount | grep ${u}:${1} | awk '{print $(3) }')" + u="$(basename ${v})" + mountpoint="$(mount | grep ${u} | awk '{print $(3) }')" umount ${mountpoint} 2> /dev/null # Wipe out volume ubiupdatevol ${v} -t