From b80f0fc4c5cca545715615d9a1fcc9d0ef71d86f Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Tue, 4 Sep 2018 00:16:14 +0530 Subject: platforms/sgi575: allow auto-detection of tap interface Use the function 'find_tap_interface' to determine a available tap network interface. Change-Id: Id5587122fb614ea05d61b2e8aff512c08716cefe Signed-off-by: Thomas Abraham --- sgi/platforms/sgi575/run_model.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'sgi') diff --git a/sgi/platforms/sgi575/run_model.sh b/sgi/platforms/sgi575/run_model.sh index fbb1055..bbe52b0 100755 --- a/sgi/platforms/sgi575/run_model.sh +++ b/sgi/platforms/sgi575/run_model.sh @@ -22,6 +22,9 @@ OUTDIR=${ROOTDIR}/sgi575 MODEL_TYPE="sgi575" MODEL_PARAMS="" FS_TYPE="" +TAP_INTERFACE="" + +source ../../sgi_common_util.sh # Check that a path to the model has been provided if [ ! -e "$MODEL" ]; then @@ -122,11 +125,14 @@ if [[ -z $NTW_ENABLE ]]; then fi if [ ${NTW_ENABLE,,} == "true" ]; then - echo -e "$YELLOW_FONT Please input a unique bridge interface name for network setup $NORMAL_FONT" >&2 - read INTERFACE_NAME - if [[ -z $INTERFACE_NAME ]]; then - echo -e "$RED_FONT network interface name is empty $NORMAL_FONT" >&2 - exit 1; + find_tap_interface + if [[ -z $TAP_INTERFACE ]]; then + echo -e "$YELLOW_FONT Please input a unique bridge interface name for network setup $NORMAL_FONT" >&2 + read TAP_INTERFACE + if [[ -z $TAP_INTERFACE ]]; then + echo -e "$RED_FONT network interface name is empty $NORMAL_FONT" >&2 + exit 1; + fi fi fi @@ -172,7 +178,7 @@ mkdir -p ./$MODEL_TYPE if [ ${NTW_ENABLE,,} == "true" ]; then MODEL_PARAMS="$MODEL_PARAMS \ - -C board.hostbridge.interfaceName="$INTERFACE_NAME" \ + -C board.hostbridge.interfaceName="$TAP_INTERFACE" \ -C board.smsc_91c111.enabled=1" fi -- cgit v1.2.3