Merge pull request #2 from flipperdevices/ll_flash_nix
add flash script for linux, to copy with assembly artefacts via CI
This commit is contained in:
commit
933520f7a2
|
@ -90,6 +90,7 @@ jobs:
|
||||||
mv build/bootloader/bootloader.bin artifacts/
|
mv build/bootloader/bootloader.bin artifacts/
|
||||||
mv build/partition_table/partition-table.bin artifacts/
|
mv build/partition_table/partition-table.bin artifacts/
|
||||||
mv build/blackmagic.bin artifacts/
|
mv build/blackmagic.bin artifacts/
|
||||||
|
cp scripts/flash_nix.sh artifacts/
|
||||||
|
|
||||||
- name: Generate flash.command file
|
- name: Generate flash.command file
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd $(dirname "$0")
|
||||||
|
|
||||||
|
FLASH_COMMAND="$(cat flash.command)"
|
||||||
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
if [ -c "$1" ]; then
|
||||||
|
PORT="$1"
|
||||||
|
|
||||||
|
TOOL="$(echo "$FLASH_COMMAND" | sed -e 's/\s.*$//')"
|
||||||
|
ESPTOOL=`which $TOOL`
|
||||||
|
if [ -n "$ESPTOOL" ] && [ -x "$ESPTOOL" ]; then
|
||||||
|
echo "$FLASH_COMMAND" | sed -e "s|(PORT)|$PORT|g" | sh -x
|
||||||
|
exit $?
|
||||||
|
else
|
||||||
|
echo "Can't find executable $ESPTOOL"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Invalid port $1"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Usage: $0 <serial_port>"
|
||||||
|
echo "Available ports:"
|
||||||
|
find /dev/tty* | grep -E "ACM|USB|\." --color=never
|
||||||
|
exit 255;
|
Loading…
Reference in New Issue