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 <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2017-01-25 12:31:48 +01:00
parent e80d5b021c
commit 3371ed864c
1 changed files with 1 additions and 2 deletions

View File

@ -269,8 +269,7 @@ format_ubi_volume() {
ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1 ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1
fi fi
# Format MTD partition. # Format MTD partition.
ubiformat "/dev/mtd${mtd_num}" >/dev/null 2>&1 if ! ubiformat "/dev/mtd${mtd_num}" -q -y; then
if [ "$?" != "0" ]; then
quit_with_error "Error erasing '/dev/mtd${mtd_num}' block" quit_with_error "Error erasing '/dev/mtd${mtd_num}' block"
fi fi
psplash_progress "50" psplash_progress "50"