From f32036a025d8ae7e6ef02aca8b080e5bca60fc11 Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Wed, 10 May 2017 23:47:17 +0200 Subject: scripts_netboot: adjust run_xnbd_server to handle images for multiple machines Change-Id: I546301377d28101a47e8124cbad7ca6682fe47b7 Signed-off-by: Stephane Desneux --- INSTALL/tools/scripts_netboot/run_xnbd_server | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'INSTALL/tools/scripts_netboot') diff --git a/INSTALL/tools/scripts_netboot/run_xnbd_server b/INSTALL/tools/scripts_netboot/run_xnbd_server index 190301d..92dd98c 100755 --- a/INSTALL/tools/scripts_netboot/run_xnbd_server +++ b/INSTALL/tools/scripts_netboot/run_xnbd_server @@ -2,12 +2,21 @@ . /etc/xdtrc -MACHINE=${1:-porter} -IMAGE=${2:-${XDT_BUILD}/tmp/deploy/images/${MACHINE}/agl-demo-platform-crosssdk-${MACHINE}.ext4} +function usage() { + echo "$(basename $0) " >&2 + echo "Machine is one of the following:" >&2 + ls -d $XDT_BUILD/*/tmp/deploy/images/* | xargs -n 1 basename >&2 + exit 1 +} + +MACHINE=$1 +[[ -z "$MACHINE" ]] && { echo "Invalid machine" >&2; usage; } + +IMAGE=${2:-${XDT_BUILD}/${MACHINE}/tmp/deploy/images/${MACHINE}/agl-demo-platform-crosssdk-${MACHINE}.ext4} echo "Using MACHINE=$MACHINE IMAGE=$IMAGE" -[[ ! -f $IMAGE ]] && { echo "Invalid image $IMAGE"; exit 1; } +[[ ! -f $IMAGE ]] && { echo "Invalid image $IMAGE" >&2; usage; } REALIMG=$(realpath $IMAGE) [[ ! -f ${REALIMG}.bak ]] && cp -v ${REALIMG} ${REALIMG}.bak -- cgit