diff --git a/.github/workflows/check-certificates.yml b/.github/workflows/check-certificates.yml index 976df471..d4a70364 100644 --- a/.github/workflows/check-certificates.yml +++ b/.github/workflows/check-certificates.yml @@ -16,7 +16,7 @@ env: jobs: get-certificates-list: # This workflow would fail in forks that don't have the certificate secrets defined - if: github.repository == 'arduino/FirmwareUpdater' + if: github.repository == 'arduino/FirmwareUploader' runs-on: ubuntu-latest outputs: certificates: ${{ steps.get-files.outputs.certificates }} @@ -38,7 +38,7 @@ jobs: check-certificates: # This workflow would fail in forks that don't have the certificate secrets defined - if: github.repository == 'arduino/FirmwareUpdater' + if: github.repository == 'arduino/FirmwareUploader' runs-on: ubuntu-latest needs: get-certificates-list diff --git a/.github/workflows/check-notarization-certificates.yml b/.github/workflows/check-notarization-certificates.yml index b9f2f26d..917d6941 100644 --- a/.github/workflows/check-notarization-certificates.yml +++ b/.github/workflows/check-notarization-certificates.yml @@ -16,7 +16,7 @@ env: jobs: check-certificates: # This workflow would fail in forks that don't have the certificate secrets defined - if: github.repository == 'arduino/FirmwareUpdater' + if: github.repository == 'arduino/FirmwareUploader' runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/link-validation.yml b/.github/workflows/link-validation.yml index ef9ea353..6605dfc7 100644 --- a/.github/workflows/link-validation.yml +++ b/.github/workflows/link-validation.yml @@ -9,7 +9,7 @@ on: jobs: verify-links: # Don't trigger on schedule event when in a fork - if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'arduino/FirmwareUpdater') + if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'arduino/FirmwareUploader') runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd2cab18..cb367c19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,10 +87,10 @@ jobs: # Repackage the signed binary replaced in place by Gon (ignoring the output zip file) run: | TAG=${GITHUB_REF/refs\/tags\//} - tar cjf dist/FirmwareUpdater_${TAG}_macOS_64bit.tar.bz2 \ + tar cjf dist/FirmwareUploader_${TAG}_macOS_64bit.tar.bz2 \ firmwares \ LICENSE.txt \ - -C dist/macos64/ FirmwareUpdater + -C dist/macos64/ FirmwareUploader - name: Upload artifacts uses: actions/upload-artifact@v2 @@ -141,4 +141,4 @@ jobs: bodyFile: "dist/CHANGELOG.md" draft: false prerelease: ${{ steps.prerelease.outputs.IS_PRE }} - artifacts: dist/FirmwareUpdater*,dist/package_index.json + artifacts: dist/FirmwareUploader*,dist/package_index.json diff --git a/.gitignore b/.gitignore index acf9be21..06c76303 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /debug -/FirmwareUpdater* +/FirmwareUploader* /.vscode/ .idea coverage_*.txt diff --git a/README.md b/README.md index 48860406..557047b2 100644 --- a/README.md +++ b/README.md @@ -6,34 +6,34 @@ Use this tool to update the firmware and/or add SSL certificates for any WINC, N You can download the Firmware/Certificates updater here: -https://github.com/arduino/FirmwareUpdater/releases/latest +https://github.com/arduino/FirmwareUploader/releases/latest ## Usage Extract the zip file and run (for example, NINA -> WiFi1010) ``` -./$your_os/updater -flasher firmwares/NINA/FirmwareUpdater.mkrwifi1010.ino.bin -firmware firmwares/NINA/1.2.1/NINA_W102.bin -port /dev/ttyACM0 -address arduino.cc:443 -restore_binary /tmp/arduino_build_619137/WiFiSSLClient.ino.bin -programmer {runtime.tools.bossac}/bossac +./FirmwareUploader -flasher firmwares/NINA/FirmwareUpdater.mkrwifi1010.ino.bin -firmware firmwares/NINA/1.2.1/NINA_W102.bin -port /dev/ttyACM0 -address arduino.cc:443 -restore_binary /tmp/arduino_build_619137/WiFiSSLClient.ino.bin -programmer {runtime.tools.bossac}/bossac ``` To flash a MKR1000: ``` -./$your_os/updater -flasher firmwares/WINC1500/FirmwareUpdater.mkr1000.ino.bin -firmware firmwares/WINC1500/19.5.4/m2m_aio_3a0.bin -port /dev/ttyACM0 -address arduino.cc:443 -restore_binary /tmp/arduino_build_619137/WiFiSSLClient.ino.bin -programmer {runtime.tools.bossac}/bossac +./FirmwareUploader -flasher firmwares/WINC1500/FirmwareUpdater.mkr1000.ino.bin -firmware firmwares/WINC1500/19.5.4/m2m_aio_3a0.bin -port /dev/ttyACM0 -address arduino.cc:443 -restore_binary /tmp/arduino_build_619137/WiFiSSLClient.ino.bin -programmer {runtime.tools.bossac}/bossac ``` To update a MKRNB1500: ``` -./$your_os/updater -flasher firmwares/SARA/SerialSARAPassthrough.ino.bin -firmware firmwares/SARA/5.6A2.00-to-5.6A2.01.pkg -port /dev/ttyACM0 -restore_binary firmwares/SARA/SerialSARAPassthrough.ino.bin -programmer {runtime.tools.bossac}/bossac +./FirmwareUploader -flasher firmwares/SARA/SerialSARAPassthrough.ino.bin -firmware firmwares/SARA/5.6A2.00-to-5.6A2.01.pkg -port /dev/ttyACM0 -restore_binary firmwares/SARA/SerialSARAPassthrough.ino.bin -programmer {runtime.tools.bossac}/bossac ``` ### Command line options -The full list of command line options can be obtained with the `-h` option: `./updater -h` +The full list of command line options can be obtained with the `-h` option: `./FirmwareUploader -h` ``` -Usage of ./distrib/linux64/updater: +Usage of ./FirmwareUploader: -address value address (host:port) to fetch and flash root certificate for, multiple values allowed -certs string @@ -41,9 +41,11 @@ Usage of ./distrib/linux64/updater: -firmware string firmware file to flash -flasher string - firmware upload binary (precompiled for the right target) -> if not provided it will expect FirmwareUpdater sketch to be already flashed on the board + firmware upload binary (precompiled for the right target) + -get_available_for string + Ask for available firmwares matching a given board -model string - module model (winc or nina) + module model (winc, nina or sara) -port string serial port to use for flashing -programmer string @@ -51,18 +53,20 @@ Usage of ./distrib/linux64/updater: -read read all firmware and output to stdout -restore_binary string - firmware upload binary (precompiled for the right target) -> if not provided it will try to restore the original firmware + firmware upload binary (precompiled for the right target) ``` ## How to build the tools from source file -From the sources root directory run: +To build we use [task](https://taskfile.dev/) for simplicity. From the sources root directory run: ``` -go build -o updater +task dist:_ ``` -This will create the `updater` executable. +Where could be one of: `macOS`,`Windows`,`Linux`. And : `32bit`, `64bit`, `ARM` or `ARM64` + +This will create the `FirmwareUploader` executable. ## Security @@ -86,4 +90,4 @@ details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -[security-policy]: https://github.com/arduino/FirmwareUpdater/security/policy +[security-policy]: https://github.com/arduino/FirmwareUploader/security/policy diff --git a/Taskfile.yml b/Taskfile.yml index cf3e5cd2..31f1686a 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -56,7 +56,7 @@ tasks: - npx {{ .PRETTIER }} --write "**/*.{yml,yaml}" vars: - PROJECT_NAME: "FirmwareUpdater" + PROJECT_NAME: "FirmwareUploader" DIST_DIR: "dist" # build vars COMMIT: @@ -71,9 +71,9 @@ vars: LDFLAGS: > -ldflags ' - -X github.com/arduino/FirmwareUpdater/version.versionString={{.VERSION}} - -X github.com/arduino/FirmwareUpdater/version.commit={{ .COMMIT }} - -X github.com/arduino/FirmwareUpdater/version.date={{.TIMESTAMP}} + -X github.com/arduino/FirmwareUploader/version.versionString={{.VERSION}} + -X github.com/arduino/FirmwareUploader/version.commit={{ .COMMIT }} + -X github.com/arduino/FirmwareUploader/version.date={{.TIMESTAMP}} ' # test vars GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic" @@ -82,9 +82,9 @@ vars: TEST_LDFLAGS: > -ldflags ' - -X github.com/arduino/FirmwareUpdater/version.versionString={{.TEST_VERSION}} - -X github.com/arduino/FirmwareUpdater/version.commit={{.TEST_COMMIT}} - -X github.com/arduino/FirmwareUpdater/version.date={{.TIMESTAMP}} + -X github.com/arduino/FirmwareUploader/version.versionString={{.TEST_VERSION}} + -X github.com/arduino/FirmwareUploader/version.commit={{.TEST_COMMIT}} + -X github.com/arduino/FirmwareUploader/version.date={{.TIMESTAMP}} ' # check-lint vars GOLINTBIN: diff --git a/go.mod b/go.mod index 20d4c579..e4a191d3 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/arduino/FirmwareUpdater +module github.com/arduino/FirmwareUploader go 1.14 diff --git a/gon.config.hcl b/gon.config.hcl index 685cc8bd..00054d08 100644 --- a/gon.config.hcl +++ b/gon.config.hcl @@ -1,5 +1,5 @@ -source = ["dist/macos64/FirmwareUpdater"] -bundle_id = "cc.arduino.FirmwareUpdater" +source = ["dist/macos64/FirmwareUploader"] +bundle_id = "cc.arduino.FirmwareUploader" sign { application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)" @@ -8,5 +8,5 @@ sign { # Ask Gon for zip output to force notarization process to take place. # The CI will ignore the zip output, using the signed binary only. zip { - output_path = "FirmwareUpdater.zip" + output_path = "FirmwareUploader.zip" } \ No newline at end of file diff --git a/main.go b/main.go index aaaf99e2..006cb3f3 100644 --- a/main.go +++ b/main.go @@ -8,11 +8,11 @@ import ( "os" "strings" - "github.com/arduino/FirmwareUpdater/modules/nina" - "github.com/arduino/FirmwareUpdater/modules/sara" - "github.com/arduino/FirmwareUpdater/modules/winc" - "github.com/arduino/FirmwareUpdater/utils" - "github.com/arduino/FirmwareUpdater/utils/context" + "github.com/arduino/FirmwareUploader/modules/nina" + "github.com/arduino/FirmwareUploader/modules/sara" + "github.com/arduino/FirmwareUploader/modules/winc" + "github.com/arduino/FirmwareUploader/utils" + "github.com/arduino/FirmwareUploader/utils/context" ) var ctx context.Context diff --git a/modules/nina/flasher.go b/modules/nina/flasher.go index 8d85dc07..3b0c1d42 100644 --- a/modules/nina/flasher.go +++ b/modules/nina/flasher.go @@ -26,7 +26,7 @@ import ( "log" "time" - "github.com/arduino/FirmwareUpdater/utils" + "github.com/arduino/FirmwareUploader/utils" "go.bug.st/serial" ) diff --git a/modules/nina/main.go b/modules/nina/main.go index 7659279d..50f1b155 100644 --- a/modules/nina/main.go +++ b/modules/nina/main.go @@ -28,9 +28,9 @@ import ( "strconv" "strings" - "github.com/arduino/FirmwareUpdater/programmers/avrdude" - "github.com/arduino/FirmwareUpdater/programmers/bossac" - "github.com/arduino/FirmwareUpdater/utils/context" + "github.com/arduino/FirmwareUploader/programmers/avrdude" + "github.com/arduino/FirmwareUploader/programmers/bossac" + "github.com/arduino/FirmwareUploader/utils/context" ) var f *Flasher diff --git a/modules/sara/flasher.go b/modules/sara/flasher.go index 79fb0081..570783ff 100644 --- a/modules/sara/flasher.go +++ b/modules/sara/flasher.go @@ -24,7 +24,7 @@ import ( "strings" "time" - "github.com/arduino/FirmwareUpdater/utils" + "github.com/arduino/FirmwareUploader/utils" "go.bug.st/serial" ) diff --git a/modules/sara/main.go b/modules/sara/main.go index 5e7387b1..1932b0f3 100644 --- a/modules/sara/main.go +++ b/modules/sara/main.go @@ -21,8 +21,8 @@ package sara import ( "fmt" - "github.com/arduino/FirmwareUpdater/programmers/bossac" - "github.com/arduino/FirmwareUpdater/utils/context" + "github.com/arduino/FirmwareUploader/programmers/bossac" + "github.com/arduino/FirmwareUploader/utils/context" "io/ioutil" "log" "strconv" diff --git a/modules/winc/flasher.go b/modules/winc/flasher.go index 14bc47d7..602a499b 100644 --- a/modules/winc/flasher.go +++ b/modules/winc/flasher.go @@ -25,7 +25,7 @@ import ( "log" "time" - "github.com/arduino/FirmwareUpdater/utils" + "github.com/arduino/FirmwareUploader/utils" "go.bug.st/serial" ) diff --git a/modules/winc/main.go b/modules/winc/main.go index dff2490f..8511ccd2 100644 --- a/modules/winc/main.go +++ b/modules/winc/main.go @@ -28,8 +28,8 @@ import ( "os" "strconv" - "github.com/arduino/FirmwareUpdater/programmers/bossac" - "github.com/arduino/FirmwareUpdater/utils/context" + "github.com/arduino/FirmwareUploader/programmers/bossac" + "github.com/arduino/FirmwareUploader/utils/context" ) var f *Flasher diff --git a/programmers/avrdude/avrdude.go b/programmers/avrdude/avrdude.go index 53cb33ff..96b047de 100644 --- a/programmers/avrdude/avrdude.go +++ b/programmers/avrdude/avrdude.go @@ -7,7 +7,7 @@ import ( "path/filepath" "time" - "github.com/arduino/FirmwareUpdater/utils/context" + "github.com/arduino/FirmwareUploader/utils/context" "github.com/arduino/arduino-cli/executils" "github.com/pkg/errors" ) diff --git a/programmers/bossac/bossac.go b/programmers/bossac/bossac.go index 86851b65..b530f928 100644 --- a/programmers/bossac/bossac.go +++ b/programmers/bossac/bossac.go @@ -7,7 +7,7 @@ import ( "path/filepath" "time" - "github.com/arduino/FirmwareUpdater/utils/context" + "github.com/arduino/FirmwareUploader/utils/context" "github.com/arduino/arduino-cli/arduino/serialutils" "github.com/arduino/arduino-cli/executils" "github.com/pkg/errors"