rewrite
This commit is contained in:
parent
ba8f072d23
commit
2c935df494
110 changed files with 1350 additions and 8011 deletions
35
eisrom_firmware/config/config.exs
Normal file
35
eisrom_firmware/config/config.exs
Normal file
|
@ -0,0 +1,35 @@
|
|||
# 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.
|
||||
import Config
|
||||
|
||||
# Enable the Nerves integration with Mix
|
||||
Application.start(:nerves_bootstrap)
|
||||
|
||||
config :eisrom_firmware, target: Mix.target()
|
||||
|
||||
# Customize non-Elixir parts of the firmware. See
|
||||
# https://hexdocs.pm/nerves/advanced-configuration.html for details.
|
||||
|
||||
config :nerves, :firmware, rootfs_overlay: "rootfs_overlay"
|
||||
|
||||
# Set the SOURCE_DATE_EPOCH date for reproducible builds.
|
||||
# See https://reproducible-builds.org/docs/source-date-epoch/ for more information
|
||||
|
||||
config :nerves, source_date_epoch: "1665154132"
|
||||
|
||||
# Use Ringlogger as the logger backend and remove :console.
|
||||
# See https://hexdocs.pm/ring_logger/readme.html for more information on
|
||||
# configuring ring_logger.
|
||||
|
||||
config :logger, backends: [RingLogger]
|
||||
|
||||
if Mix.target() == :host do
|
||||
import_config "host.exs"
|
||||
else
|
||||
import_config "target.exs"
|
||||
end
|
||||
|
||||
import_config "secrets.exs"
|
4
eisrom_firmware/config/host.exs
Normal file
4
eisrom_firmware/config/host.exs
Normal file
|
@ -0,0 +1,4 @@
|
|||
import Config
|
||||
|
||||
# Add configuration that is only needed when running on the host here.
|
||||
import_config "../../eisrom_ui/config/dev.exs"
|
93
eisrom_firmware/config/target.exs
Normal file
93
eisrom_firmware/config/target.exs
Normal file
|
@ -0,0 +1,93 @@
|
|||
import Config
|
||||
|
||||
# Use shoehorn to start the main application. See the shoehorn
|
||||
# library documentation for more control in ordering how OTP
|
||||
# applications are started and handling failures.
|
||||
|
||||
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"
|
||||
]
|
||||
|
||||
# Configure the device for SSH IEx prompt access and firmware updates
|
||||
#
|
||||
# * See https://hexdocs.pm/nerves_ssh/readme.html for general SSH configuration
|
||||
# * See https://hexdocs.pm/ssh_subsystem_fwup/readme.html for firmware updates
|
||||
|
||||
keys =
|
||||
[
|
||||
Path.join([System.user_home!(), ".ssh", "id_rsa.pub"]),
|
||||
Path.join([System.user_home!(), ".ssh", "id_ecdsa.pub"]),
|
||||
Path.join([System.user_home!(), ".ssh", "id_ed25519.pub"])
|
||||
]
|
||||
|> Enum.filter(&File.exists?/1)
|
||||
|
||||
if keys == [],
|
||||
do:
|
||||
Mix.raise("""
|
||||
No SSH public keys found in ~/.ssh. An ssh authorized key is needed to
|
||||
log into the Nerves device and update firmware on it using ssh.
|
||||
See your project's config.exs for this error message.
|
||||
""")
|
||||
|
||||
config :nerves_ssh,
|
||||
authorized_keys: Enum.map(keys, &File.read!/1)
|
||||
|
||||
# Configure the network using vintage_net
|
||||
# See https://github.com/nerves-networking/vintage_net for more information
|
||||
config :vintage_net,
|
||||
regulatory_domain: "US",
|
||||
config: [
|
||||
{"usb0", %{type: VintageNetDirect}},
|
||||
{"eth0",
|
||||
%{
|
||||
type: VintageNetEthernet,
|
||||
ipv4: %{method: :dhcp}
|
||||
}},
|
||||
{"wlan0", %{type: VintageNetWiFi}}
|
||||
]
|
||||
|
||||
config :mdns_lite,
|
||||
# The `hosts` key specifies what hostnames mdns_lite advertises. `:hostname`
|
||||
# advertises the device's hostname.local. For the official Nerves systems, this
|
||||
# is "nerves-<4 digit serial#>.local". The `"nerves"` host causes mdns_lite
|
||||
# to advertise "nerves.local" for convenience. If more than one Nerves device
|
||||
# is on the network, it is recommended to delete "nerves" from the list
|
||||
# because otherwise any of the devices may respond to nerves.local leading to
|
||||
# unpredictable behavior.
|
||||
|
||||
hosts: [:hostname, "nerves"],
|
||||
ttl: 120,
|
||||
|
||||
# Advertise the following services over mDNS.
|
||||
services: [
|
||||
%{
|
||||
protocol: "ssh",
|
||||
transport: "tcp",
|
||||
port: 22
|
||||
},
|
||||
%{
|
||||
protocol: "sftp-ssh",
|
||||
transport: "tcp",
|
||||
port: 22
|
||||
},
|
||||
%{
|
||||
protocol: "epmd",
|
||||
transport: "tcp",
|
||||
port: 4369
|
||||
}
|
||||
]
|
||||
|
||||
# Import target specific config. This must remain at the bottom
|
||||
# of this file so it overrides the configuration defined above.
|
||||
# Uncomment to use target specific configurations
|
||||
|
||||
# import_config "#{Mix.target()}.exs"
|
||||
|
||||
import_config "../../eisrom_ui/config/prod.exs"
|
Loading…
Add table
Add a link
Reference in a new issue