Files
agnos-builder/flash_system.sh
T
Andrei Radulescu e85baea994 update flash scripts to always flash active slot (#264)
* update flash scripts

* flash active slot

* more descriptive ending message
2024-07-30 10:51:47 -07:00

22 lines
517 B
Bash
Executable File

#!/bin/bash -e
set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR
echo "Checking active slot..."
ACTIVE_SLOT=$(tools/edl getactiveslot | grep "Current active slot:" | awk '{print $NF}')
if [[ "$ACTIVE_SLOT" != "a" && "$ACTIVE_SLOT" != "b" ]]; then
echo "Invalid active slot: '$ACTIVE_SLOT'"
exit 1
fi
echo "Active slot: $ACTIVE_SLOT"
echo "Flashing system_$ACTIVE_SLOT..."
tools/edl w system_$ACTIVE_SLOT $DIR/output/system.img
tools/edl reset
echo "Flashed system_$ACTIVE_SLOT!"