From a9133269c851ff53fe2d518c0e468aee2f7beb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9E=E3=83=AA=E3=82=A6=E3=82=B9?= Date: Sat, 5 Jun 2021 20:52:51 -0500 Subject: [PATCH] Upgraded to latest Nerves version --- Makefile | 3 +++ mix.exs | 38 +++++++++++++++++++++++++------------- rel/config.exs | 33 --------------------------------- rel/plugins/.gitignore | 3 --- rel/vm.args | 2 +- 5 files changed, 29 insertions(+), 50 deletions(-) delete mode 100644 rel/config.exs delete mode 100644 rel/plugins/.gitignore diff --git a/Makefile b/Makefile index 44dc96f..372f0ea 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,9 @@ firmware: sdcard: export MIX_TARGET=rpi0 \ + && mix deps.clean --all \ + && mix deps.get \ + && mix deps.compile --all \ && mix firmware.burn -d ${SD_CARD} release: diff --git a/mix.exs b/mix.exs index 1cd482d..e6bcf8f 100644 --- a/mix.exs +++ b/mix.exs @@ -1,17 +1,20 @@ defmodule Kiwi.MixProject do use Mix.Project + @app :kiwi @all_targets [:rpi, :rpi0, :rpi2, :rpi3, :rpi3a, :bbb, :x86_64] def project do [ - app: :kiwi, - version: "0.1.0", - elixir: "~> 1.8", - archives: [nerves_bootstrap: "~> 1.5"], + app: @app, + version: "1.0.1", + elixir: "~> 1.9", + archives: [nerves_bootstrap: "~> 1.10"], start_permanent: Mix.env() == :prod, build_embedded: true, + preferred_cli_target: [run: :host, test: :host], aliases: [loadconfig: [&bootstrap/1]], + releases: [{@app, release()}], deps: deps() ] end @@ -29,11 +32,20 @@ defmodule Kiwi.MixProject do ] end + def release do + [ + overwrite: true, + cookie: "#{@app}_cookie", + include_erts: &Nerves.Release.erts/0, + steps: [&Nerves.Release.init/1, :assemble], + strip_beams: Mix.env() == :prod + ] + end defp deps do [ # Dependencies for all targets - {:nerves, "~> 1.4", runtime: false}, - {:shoehorn, "~> 0.4"}, + {:nerves, "~> 1.7", runtime: false}, + {:shoehorn, "~> 0.6"}, {:ring_logger, "~> 0.6"}, {:toolshed, "~> 0.2"}, {:circuits_gpio, "~> 0.4"}, @@ -51,13 +63,13 @@ defmodule Kiwi.MixProject do {:nerves_init_gadget, "~> 0.4", targets: @all_targets}, # Dependencies for specific targets - {:nerves_system_rpi, "~> 1.6", runtime: false, targets: :rpi}, - {:nerves_system_rpi0, "~> 1.6", runtime: false, targets: :rpi0}, - {:nerves_system_rpi2, "~> 1.6", runtime: false, targets: :rpi2}, - {:nerves_system_rpi3, "~> 1.6", runtime: false, targets: :rpi3}, - {:nerves_system_rpi3a, "~> 1.6", runtime: false, targets: :rpi3a}, - {:nerves_system_bbb, "~> 2.0", runtime: false, targets: :bbb}, - {:nerves_system_x86_64, "~> 1.6", runtime: false, targets: :x86_64}, + {:nerves_system_rpi, "~> 1.8", runtime: false, targets: :rpi}, + {:nerves_system_rpi0, "~> 1.8", runtime: false, targets: :rpi0}, + {:nerves_system_rpi2, "~> 1.8", runtime: false, targets: :rpi2}, + {:nerves_system_rpi3, "~> 1.8", runtime: false, targets: :rpi3}, + {:nerves_system_rpi3a, "~> 1.8", runtime: false, targets: :rpi3a}, + {:nerves_system_x86_64, "~> 1.8", runtime: false, targets: :x86_64}, + {:nerves_system_bbb, "~> 2.3", runtime: false, targets: :bbb}, ] end end diff --git a/rel/config.exs b/rel/config.exs deleted file mode 100644 index ddae8c8..0000000 --- a/rel/config.exs +++ /dev/null @@ -1,33 +0,0 @@ -use Mix.Releases.Config, - # This sets the default release built by `mix release` - default_release: :default, - # This sets the default environment used by `mix release` - default_environment: :dev - -# For a full list of config options for both releases -# and environments, visit https://hexdocs.pm/distillery/config/distillery.html - -# You may define one or more environments in this file, -# an environment's settings will override those of a release -# when building in that environment, this combination of release -# and environment configuration is called a profile - -environment :dev do - set(cookie: :"Unused with Nerves. See vm.args") -end - -environment :prod do - set(cookie: :"Unused with Nerves. See vm.args") -end - -# You may define one or more releases in this file. -# If you have not set a default release, or selected one -# when running `mix release`, the first release in the file -# will be used by default - -release :kiwi do - set(version: current_version(:kiwi)) - set(strip_debug_info: true) - plugin(Nerves) - plugin(Shoehorn) -end diff --git a/rel/plugins/.gitignore b/rel/plugins/.gitignore deleted file mode 100644 index 4fa3b5c..0000000 --- a/rel/plugins/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.* -!*.exs -!.gitignore \ No newline at end of file diff --git a/rel/vm.args b/rel/vm.args index f2dcfcb..8b6d2ea 100644 --- a/rel/vm.args +++ b/rel/vm.args @@ -5,7 +5,7 @@ ## for read only filesystem. # -name kiwi@0.0.0.0 --setcookie 5p6zs3f364hm56663jccfqpbt7jtirdmqswquixuktrr7qmdezq4tpsti4ckvlbp +-setcookie <%= @release.options[:cookie] %> ## Use Ctrl-C to interrupt the current shell rather than invoking the emulator's ## break handler and possibly exiting the VM.