mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 17:32:18 +00:00
Merge pull request #782 from timgunter/more_trivial_updates_to_device_flash_scripts
More trivial updates to device flash scripts
This commit is contained in:
commit
992fae77ff
@ -1,13 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PYTHON=${PYTHON:-python3}
|
PYTHON=${PYTHON:-$(which python3 python|head -n 1)}
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Usage info
|
# Usage info
|
||||||
show_help() {
|
show_help() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Usage: ${0##*/} [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME]
|
Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME]
|
||||||
Flash image file to device, but first erasing and writing system information"
|
Flash image file to device, but first erasing and writing system information"
|
||||||
|
|
||||||
-h Display this help and exit
|
-h Display this help and exit
|
||||||
@ -39,6 +39,11 @@ while getopts ":hp:P:f:" opt; do
|
|||||||
done
|
done
|
||||||
shift "$((OPTIND-1))"
|
shift "$((OPTIND-1))"
|
||||||
|
|
||||||
|
[ -z "$FILENAME" -a -n "$1" ] && {
|
||||||
|
FILENAME=$1
|
||||||
|
shift
|
||||||
|
}
|
||||||
|
|
||||||
if [ -f "${FILENAME}" ]; then
|
if [ -f "${FILENAME}" ]; then
|
||||||
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
||||||
$PYTHON -m esptool --baud 921600 erase_flash
|
$PYTHON -m esptool --baud 921600 erase_flash
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PYTHON=${PYTHON:-python3}
|
PYTHON=${PYTHON:-$(which python3 python|head -n 1)}
|
||||||
|
|
||||||
# Usage info
|
# Usage info
|
||||||
show_help() {
|
show_help() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Usage: ${0##*/} [-h] [-p ESPTOOL_PORT] [-P PYTHON] -f FILENAME
|
Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME]
|
||||||
Flash image file to device, leave existing system intact."
|
Flash image file to device, leave existing system intact."
|
||||||
|
|
||||||
-h Display this help and exit
|
-h Display this help and exit
|
||||||
@ -37,6 +37,11 @@ while getopts ":hp:P:f:" opt; do
|
|||||||
done
|
done
|
||||||
shift "$((OPTIND-1))"
|
shift "$((OPTIND-1))"
|
||||||
|
|
||||||
|
[ -z "$FILENAME" -a -n "$1" ] && {
|
||||||
|
FILENAME=$1
|
||||||
|
shift
|
||||||
|
}
|
||||||
|
|
||||||
if [ -f "${FILENAME}" ]; then
|
if [ -f "${FILENAME}" ]; then
|
||||||
echo "Trying to flash update ${FILENAME}."
|
echo "Trying to flash update ${FILENAME}."
|
||||||
$PYTHON -m esptool --baud 921600 write_flash 0x10000 ${FILENAME}
|
$PYTHON -m esptool --baud 921600 write_flash 0x10000 ${FILENAME}
|
||||||
|
Loading…
Reference in New Issue
Block a user