Files
agnos-builder/flash_kernel.sh
Andrei Radulescu 915ff5eb09 update bash scripts to #!/usr/bin/env bash (#268)
* update bash shebang for better compatibility including macOS

* re-build
2024-08-31 10:34:25 -07:00

20 lines
497 B
Bash
Executable File

#!/usr/bin/env bash
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 boot_$ACTIVE_SLOT..."
tools/edl w boot_$ACTIVE_SLOT $DIR/output/boot.img
echo "Flashed boot_$ACTIVE_SLOT!"