From 1a0fc1a5229d02a31b90cb6df2441b170cefaf99 Mon Sep 17 00:00:00 2001 From: Gregor Haas Date: Mon, 17 Jun 2024 15:20:24 -0700 Subject: [PATCH] can't remove file if it doesnt exist --- scripts/ci/plat/cva6/flash-firmware.sh | 2 +- scripts/ci/utils/wait_for.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/ci/plat/cva6/flash-firmware.sh b/scripts/ci/plat/cva6/flash-firmware.sh index d7fd5c95b..01223bc55 100755 --- a/scripts/ci/plat/cva6/flash-firmware.sh +++ b/scripts/ci/plat/cva6/flash-firmware.sh @@ -42,7 +42,7 @@ dd if="$FIRMWARE_FILENAME" of="$TTYDEV" bs=1 status=progress ./scripts/ci/utils/wait_for.py "$LOGFILE" "Hit any key to stop autoboot" echo 'a' > "$TTYDEV" -rm "$TFTP_DIR/fw_payload.bin" +rm -f "$TFTP_DIR/fw_payload.bin" cp "$FIRMWARE_FILENAME" "$TFTP_DIR/fw_payload.bin" echo "setenv serverip $HOST_IP" > "$TTYDEV" echo "setenv ipaddr $BOARD_IP" > "$TTYDEV" diff --git a/scripts/ci/utils/wait_for.py b/scripts/ci/utils/wait_for.py index 13b6479f1..5df5e0472 100755 --- a/scripts/ci/utils/wait_for.py +++ b/scripts/ci/utils/wait_for.py @@ -17,7 +17,10 @@ exit(0) n = os.read(file.fileno(), 1) - if n is not None and len(n) > 0: + if n is None: + exit(1) + + if len(n) > 0: print(n.decode('utf-8'), end='') if n[0] == pattern[index]: index += 1