From 3371ed864c6611bc629cdd3584509a678a2e4a9b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 25 Jan 2017 12:31:48 +0100 Subject: [PATCH] recovery init: disable interactivity for 'ubiformat' command We have seen corner cases (e.g. when the partition to format has already some corrupted UBI metadata) where ubiformat stops and ask the user for confirmation to do the format. We cannot have such interactivity in the recovery ramdisk so use the '-y' argument to assume yes for all questions. Also use the '-q' (quiet) parameter instead of the '/dev/null' redirections to remove command's output. Signed-off-by: Javier Viguera --- .../recovery/recovery-initramfs/recovery-initramfs-init | 3 +-- 1 file changed, 1 insertion(+), 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 1e43d505d..302f41dd3 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 @@ -269,8 +269,7 @@ format_ubi_volume() { ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1 fi # Format MTD partition. - ubiformat "/dev/mtd${mtd_num}" >/dev/null 2>&1 - if [ "$?" != "0" ]; then + if ! ubiformat "/dev/mtd${mtd_num}" -q -y; then quit_with_error "Error erasing '/dev/mtd${mtd_num}' block" fi psplash_progress "50"