changed CHANGELOG.md
 
@@ -1,5 +1,11 @@
1
1
# Changelog
2
2
3
+ ## v0.5.2
4
+
5
+ * Enhancements
6
+ * Use `:dhcpd` instead of `:linklocal` for defaults.
7
+ * Load `/etc/iex.exs` on ssh connections
8
+
3
9
## v0.5.1
4
10
5
11
* New features
changed README.md
 
@@ -244,7 +244,7 @@ You may customize `nerves_init_gadget` using your `config.exs`:
244
244
```elixir
245
245
config :nerves_init_gadget,
246
246
ifname: "usb0",
247
- address_method: :linklocal,
247
+ address_method: :dhcpd,
248
248
mdns_domain: "nerves.local",
249
249
node_name: nil,
250
250
node_host: :mdns_domain
changed hex_metadata.config
 
@@ -44,4 +44,4 @@
44
44
{<<"optional">>,false},
45
45
{<<"repository">>,<<"hexpm">>},
46
46
{<<"requirement">>,<<"~> 0.3">>}]]}.
47
- {<<"version">>,<<"0.5.1">>}.
47
+ {<<"version">>,<<"0.5.2">>}.
changed lib/nerves_init_gadget/options.ex
 
@@ -4,7 +4,7 @@ defmodule Nerves.InitGadget.Options do
4
4
alias Nerves.InitGadget.Options
5
5
6
6
defstruct ifname: "usb0",
7
- address_method: :linklocal,
7
+ address_method: :dhcpd,
8
8
mdns_domain: "nerves.local",
9
9
node_name: nil,
10
10
node_host: :mdns_domain,
changed lib/nerves_init_gadget/ssh_console.ex
 
@@ -31,6 +31,10 @@ defmodule Nerves.InitGadget.SSHConsole do
31
31
32
32
cb_opts = [authorized_keys: decoded_authorized_keys]
33
33
34
+ # Nerves stores a system default iex.exs. It's not in IEx's search path,
35
+ # so run a search with it included.
36
+ iex_opts = [dot_iex_path: find_iex_exs()]
37
+
34
38
# Reuse the system_dir as well to allow for auth to work with the shared
35
39
# keys.
36
40
{:ok, ssh} =
 
@@ -38,10 +42,16 @@ defmodule Nerves.InitGadget.SSHConsole do
38
42
{:id_string, :random},
39
43
{:key_cb, {Nerves.Firmware.SSH.Keys, cb_opts}},
40
44
{:system_dir, Nerves.Firmware.SSH.Application.system_dir()},
41
- {:shell, {Elixir.IEx, :start, []}},
45
+ {:shell, {Elixir.IEx, :start, [iex_opts]}},
42
46
{:subsystems, [:ssh_sftpd.subsystem_spec(cwd: '/')]}
43
47
])
44
48
45
49
ssh
46
50
end
51
+
52
+ defp find_iex_exs() do
53
+ [".iex.exs", "~/.iex.exs", "/etc/iex.exs"]
54
+ |> Enum.map(&Path.expand/1)
55
+ |> Enum.find("", &File.regular?/1)
56
+ end
47
57
end
changed mix.exs
 
@@ -1,7 +1,7 @@
1
1
defmodule Nerves.InitGadget.MixProject do
2
2
use Mix.Project
3
3
4
- @version "0.5.1"
4
+ @version "0.5.2"
5
5
6
6
@description """
7
7
Simple initialization for devices running Nerves