Skip to content

Commit 060cce9

Browse files
committed
Update distribution example to latest
1 parent 7adc609 commit 060cce9

File tree

8 files changed

+87
-83
lines changed

8 files changed

+87
-83
lines changed

hello_distribution/config/config.exs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This file is responsible for configuring your application
2-
# and its dependencies with the aid of the Mix.Config module.
1+
# This file is responsible for configuring your application and its
2+
# dependencies.
33
#
44
# This configuration file is loaded before any dependency and
55
# is restricted to this project.
@@ -26,7 +26,7 @@ config :nerves, source_date_epoch: "1630590634"
2626

2727
config :logger, backends: [RingLogger]
2828

29-
if Mix.target() == :host or Mix.target() == :"" do
29+
if Mix.target() == :host do
3030
import_config "host.exs"
3131
else
3232
import_config "target.exs"

hello_distribution/config/target.exs

+2-13
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,13 @@ import Config
44
# docs for separating out critical OTP applications such as those
55
# involved with firmware updates.
66

7-
config :shoehorn,
8-
init: [:nerves_runtime, :nerves_pack],
9-
app: Mix.Project.config()[:app]
10-
11-
# Nerves Runtime can enumerate hardware devices and send notifications via
12-
# SystemRegistry. This slows down startup and not many programs make use of
13-
# this feature.
14-
15-
config :nerves_runtime, :kernel, use_system_registry: false
7+
config :shoehorn, init: [:nerves_runtime, :nerves_pack]
168

179
# Erlinit can be configured without a rootfs_overlay. See
1810
# https://github.com/nerves-project/erlinit/ for more information on
1911
# configuring erlinit.
2012

21-
config :nerves,
22-
erlinit: [
23-
hostname_pattern: "nerves-%s"
24-
]
13+
config :nerves, :erlinit, update_clock: true
2514

2615
# Configure the device for SSH IEx prompt access and firmware updates
2716
#

hello_distribution/mix.exs

+23-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@ defmodule HelloDistribution.MixProject do
33

44
@app :hello_distribution
55
@version "0.1.0"
6-
@all_targets [:rpi, :rpi0, :rpi2, :rpi3, :rpi3a, :rpi4, :bbb, :osd32mp1, :x86_64]
6+
@all_targets [
7+
:rpi,
8+
:rpi0,
9+
:rpi2,
10+
:rpi3,
11+
:rpi3a,
12+
:rpi4,
13+
:bbb,
14+
:osd32mp1,
15+
:x86_64,
16+
:grisp2,
17+
:mangopi_mq_pro
18+
]
719

820
def project do
921
[
@@ -31,17 +43,17 @@ defmodule HelloDistribution.MixProject do
3143
defp deps do
3244
[
3345
# Dependencies for all targets
34-
{:nerves, "~> 1.7.0", runtime: false},
35-
{:shoehorn, "~> 0.7.0"},
36-
{:ring_logger, "~> 0.8.1"},
37-
{:toolshed, "~> 0.2.13"},
46+
{:nerves, "~> 1.10", runtime: false},
47+
{:shoehorn, "~> 0.9.0"},
48+
{:ring_logger, "~> 0.10.2"},
49+
{:toolshed, "~> 0.3.1"},
3850
{:phoenix_pubsub, "~> 2.0"},
3951

4052
# Dependencies for all targets except :host
41-
{:nerves_runtime, "~> 0.11.3", targets: @all_targets},
53+
{:nerves_runtime, "~> 0.13.0", targets: @all_targets},
4254
{:vintage_net_wizard, "~> 0.2", targets: @all_targets},
43-
{:nerves_pack, "~> 0.5.0", targets: @all_targets},
44-
{:circuits_gpio, "~> 0.4.8", targets: @all_targets},
55+
{:nerves_pack, "~> 0.7.0", targets: @all_targets},
56+
{:circuits_gpio, "~> 1.0", targets: @all_targets},
4557
{:mdns_lite, "~> 0.8", targets: @all_targets},
4658

4759
# Dependencies for specific targets
@@ -53,7 +65,9 @@ defmodule HelloDistribution.MixProject do
5365
{:nerves_system_rpi4, "~> 1.13", runtime: false, targets: :rpi4},
5466
{:nerves_system_bbb, "~> 2.8", runtime: false, targets: :bbb},
5567
{:nerves_system_osd32mp1, "~> 0.4", runtime: false, targets: :osd32mp1},
56-
{:nerves_system_x86_64, "~> 1.13", runtime: false, targets: :x86_64}
68+
{:nerves_system_x86_64, "~> 1.13", runtime: false, targets: :x86_64},
69+
{:nerves_system_grisp2, "~> 0.3", runtime: false, targets: :grisp2},
70+
{:nerves_system_mangopi_mq_pro, "~> 0.4", runtime: false, targets: :mangopi_mq_pro}
5771
]
5872
end
5973

hello_distribution/mix.lock

+52-48
Large diffs are not rendered by default.

hello_distribution/rel/vm.args.eex

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
## See http://erlang.org/doc/system_principles/system_principles.html#code-loading-strategy
1919
-mode embedded
2020

21+
# Load code as per the boot script since not using archives
22+
# See https://www.erlang.org/doc/man/init.html#command-line-flags
23+
-code_path_choice strict
24+
2125
## Disable scheduler busy wait to reduce idle CPU usage and avoid delaying
2226
## other OS processes. See http://erlang.org/doc/man/erl.html#+sbwt
2327
+sbwt none
@@ -34,7 +38,8 @@
3438
## Start the Elixir shell
3539

3640
-noshell
37-
-user Elixir.IEx.CLI
41+
-user elixir
42+
-run elixir start_iex
3843

3944
## Enable colors in the shell
4045
-elixir ansi_enabled true

hello_distribution/test/hello_distribution_test.exs

-8
This file was deleted.

hello_distribution/test/test_helper.exs

-1
This file was deleted.

scripts/projects.sh

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ TARGETS="rpi0 rpi rpi2 rpi3 rpi3a rpi4 bbb x86_64 osd32mp1 mangopi_mq_pro"
44
ELIXIR_PROJECTS="blinky \
55
hello_gpio \
66
minimal \
7+
hello_distribution \
78
hello_phoenix/firmware \
89
hello_live_view \
910
hello_wifi \

0 commit comments

Comments
 (0)