aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xINSTALL/tools/scripts_netboot/run_xnbd_server15
1 files changed, 12 insertions, 3 deletions
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) <machine>" >&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