From f3d26f123ad7c8d4dde173fad3992281d460f2ee Mon Sep 17 00:00:00 2001 From: Joe Khoobyar Date: Sat, 12 Nov 2022 01:10:00 -0500 Subject: [PATCH] AR-1398: Fix wrong error message when missing fs tools (#4424) --- packages/bsp/common/usr/sbin/armbian-install | 6 ++++++ packages/bsp/common/usr/sbin/nand-sata-install | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/bsp/common/usr/sbin/armbian-install b/packages/bsp/common/usr/sbin/armbian-install index 1e4a7f4ad4..a1da3af55f 100755 --- a/packages/bsp/common/usr/sbin/armbian-install +++ b/packages/bsp/common/usr/sbin/armbian-install @@ -541,6 +541,12 @@ format_emmc() # (convert to sectors for partitioning) DEFAULT_BOOTSIZE_SECTORS=$(((${DEFAULT_BOOTSIZE} * 1024 * 1024) / 512)) + # check if the filesystem tools are actually installed + if ! command -v mkfs.${eMMCFilesystemChoosen} >/dev/null 2>&1; then + echo "Error: Filesystem tools for ${eMMCFilesystemChoosen} not installed, exiting" + exit 9 + fi + # check whether swap is currently defined and a new swap partition is needed grep -q swap /etc/fstab case $? in diff --git a/packages/bsp/common/usr/sbin/nand-sata-install b/packages/bsp/common/usr/sbin/nand-sata-install index c8f0de7c45..3a56b714a5 100755 --- a/packages/bsp/common/usr/sbin/nand-sata-install +++ b/packages/bsp/common/usr/sbin/nand-sata-install @@ -497,6 +497,12 @@ format_emmc() # (convert to sectors for partitioning) DEFAULT_BOOTSIZE_SECTORS=$(((${DEFAULT_BOOTSIZE} * 1024 * 1024) / 512)) + # check if the filesystem tools are actually installed + if ! command -v mkfs.${eMMCFilesystemChoosen} >/dev/null 2>&1; then + echo "Error: Filesystem tools for ${eMMCFilesystemChoosen} not installed, exiting" + exit 9 + fi + # check whether swap is currently defined and a new swap partition is needed grep -q swap /etc/fstab case $? in