-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.sh
executable file
·24 lines (19 loc) · 972 Bytes
/
package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
rm -rf ../dist/
mkdir ../dist/
cp build/bootloader/bootloader.bin ../dist/
cp build/partition_table/partition-table.bin ../dist/
cp build/ota_data_initial.bin ../dist/
cp build/phy_init_data.bin ../dist/
cp build/TROOPERS24.bin ../dist/
(cd components/appfs/tools/; ./generate.sh)
cp components/appfs/tools/appfs.bin ../dist/
echo "#!/bin/bash" > ../dist/flash.sh
echo "" >> ../dist/flash.sh
echo 'DEVICE=$1' >> ../dist/flash.sh
echo "esptool.py erase_flash" >> ../dist/flash.sh
echo 'esptool.py -p $DEVICE -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x1000 bootloader.bin 0x8000 partition-table.bin 0xd000 ota_data_initial.bin 0xf000 phy_init_data.bin 0x10000 TROOPERS24.bin' >> ../dist/flash.sh
echo 'esptool.py --port $DEVICE --baud 960000 write_flash 0x330000 appfs.bin' >> ../dist/flash.sh
chmod +x ../dist/flash.sh
rm -f ../dist.zip
zip -r ../dist.zip ../dist/