Skip to content

Commit

Permalink
use cat instead of tail
Browse files Browse the repository at this point in the history
  • Loading branch information
grg-haas committed Jun 17, 2024
1 parent 65d8de0 commit b33e116
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scripts/ci/plat/cva6/flash-firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ set -x
## ROM phase

TTYDEV=$(find_tty 0)
touch "$LOGFILE"
start_record_tty "$TTYDEV" 115200 "$LOGFILE" cva6-tty
configure_tty "$TTYDEV"

# Wait for bootrom break
power_on
tail -f "$LOGFILE" | grep -m1 'Hit any key to enter update mode'
cat "$TTYDEV" | grep --line-buffered -m1 'Hit any key to enter update mode'
echo 'a' > "$TTYDEV"

# Send size
tail -f "$LOGFILE" | grep -m1 'size:'
cat "$TTYDEV" | grep --line-buffered -m1 'size:'
FILESIZE=$(stat --printf="%s" "$FIRMWARE_FILENAME")
printf "0: %.8x" "$FILESIZE" | sed -E 's/0: (..)(..)(..)(..)/0: \4\3\2\1/' | xxd -r -g0 > "$TTYDEV"
sleep 1
Expand All @@ -41,7 +40,7 @@ dd if="$FIRMWARE_FILENAME" of="$TTYDEV" bs=1 status=progress
## Uboot phase (TFTP)

# Wait for uboot prompt and send firmware image
tail -f "$LOGFILE" | grep -m1 "Hit any key to stop autoboot"
cat "$TTYDEV" | grep --line-buffered -m1 "Hit any key to stop autoboot"
echo 'a' > "$TTYDEV"

rm "$TFTP_DIR/fw_payload.bin"
Expand All @@ -50,6 +49,5 @@ echo "setenv serverip $HOST_IP" > "$TTYDEV"
echo "setenv ipaddr $BOARD_IP" > "$TTYDEV"
echo "tftp fw_payload.bin" > "$TTYDEV"

stop_record_tty
power_off

0 comments on commit b33e116

Please sign in to comment.