Skip to content

Commit 4331bbf

Browse files
committed
Simplify so quickstart boots
1 parent e7e6ccc commit 4331bbf

File tree

6 files changed

+24
-105
lines changed

6 files changed

+24
-105
lines changed

config/jslinux.exs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Config
2+
3+
# Configure the network using vintage_net
4+
# See https://github.com/nerves-networking/vintage_net for more information
5+
config :vintage_net,
6+
config: [
7+
# {"eth0", %{type: VintageNetEthernet}},
8+
]

config/target.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Config
44
# docs for separating out critical OTP applications such as those
55
# involved with firmware updates.
66

7-
config :shoehorn, init: [:nerves_runtime, :nerves_pack]
7+
config :shoehorn, init: [:nerves_runtime]
88

99
# Erlinit can be configured without a rootfs_overlay. See
1010
# https://github.com/nerves-project/erlinit/ for more information on
@@ -16,7 +16,7 @@ config :nerves, :erlinit, update_clock: true
1616
# See https://hexdocs.pm/ring_logger/readme.html for more information on
1717
# configuring ring_logger.
1818

19-
config :logger, backends: [RingLogger, RamoopsLogger]
19+
config :logger, backends: [RingLogger]
2020

2121
# Configure the device for SSH IEx prompt access and firmware updates
2222
#

lib/circuits_quickstart/application.ex

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ defmodule CircuitsQuickstart.Application do
66
use Application
77

88
def start(_type, _args) do
9-
if target() != :host do
10-
setup_wifi()
11-
end
12-
139
# See https://hexdocs.pm/elixir/Supervisor.html
1410
# for other strategies and supported options
1511
opts = [strategy: :one_for_one, name: CircuitsQuickstart.Supervisor]
@@ -18,37 +14,4 @@ defmodule CircuitsQuickstart.Application do
1814

1915
Supervisor.start_link(children, opts)
2016
end
21-
22-
defp setup_wifi() do
23-
kv = Nerves.Runtime.KV.get_all()
24-
25-
if true?(kv["wifi_force"]) or wlan0_unconfigured?() do
26-
ssid = kv["wifi_ssid"]
27-
passphrase = kv["wifi_passphrase"]
28-
29-
unless empty?(ssid) do
30-
_ = VintageNetWiFi.quick_configure(ssid, passphrase)
31-
:ok
32-
end
33-
end
34-
end
35-
36-
defp wlan0_unconfigured?() do
37-
"wlan0" in VintageNet.configured_interfaces() and
38-
VintageNet.get_configuration("wlan0") == %{type: VintageNetWiFi}
39-
end
40-
41-
defp true?(""), do: false
42-
defp true?(nil), do: false
43-
defp true?("false"), do: false
44-
defp true?("FALSE"), do: false
45-
defp true?(_), do: true
46-
47-
defp empty?(""), do: true
48-
defp empty?(nil), do: true
49-
defp empty?(_), do: false
50-
51-
defp target() do
52-
Application.get_env(:circuits_quickstart, :target)
53-
end
5417
end

mix.exs

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,7 @@ defmodule CircuitsQuickstart.MixProject do
44
@app :circuits_quickstart
55
@version "0.5.4"
66
@all_targets [
7-
:rpi,
8-
:rpi0,
9-
:rpi2,
10-
:rpi3,
11-
:rpi3a,
12-
:rpi4,
13-
:bbb,
14-
:osd32mp1,
15-
:x86_64,
16-
:npi_imx6ull,
17-
:grisp2,
18-
:mangopi_mq_pro
7+
:jslinux
198
]
209

2110
def project do
@@ -43,35 +32,24 @@ defmodule CircuitsQuickstart.MixProject do
4332
# Dependencies for all targets
4433
{:nerves, "~> 1.9.0", runtime: false},
4534
{:shoehorn, "~> 0.9.0"},
46-
{:ring_logger, "~> 0.8.1"},
4735
{:toolshed, "~> 0.2.13"},
4836

4937
# Circuits projects
50-
{:circuits_uart, "~> 1.3"},
5138
{:circuits_gpio, "~> 1.0"},
5239
{:circuits_i2c, "~> 1.0"},
53-
{:circuits_spi, "~> 1.2"},
54-
{:pinout, "~> 0.1"},
55-
{:power_control, github: "cjfreeze/power_control"},
56-
{:ramoops_logger, "~> 0.3", targets: @all_targets},
5740

5841
# Dependencies for all targets except :host
5942
{:nerves_runtime, "~> 0.13.0", targets: @all_targets},
60-
{:nerves_pack, "~> 0.7.0", targets: @all_targets},
43+
{:nerves_motd, "~> 0.1", path: "~/git/nerves-project/nerves_motd", targets: @all_targets},
44+
{:ring_logger, "~> 0.8", targets: @all_targets},
45+
{:vintage_net, "~> 0.10", targets: @all_targets},
46+
{:vintage_net_ethernet, "~> 0.10", targets: @all_targets},
6147

6248
# Dependencies for specific targets
63-
{:nerves_system_rpi, "~> 1.19", runtime: false, targets: :rpi},
64-
{:nerves_system_rpi0, "~> 1.19", runtime: false, targets: :rpi0},
65-
{:nerves_system_rpi2, "~> 1.19", runtime: false, targets: :rpi2},
66-
{:nerves_system_rpi3, "~> 1.19", runtime: false, targets: :rpi3},
67-
{:nerves_system_rpi3a, "~> 1.19", runtime: false, targets: :rpi3a},
68-
{:nerves_system_rpi4, "~> 1.19", runtime: false, targets: :rpi4},
69-
{:nerves_system_bbb, "~> 2.14", runtime: false, targets: :bbb},
70-
{:nerves_system_osd32mp1, "~> 0.10", runtime: false, targets: :osd32mp1},
71-
{:nerves_system_x86_64, "~> 1.19", runtime: false, targets: :x86_64},
72-
{:nerves_system_npi_imx6ull, "~> 0.6", runtime: false, targets: :npi_imx6ull},
73-
{:nerves_system_grisp2, "~> 0.3", runtime: false, targets: :grisp2},
74-
{:nerves_system_mangopi_mq_pro, "~> 0.3", runtime: false, targets: :mangopi_mq_pro}
49+
{:nerves_system_jslinux,
50+
path: "~/git/nerves-project/nerves_systems/src/nerves_system_jslinux",
51+
runtime: false,
52+
targets: :jslinux}
7553
]
7654
end
7755

0 commit comments

Comments
 (0)