Skip to content

Commit

Permalink
dist/iotlab: return ret code within a single call
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Feb 25, 2021
1 parent af37f5b commit 5a8094e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions dist/testbed-support/makefile.iotlab.single.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,14 @@ info-iotlab-node:

# Configure FLASHER, RESET, TERMPROG depending on BOARD and if on frontend

# Command to check if 'stdin' is 0. Cannot use 'cmp - <(echo 0)' without bash shell
_STDIN_EQ_0 = grep 0

ifneq (iotlab-a8-m3,$(BOARD))

# M3 nodes
FLASHER = iotlab-node
RESET = iotlab-node
_NODE_FMT = --jmespath='keys(@)[0]' --format='int'
FFLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) $(_IOTLAB_NODELIST) $(_NODES_FLASH_OPTION) $(FLASHFILE) | $(_STDIN_EQ_0)
RESET_FLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) $(_IOTLAB_NODELIST) --reset | $(_STDIN_EQ_0)
_NODE_FMT = --jmespath='keys(@)[0]' --format='lambda ret: exit(int(ret))'
FFLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) $(_IOTLAB_NODELIST) $(_NODES_FLASH_OPTION) $(FLASHFILE)
RESET_FLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) $(_IOTLAB_NODELIST) --reset

ifeq (,$(_IOTLAB_ON_FRONTEND))
TERMPROG = ssh
Expand All @@ -198,8 +195,8 @@ else
FLASHER = iotlab-ssh
RESET = iotlab-ssh
_NODE_FMT = --jmespath='keys(values(@)[0])[0]' --fmt='int'
FFLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) flash-m3 $(_IOTLAB_NODELIST) $(FLASHFILE) | $(_STDIN_EQ_0)
RESET_FLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) reset-m3 $(_IOTLAB_NODELIST) | $(_STDIN_EQ_0)
FFLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) flash-m3 $(_IOTLAB_NODELIST) $(FLASHFILE)
RESET_FLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) reset-m3 $(_IOTLAB_NODELIST)

TERMPROG = ssh
ifeq (,$(_IOTLAB_ON_FRONTEND))
Expand Down

0 comments on commit 5a8094e

Please sign in to comment.