summaryrefslogtreecommitdiff
path: root/recipes/images/files/library/tegra/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/images/files/library/tegra/update.sh')
-rwxr-xr-xrecipes/images/files/library/tegra/update.sh22
1 files changed, 6 insertions, 16 deletions
diff --git a/recipes/images/files/library/tegra/update.sh b/recipes/images/files/library/tegra/update.sh
index 71e25f8..3d3a7db 100755
--- a/recipes/images/files/library/tegra/update.sh
+++ b/recipes/images/files/library/tegra/update.sh
@@ -5,15 +5,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 T20/T30 module a running U-Boot is required. Boot"
@@ -241,14 +232,13 @@ fi
[ -e ${BINARIES}/${U_BOOT_BINARY} ] || { echo "${BINARIES}/${U_BOOT_BINARY} does not exist"; exit 1; }
[ -e ${BINARIES}/${KERNEL_IMAGETYPE} ] || { echo "${BINARIES}/${KERNEL_IMAGETYPE} 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; }
+
CBOOT_CNT=`tegra-uboot-flasher/cbootimage -h | grep -c outputimage`
[ "$CBOOT_CNT" -gt 0 ] || { echo >&2 "Program cbootimage not available. 32bit compatibility libs? Aborting."; exit 1; }