From 0d918be3e95fd636954151ba870520e4fa017aab Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Wed, 17 Oct 2018 08:17:14 -0400 Subject: [PATCH] add check for pv, rename to yoe_install_image --- envsetup.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index 251650cdc..87b61ce81 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -430,11 +430,20 @@ bitbake() { # Machine independent install scripts ############################################################################### +yoe_check_install_dependencies() { + if ! pv -V 1>/dev/null; then + echo "ERROR: Please install the pv utility (http://www.ivarch.com/programs/pv.shtml)" + return 1 + fi +} + # write a WIC image to media (SD, USB, etc) -yoe_install_wic_image() { +yoe_install_image() { DRIVE=$1 IMAGE_NAME=$2 + yoe_check_install_dependencies || return 1 + if [ ! $DRIVE ] || [ ! $IMAGE_NAME ]; then echo "Usage: yoe_install_wic_image /dev/sdX image_name" echo "Warning, make sure you specify your SD card and not a workstation disk"