Makefile (1122B)
1 IMAGE=./target/riscv32imc-unknown-none-elf/release/ecu-esp32 2 3 $(IMAGE): $(wildcard ecu-esp32/src/*.rs) Makefile pubkey.bin ecu-esp32/Cargo.toml Cargo.toml keys/device.key keys/client.pub 4 echo $< 5 cargo build --release 6 7 .PHONY: build ota install 8 build: $(IMAGE) Makefile 9 10 ota.bin: $(IMAGE) 11 espflash save-image --chip esp32c3 $< $@ 12 13 ota: ota.bin 14 time python otaclient.py $< 15 16 install: $(IMAGE) 17 espflash flash --erase-parts otadata --partition-table ./partitions.csv --monitor --chip esp32c3 $< 18 19 # these keys are used during normal operation for signing session requests and 20 # OTA updates 21 privkey.pem: 22 openssl genpkey -algorithm ed25519 -out privkey.pem 23 24 pubkey.bin: privkey.pem 25 openssl pkey -in $< -pubout -text_pub | awk '/^ / {print}' | xxd -r -p > $@ 26 27 privkey.bin: privkey.pem 28 openssl pkey -in privkey.pem -text | awk '/^priv:/,/^pub:/ {print}' | awk '/^ / {print}' | xxd -r -p > privkey.bin 29 30 # these keys are used during wifi provisioning so we can authenticate 31 # the peer 32 keys/client.key keys/client.pub: 33 python genkeys.py keys/client.key 34 35 keys/device.key keys/device.pub: 36 python genkeys.py keys/device.key