summaryrefslogtreecommitdiff
path: root/recipes/images/files/library/imx6/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/images/files/library/imx6/update.sh')
-rwxr-xr-xrecipes/images/files/library/imx6/update.sh21
1 files changed, 5 insertions, 16 deletions
diff --git a/recipes/images/files/library/imx6/update.sh b/recipes/images/files/library/imx6/update.sh
index 10043e1..0bf5380 100755
--- a/recipes/images/files/library/imx6/update.sh
+++ b/recipes/images/files/library/imx6/update.sh
@@ -6,15 +6,6 @@
# exit on error
set -e
-#some distros have fs tools only in root's path
-PARTED=`which parted` 2> /dev/null || true
-if [ -e "$PARTED" ] ; then
- MKFSVFAT=`which mkfs.vfat`
-else
- PARTED=`sudo which parted`
- MKFSVFAT=`sudo which mkfs.vfat`
-fi
-
Flash()
{
echo "To flash the Apalis/Colibri iMX6 module a running U-Boot is required. Boot the"
@@ -161,13 +152,11 @@ fi
[ -e ${BINARIES}/${U_BOOT_BINARY_IT} ] || { echo "${BINARIES}/${U_BOOT_BINARY_IT} does not exist"; exit 1; }
[ -e ${BINARIES}/uImage ] || { echo "${BINARIES}/uImage does not exist"; exit 1; }
-#sanity check for some programs
-MCOPY=`sudo which mcopy`
-[ "${MCOPY}x" != "x" ] || { echo >&2 "Program mcopy not available. Aborting."; exit 1; }
-sudo ${PARTED} -v >/dev/null 2>&1 || { echo >&2 "Program parted not available. Aborting."; exit 1; }
-[ "${MKFSVFAT}x" != "x" ] || { echo >&2 "Program mkfs.vfat not available. Aborting."; exit 1; }
-MKFSEXT3=`sudo which mkfs.ext3`
-[ "${MKFSEXT3}x" != "x" ] || { echo >&2 "Program mkfs.ext3 not available. Aborting."; exit 1; }
+#Sanity check for some programs. Some distros have fs tools only in root's path
+MCOPY=`command -v mcopy` || { echo >&2 "Program mcopy not available. Aborting."; exit 1; }
+PARTED=`command -v parted` || PARTED=`sudo -s command -v parted` || { echo >&2 "Program parted not available. Aborting."; exit 1; }
+MKFSVFAT=`command -v mkfs.vfat` || MKFSVFAT=`sudo -s command -v mkfs.vfat` || { echo >&2 "Program mkfs.vfat not available. Aborting."; exit 1; }
+MKFSEXT3=`command -v mkfs.ext3` || MKFSEXT3=`sudo -s command -v mkfs.ext3` || { echo >&2 "Program mkfs.ext3 not available. Aborting."; exit 1; }
dd --help >/dev/null 2>&1 || { echo >&2 "Program dd not available. Aborting."; exit 1; }
#make the directory with the outputfiles writable