Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update distribution example to latest
Browse files Browse the repository at this point in the history
fhunleth committed Jul 29, 2023

Verified

This commit was signed with the committer’s verified signature.
lucasteles Lucas Teles
1 parent 4bedb7f commit cc349e9
Showing 8 changed files with 90 additions and 84 deletions.
6 changes: 3 additions & 3 deletions hello_distribution/config/config.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
# This file is responsible for configuring your application and its
# dependencies.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
@@ -26,7 +26,7 @@ config :nerves, source_date_epoch: "1630590634"

config :logger, backends: [RingLogger]

if Mix.target() == :host or Mix.target() == :"" do
if Mix.target() == :host do
import_config "host.exs"
else
import_config "target.exs"
15 changes: 2 additions & 13 deletions hello_distribution/config/target.exs
Original file line number Diff line number Diff line change
@@ -4,24 +4,13 @@ import Config
# docs for separating out critical OTP applications such as those
# involved with firmware updates.

config :shoehorn,
init: [:nerves_runtime, :nerves_pack],
app: Mix.Project.config()[:app]

# Nerves Runtime can enumerate hardware devices and send notifications via
# SystemRegistry. This slows down startup and not many programs make use of
# this feature.

config :nerves_runtime, :kernel, use_system_registry: false
config :shoehorn, init: [:nerves_runtime, :nerves_pack]

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

config :nerves,
erlinit: [
hostname_pattern: "nerves-%s"
]
config :nerves, :erlinit, update_clock: true

# Configure the device for SSH IEx prompt access and firmware updates
#
33 changes: 23 additions & 10 deletions hello_distribution/mix.exs
Original file line number Diff line number Diff line change
@@ -3,7 +3,19 @@ defmodule HelloDistribution.MixProject do

@app :hello_distribution
@version "0.1.0"
@all_targets [:rpi, :rpi0, :rpi2, :rpi3, :rpi3a, :rpi4, :bbb, :osd32mp1, :x86_64]
@all_targets [
:rpi,
:rpi0,
:rpi2,
:rpi3,
:rpi3a,
:rpi4,
:bbb,
:osd32mp1,
:x86_64,
:grisp2,
:mangopi_mq_pro
]

def project do
[
@@ -12,7 +24,6 @@ defmodule HelloDistribution.MixProject do
elixir: "~> 1.9",
archives: [nerves_bootstrap: "~> 1.10"],
start_permanent: Mix.env() == :prod,
build_embedded: true,
deps: deps(),
releases: [{@app, release()}],
preferred_cli_target: [run: :host, test: :host]
@@ -31,17 +42,17 @@ defmodule HelloDistribution.MixProject do
defp deps do
[
# Dependencies for all targets
{:nerves, "~> 1.7.0", runtime: false},
{:shoehorn, "~> 0.7.0"},
{:ring_logger, "~> 0.8.1"},
{:toolshed, "~> 0.2.13"},
{:nerves, "~> 1.10", runtime: false},
{:shoehorn, "~> 0.9.0"},
{:ring_logger, "~> 0.10.2"},
{:toolshed, "~> 0.3.1"},
{:phoenix_pubsub, "~> 2.0"},

# Dependencies for all targets except :host
{:nerves_runtime, "~> 0.11.3", targets: @all_targets},
{:nerves_runtime, "~> 0.13.0", targets: @all_targets},
{:vintage_net_wizard, "~> 0.2", targets: @all_targets},
{:nerves_pack, "~> 0.5.0", targets: @all_targets},
{:circuits_gpio, "~> 0.4.8", targets: @all_targets},
{:nerves_pack, "~> 0.7.0", targets: @all_targets},
{:circuits_gpio, "~> 1.0", targets: @all_targets},
{:mdns_lite, "~> 0.8", targets: @all_targets},

# Dependencies for specific targets
@@ -53,7 +64,9 @@ defmodule HelloDistribution.MixProject do
{:nerves_system_rpi4, "~> 1.13", runtime: false, targets: :rpi4},
{:nerves_system_bbb, "~> 2.8", runtime: false, targets: :bbb},
{:nerves_system_osd32mp1, "~> 0.4", runtime: false, targets: :osd32mp1},
{:nerves_system_x86_64, "~> 1.13", runtime: false, targets: :x86_64}
{:nerves_system_x86_64, "~> 1.13", runtime: false, targets: :x86_64},
{:nerves_system_grisp2, "~> 0.3", runtime: false, targets: :grisp2},
{:nerves_system_mangopi_mq_pro, "~> 0.4", runtime: false, targets: :mangopi_mq_pro}
]
end

103 changes: 55 additions & 48 deletions hello_distribution/mix.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion hello_distribution/rel/vm.args.eex
Original file line number Diff line number Diff line change
@@ -18,6 +18,10 @@
## See http://erlang.org/doc/system_principles/system_principles.html#code-loading-strategy
-mode embedded

# Load code as per the boot script since not using archives
# See https://www.erlang.org/doc/man/init.html#command-line-flags
-code_path_choice strict

## Disable scheduler busy wait to reduce idle CPU usage and avoid delaying
## other OS processes. See http://erlang.org/doc/man/erl.html#+sbwt
+sbwt none
@@ -34,7 +38,8 @@
## Start the Elixir shell

-noshell
-user Elixir.IEx.CLI
-user elixir
-run elixir start_iex

## Enable colors in the shell
-elixir ansi_enabled true
8 changes: 0 additions & 8 deletions hello_distribution/test/hello_distribution_test.exs

This file was deleted.

1 change: 0 additions & 1 deletion hello_distribution/test/test_helper.exs

This file was deleted.

1 change: 1 addition & 0 deletions scripts/projects.sh
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ TARGETS="rpi0 rpi rpi2 rpi3 rpi3a rpi4 bbb x86_64 osd32mp1 mangopi_mq_pro"
ELIXIR_PROJECTS="blinky \
hello_gpio \
minimal \
hello_distribution \
hello_phoenix/firmware \
hello_live_view \
hello_wifi \

0 comments on commit cc349e9

Please sign in to comment.