diff --git a/.gitignore b/.gitignore index 522a78cf..e6be241a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,26 @@ -# App artifacts +# The directory Mix will write compiled artifacts to. /_build -/db + +# If you run "mix test --cover", coverage assets end up here. +/cover + +# The directory Mix downloads your dependencies sources to. /deps -/*.ez -# Nerves images -/_images +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez + +# Web stuffs +npm* +node_modules +bundle.js -# Generate on crash by the VM erl_crash.dump -npm-debug.log ttb_last_config cover diff --git a/README.md b/README.md index f613adcc..8f035f38 100644 --- a/README.md +++ b/README.md @@ -1,125 +1,4 @@ -[![Build Status](https://travis-ci.org/FarmBot/farmbot_os.svg?branch=master)](https://travis-ci.org/FarmBot/farmbot_os.svg?branch=master) +# FarmbotOs -# FarmBot Software for the Raspberry Pi 3 -The "brains" of Farmbot. Responsible for receiving the commands from [the browser](https://github.com/FarmBot/farmbot-web-frontend) or the [FarmBot API](https://github.com/FarmBot/Farmbot-Web-API). It executes them and reports back the results to any subscribed user(s). +**TODO: Add description** -# First Time Installation - -If you are setting up your FarmBot for the first time, download the latest FarmBot OS `.img` file [here](https://github.com/FarmBot/farmbot_os/releases/latest). - -## Windows users - -* Download [Win32 Disk Imager](https://sourceforge.net/projects/win32diskimager/) -* Select the `.img` file you downloaded -* Select your sdcard's drive letter -* Click `write` - -## Linux / OSX / UNIX -* `dd if=img_file of=/dev/sdX` -* where img_file is the path to you `.img` file, and X is your device's drive letter. - -## Running - 0. Plug your SD Card into your RPi3 - 0. Plug your Arduino into your RPi3 - 0. Plug your power into your RPi3 - 0. From a WiFi enabled device*, search for the SSID `FarmbotConfigurator` - 0. Connect to that and open a web browser to [http://192.168.24.1/](http://192.168.24.1) - 0. Follow the on screen instructions to configure your FarmBot. Once you save your configuration FarmBot will connect to your home WiFi network and to the FarmBot web application. - -\* If you are using a smartphone you may need to disable cellular data to allow your phone's browser to connect to the configurator. - -## Updating the firmware -To update the firmware on the Raspberry Pi and the Arduino, simply use the "update" buttons on the web application. There is no need to reinstall the entire OS. - -# Issues -Please read through the [FAQ](FAQ.md). If you don't see what you need please by all means open a Github Issue! - -# Building / Development (for developers only) - -## Technical Stuff -* Written in [Elixir](http://elixir-lang.org/) using [Nerves Project](http://nerves-project.org/). -* Device status info such as X,Y,Z and calibration data is stored on the Data partition Nerves allows. -* Backups to the cloud provided by [Farmbot API](https://github.com/farmbot/farmbot-web-api) -* Messaging happens via [MQTT](https://github.com/farmbot/mqtt-gateway) - -## Building -[You need Linux to build Linux.](http://www.whylinuxisbetter.net/). Windows is not supported. Bash for Windows and Cygwin will not work. A VM or dual boot environment will work. So with that rant out of the way, and ready for revision here are the steps to build: -* Install Elixir and Erlang. ([installer script]("https://gist.github.com/ConnorRigby/8a8bffff935d1a43cd74c4b8cf28a845")) -* Install [`Nerves`](https://hexdocs.pm/nerves/installation.html) and all related dependencies. -* clone this repo. `git clone https://github.com/FarmBot/farmbot-raspberry-pi-controller.git` -* `cd farmbot-raspberry-pi-controller`. -* Insert an sdcard into your development machine and run: - -```bash -MIX_ENV=prod mix deps.get -MIX_ENV=prod mix firmware -MIX_ENV=prod mix firmware.burn -``` - -You can also run locally (not on an RPI3- Windows is supported for this): - -```bash -export MIX_ENV=dev -rm -rf _deps build _images -mix deps.get -iex -S mix -``` - -You should only need to do the first two commands once. - -## Running Tests -There aren't a lot of tests, but they do exist and can be run by executing the following: -```bash -MIX_ENV=test mix deps.get -mix test --no-start -``` - -Make sure to have the `--no-start` in there. Otherwise it will try to start the -supervision tree, and tests will be broken and what not. - -## Debugging on hardware - -The Raspberry Pi will boot up with an Iex console on the hardware UART. If you need to debug something this is the easiest to get too. - -If you do not have a 3.3v FTDI cable, you can build the firmware with the console on HDMI. -In the `erlinit.config` file change `-c ttyS0` to `-c ttyS1`. This requires a usb mouse, keyboard and monitor into your pi. - -## Development Tips - -You can connect IEx to the running pi by running -`iex --name console@localhost --remsh farmbot@ --cookie democookie`. - -Debug message still only will print to UART or HDMI (whichever you have configured) - -If you frequently build the firmware, removing the sdcard and writing the build every time gets pretty old. You can upload firmware to an already running farmbot one of two ways after you run a successful `mix firmware` -0. You can upload the image to the pi using CURL or similar. `curl -T _images/rpi3/fw.fw "http://$RPI_IP_ADDRESS:8988/firmware" -H "Content-Type: application/x-firmware" -H "X-Reboot: true"` -0. Or you can host the .fw file on your pc using a webserver ie `npm install serve` and download it from the pi.This should be ran ON THE PI ITSELF `Downloader.download_and_install_update("http:///WHEREVER YOUR FILE IS")` - -# Building for production - -## Major version change -you will have to do one of two things: -0. Do a fresh clone of this repo. (prefered) -0. Clean everything out with something along the lines of `rm -rf _build deps _images rel/fw` - -Then follow these steps then follow the steps for a minor version. -```bash -export MIX_ENV=prod -mix deps.get -``` -this will generate a .fw file in the images dir. this will be an update file. A raw image file is then generated from this file - -## Minor Version -```bash -export MIX_ENV=prod -mix firmware -cd _images/rpi3/ -fwup -a -d firmware.img -i fw.fw -t complete -``` - -These two files should be put into the github release. -If someone would like to write a Mix Task for this it'd be much appreciated. - -# Want to Help? - -[Low Hanging Fruit](https://github.com/FarmBot/farmbot_os/search?utf8=%E2%9C%93&q=TODO) diff --git a/apps/farmbot_auth/.gitignore b/apps/farmbot_auth/.gitignore new file mode 100644 index 00000000..6e1db0f1 --- /dev/null +++ b/apps/farmbot_auth/.gitignore @@ -0,0 +1,17 @@ +# The directory Mix will write compiled artifacts to. +/_build + +# If you run "mix test --cover", coverage assets end up here. +/cover + +# The directory Mix downloads your dependencies sources to. +/deps + +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez diff --git a/apps/farmbot_auth/LICENSE b/apps/farmbot_auth/LICENSE new file mode 100644 index 00000000..4fbbfb88 --- /dev/null +++ b/apps/farmbot_auth/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 FarmBot + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/apps/farmbot_auth/README.md b/apps/farmbot_auth/README.md new file mode 100644 index 00000000..ee59f581 --- /dev/null +++ b/apps/farmbot_auth/README.md @@ -0,0 +1,2 @@ +# Farmbot.Auth +A helpful module for logging in to Farmbot Web Services. diff --git a/apps/farmbot_auth/config/config.exs b/apps/farmbot_auth/config/config.exs new file mode 100644 index 00000000..77da2bd1 --- /dev/null +++ b/apps/farmbot_auth/config/config.exs @@ -0,0 +1,7 @@ +use Mix.Config + +# This app will go through this list of modules calling +# Module.on_token(token) +# When a token is recieved. +# config :farmbot_auth, +# callbacks: [] diff --git a/apps/farmbot_auth/lib/farmbot_auth.ex b/apps/farmbot_auth/lib/farmbot_auth.ex new file mode 100644 index 00000000..0e063aa8 --- /dev/null +++ b/apps/farmbot_auth/lib/farmbot_auth.ex @@ -0,0 +1,111 @@ +defmodule Farmbot.Auth do + @moduledoc """ + Gets a token and device information + """ + @modules Application.get_env(:farmbot_auth, :callbacks) ++ [Farmbot.Auth] + + use Timex + use GenServer + require Logger + + @doc """ + Application entry point + """ + def start(_type, args) do + Logger.debug("Farmbot.Auth Starting.") + start_link(args) + end + + @doc """ + Gets the public key from the API + """ + def get_public_key(server) do + case HTTPotion.get("#{server}/api/public_key") do + %HTTPotion.ErrorResponse{message: message} -> {:error, message} + %HTTPotion.Response{body: body, + headers: _headers, + status_code: 200} -> {:ok, RSA.decode_key(body)} + end + end + + @doc """ + Encrypts the key with the email, pass, and server + """ + def encrypt(email, pass, pub_key) do + f = Poison.encode!(%{"email": email, + "password": pass, + "id": Nerves.Lib.UUID.generate, + "version": 1}) + |> RSA.encrypt({:public, pub_key}) + |> String.Chars.to_string + {:ok, f} + end + + @doc """ + Get a token from the server with given token + """ + def get_token_from_server(secret, server) do + # I am not sure why this is done this way other than it works. + payload = Poison.encode!(%{user: %{credentials: :base64.encode_to_string(secret) |> String.Chars.to_string }} ) + case HTTPotion.post "#{server}/api/tokens", [body: payload, headers: ["Content-Type": "application/json"]] do + # Any other http error. + %HTTPotion.ErrorResponse{message: reason} -> {:error, reason} + # bad Password + %HTTPotion.Response{body: _, headers: _, status_code: 422} -> {:error, :bad_password} + # Token invalid. Need to try to get a new token here. + %HTTPotion.Response{body: _, headers: _, status_code: 401} -> {:error, :expired_token} + # We won + %HTTPotion.Response{body: body, headers: _headers, status_code: 200} -> + token = Poison.decode!(body) |> Map.get("token") + do_callbacks(token) + {:ok, token} + end + end + + @doc """ + Gets the token. + Will return a token if one exists, nil if not. + Returns {:error, reason} otherwise + """ + def get_token do + GenServer.call(__MODULE__, {:get_token}) + end + + # Genserver stuff + def init(_args) do + {:ok, nil} + end + + def start_link(args) do + GenServer.start_link(__MODULE__, args, name: __MODULE__ ) + end + + def handle_call({:get_token}, _from, nil) do + {:reply, nil, nil} + end + + def handle_call({:get_token}, _from, token) do + {:reply, {:ok, token}, token} + end + + def handle_info({:authorization, token}, _) do + {:noreply, token} + end + + def terminate(:normal, state) do + Logger.debug("AUTH DIED: #{inspect {state}}") + end + + def terminate(reason, state) do + Logger.error("AUTH DIED: #{inspect {reason, state}}") + end + + defp do_callbacks(token) do + spawn(fn -> + Enum.all?(@modules, fn(module) -> + send(module, {:authorization, token}) + end) + end) + end + +end diff --git a/apps/farmbot_auth/mix.exs b/apps/farmbot_auth/mix.exs new file mode 100644 index 00000000..d612fb51 --- /dev/null +++ b/apps/farmbot_auth/mix.exs @@ -0,0 +1,29 @@ +defmodule Farmbot.Auth.Mixfile do + use Mix.Project + + def project do + [app: :farmbot_auth, + version: "0.1.0", + elixir: "~> 1.3", + build_embedded: Mix.env == :prod, + start_permanent: Mix.env == :prod, + build_path: "../../_build", + config_path: "../../config/config.exs", + deps_path: "../../deps", + lockfile: "../../mix.lock", + deps: deps()] + end + + def application do + [mod: {Farmbot.Auth, []}, + applications: [:logger, :timex, :httpotion, :rsa, :nerves_lib, :poison]] + end + + defp deps do + [{:timex, "~> 3.0"}, + {:httpotion, "~> 3.0.0"}, + {:rsa, "~> 0.0.1"}, + {:nerves_lib, github: "nerves-project/nerves_lib"}, + {:poison, "~> 3.0"}] + end +end diff --git a/apps/farmbot_auth/test/farmbot_auth_test.exs b/apps/farmbot_auth/test/farmbot_auth_test.exs new file mode 100644 index 00000000..ca8f6579 --- /dev/null +++ b/apps/farmbot_auth/test/farmbot_auth_test.exs @@ -0,0 +1,8 @@ +defmodule Farmbot.AuthTest do + use ExUnit.Case + doctest Farmbot.Auth + + test "the truth" do + assert 1 + 1 == 2 + end +end diff --git a/apps/farmbot_auth/test/test_helper.exs b/apps/farmbot_auth/test/test_helper.exs new file mode 100644 index 00000000..869559e7 --- /dev/null +++ b/apps/farmbot_auth/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start() diff --git a/apps/farmbot_configurator/.gitignore b/apps/farmbot_configurator/.gitignore new file mode 100644 index 00000000..b461f219 --- /dev/null +++ b/apps/farmbot_configurator/.gitignore @@ -0,0 +1,22 @@ +# The directory Mix will write compiled artifacts to. +/_build + +# If you run "mix test --cover", coverage assets end up here. +/cover + +# The directory Mix downloads your dependencies sources to. +/deps + +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez + +*.secret* +node_modules +npm* +bundle.js diff --git a/apps/farmbot_configurator/LICENSE b/apps/farmbot_configurator/LICENSE new file mode 100644 index 00000000..4fbbfb88 --- /dev/null +++ b/apps/farmbot_configurator/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 FarmBot + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/apps/farmbot_configurator/README.md b/apps/farmbot_configurator/README.md new file mode 100644 index 00000000..eae9e371 --- /dev/null +++ b/apps/farmbot_configurator/README.md @@ -0,0 +1,2 @@ +# Farmbot.Configurator +Configuration application for farmbot_os diff --git a/apps/farmbot_configurator/config/config.exs b/apps/farmbot_configurator/config/config.exs new file mode 100644 index 00000000..d2d855e6 --- /dev/null +++ b/apps/farmbot_configurator/config/config.exs @@ -0,0 +1 @@ +use Mix.Config diff --git a/apps/farmbot_configurator/deleteme.exs b/apps/farmbot_configurator/deleteme.exs new file mode 100644 index 00000000..dfe7ab24 --- /dev/null +++ b/apps/farmbot_configurator/deleteme.exs @@ -0,0 +1,33 @@ +defmodule ERM do + use GenEvent + alias Farmbot.Configurator.EventManager, as: EM + require Logger + def start do + GenEvent.add_handler(EM, __MODULE__, []) + end + + def stop do + GenEvent.remove_handler(EM, __MODULE__, []) + end + + def init(_) do + {:ok, []} + end + + def handle_event( {:from_socket, %{"id" => id, "method" => "hey_bot", "params" => []}}, state) do + thing = %{id: id, results: "hey_front_end", error: nil} |> Poison.encode! + Logger.debug thing + EM.send_socket({:from_bot, thing}) + {:ok, state} + end + + + def handle_event({:from_socket, rpc}, state) do + Logger.debug "Got rpc: #{inspect rpc}" + {:ok, state} + end + + def handle_event(_,s) do + {:ok, s} + end +end diff --git a/apps/farmbot_configurator/lib/event_handler.ex b/apps/farmbot_configurator/lib/event_handler.ex new file mode 100644 index 00000000..0a3eaed5 --- /dev/null +++ b/apps/farmbot_configurator/lib/event_handler.ex @@ -0,0 +1,75 @@ +defmodule Farmbot.Configurator.EventHandler do + @moduledoc """ + Handles websocket to bot communication + """ + require Logger + alias Farmbot.Configurator.EventManager, as: EM + + # Public api + @doc """ + Adds a socket to the handler + """ + def add_socket(socket), + do: GenEvent.call(EM, __MODULE__, {:add_socket, socket}) + + @doc """ + Removes a socket to the handler + """ + def remove_socket(socket), + do: GenEvent.call(EM, __MODULE__, {:remove_socket, socket}) + + @doc """ + Gets all the sockets + """ + def sockets, do: GenEvent.call(EM, __MODULE__, :sockets) + + @doc """ + Starts the event handler. + """ + def start_link do + Logger.debug ">> a websocket event handler is starting" + GenEvent.add_handler EM, __MODULE__, [] + {:ok, self} + end + + @doc """ + Stops the event handler + """ + def stop_link do + Logger.debug ">> a websocket event handler is stopping" + GenEvent.remove_handler(EM, __MODULE__, []) + end + + def init(_args) do + {:ok, []} + end + + def handle_event({:from_bot, event}, sockets) do + broadcast(sockets, {:from_bot, event}) + {:ok, sockets} + end + + # we don't really care about anything else. + def handle_event(_event, sockets), do: {:ok, sockets} + + # called from a socket instance + def handle_call({:add_socket, socket}, sockets) do + {:ok, :ok, [socket | sockets]} + end + + # called from a socket instance + def handle_call({:remove_socket, socket}, sockets) do + {:ok, :ok, sockets -- [socket]} + end + + def handle_call(:sockets, sockets), do: {:ok, sockets, sockets} + def handle_call(_, sockets), do: {:ok, :unhandled, sockets} + def terminate(_,_), do: :ok + + # Probably a better way to do this... + defp broadcast(sockets, event) do + Enum.each(sockets, fn(socket) -> + send(socket, event) + end) + end +end diff --git a/apps/farmbot_configurator/lib/event_manager.ex b/apps/farmbot_configurator/lib/event_manager.ex new file mode 100644 index 00000000..3c09d642 --- /dev/null +++ b/apps/farmbot_configurator/lib/event_manager.ex @@ -0,0 +1,10 @@ +defmodule Farmbot.Configurator.EventManager do + # alias Farmbot.Configurator.EventHandler + def start_link() do + GenEvent.start_link(name: __MODULE__) + end + + def send_socket(event) do + GenEvent.notify(__MODULE__, event) + end +end diff --git a/apps/farmbot_configurator/lib/farmbot_configurator.ex b/apps/farmbot_configurator/lib/farmbot_configurator.ex new file mode 100644 index 00000000..adcbea40 --- /dev/null +++ b/apps/farmbot_configurator/lib/farmbot_configurator.ex @@ -0,0 +1,36 @@ +defmodule Farmbot.Configurator do + use Supervisor + alias Plug.Adapters.Cowboy + alias Farmbot.Configurator.Router + alias Farmbot.Configurator.EventHandler + alias Farmbot.Configurator.EventManager + @port Application.get_env(:configurator, :port, 4000) + @env Mix.env + + def init(_) do + children = [ + # genevent manager for the handler to connect to. + # worker(GenEvent, + # [[name: EventManager]], + # [id: EventManager]), + worker(EventManager, [], []), + worker(EventHandler, [], []), + Plug.Adapters.Cowboy.child_spec( + :http, Router, [], port: @port, dispatch: dispatch), + worker(WebPack, [@env]) + ] + opts = [strategy: :one_for_one, name: Farmbot.Configurator] + supervise(children, opts) + end + + def start(_type, args), do: Supervisor.start_link(__MODULE__,args) + + defp dispatch do + [ + {:_, [ + {"/ws", Farmbot.Configurator.SocketHandler, []}, + {:_, Plug.Adapters.Cowboy.Handler, {Router, []}} + ]} + ] + end +end diff --git a/apps/farmbot_configurator/lib/mix/tasks/compile.ex b/apps/farmbot_configurator/lib/mix/tasks/compile.ex new file mode 100644 index 00000000..6313736b --- /dev/null +++ b/apps/farmbot_configurator/lib/mix/tasks/compile.ex @@ -0,0 +1,13 @@ +defmodule Mix.Tasks.Compile.Configurator do + use Mix.Task + @moduledoc """ + Compiles Configurator JS and HTML + """ + + def run(_args) do + # IO.puts "Running `npm install`" + # System.cmd("npm", ["install"]) + IO.puts "Building the javascripts" + System.cmd("npm", ["run", "build"]) + end +end diff --git a/apps/farmbot_configurator/lib/router.ex b/apps/farmbot_configurator/lib/router.ex new file mode 100644 index 00000000..d09c5fe8 --- /dev/null +++ b/apps/farmbot_configurator/lib/router.ex @@ -0,0 +1,17 @@ +defmodule Farmbot.Configurator.Router do + @moduledoc """ + Routes incoming connections. + """ + use Plug.Router + + plug Plug.Static, at: "/", from: :farmbot_configurator + plug :match + plug :dispatch + + match _, do: conn |> send_resp(200, make_html) + + def make_html do + "#{:code.priv_dir(:farmbot_configurator)}/static/index.html" + |> File.read! + end +end diff --git a/apps/farmbot_configurator/lib/socket_handler.ex b/apps/farmbot_configurator/lib/socket_handler.ex new file mode 100644 index 00000000..1b3a628b --- /dev/null +++ b/apps/farmbot_configurator/lib/socket_handler.ex @@ -0,0 +1,59 @@ +defmodule Farmbot.Configurator.SocketHandler do + @moduledoc """ + Handles the websocket connection from a browser. + """ + alias Farmbot.Configurator.EventManager, as: EM + alias Farmbot.Configurator.EventHandler, as: EH + require Logger + @behaviour :cowboy_websocket_handler + @timeout 60000 # terminate if no activity for one minute + + def init(_, _req, _opts), do: {:upgrade, :protocol, :cowboy_websocket} + + #Called on websocket connection initialization. + def websocket_init(_type, req, _options) do + Logger.debug ">> encountered a new local websocket connection." + :erlang.start_timer(1000, self, []) + # :ok = EH.start_link(self) + :ok = EH.add_socket(self) + {:ok, req, [], @timeout} + end + + # Handle other messages from the browser - don't reply + def websocket_handle({:text, message}, req, state) do + message |> Poison.decode |> handle_message + {:ok, req, state} + end + + def websocket_info({:timeout, _, []}, req, state) do + :erlang.start_timer(1000, self, []) + {:reply, {:text, ping_message}, req, state} + end + + def websocket_info({:from_bot, event}, req, state) do + {:reply, {:text, event}, req, state} + end + + def websocket_info(message, req, state) do + Logger.debug "got a info message: #{inspect message}" + {:ok, req, state} + end + + def websocket_terminate(_reason, _req, _state) do + Logger.debug ">> is closing a websocket connection." + # :ok = EH.stop_link(self) + :ok = EH.remove_socket(self) + :ok + end + + def handle_message({:ok, m}), do: GenEvent.notify(EM, {:from_socket, m}) + def handle_message(_) do + Logger.warn ">> Got unhandled websocket message!" + end + + defp ping_message do + # lazy_id = :os.system_time(:seconds) |> Integer.to_string + Poison.encode! %{"id" => nil, "method" => "ping", "params" => [] } + end + +end diff --git a/apps/farmbot_configurator/lib/webpack.ex b/apps/farmbot_configurator/lib/webpack.ex new file mode 100644 index 00000000..02b25f55 --- /dev/null +++ b/apps/farmbot_configurator/lib/webpack.ex @@ -0,0 +1,32 @@ +defmodule WebPack do + require Logger + use GenServer + + def start_link(env) do + GenServer.start_link(__MODULE__, env, name: __MODULE__) + end + + def init(:prod), do: {:ok, self} + def init(:dev) do + Logger.debug("Starting webpack") + port = Port.open({:spawn, "npm run watch"}, + [:stream, + :binary, + :exit_status, + :hide, + :use_stdio, + :stderr_to_stdout]) + {:ok, port} + end + + def handle_info({_, {:data, data}}, port) do + IO.puts data + + {:noreply, port} + end + + def handle_info(stuff, port) do + IO.inspect stuff + {:noreply, port} + end +end diff --git a/apps/farmbot_configurator/mix.exs b/apps/farmbot_configurator/mix.exs new file mode 100644 index 00000000..1f849448 --- /dev/null +++ b/apps/farmbot_configurator/mix.exs @@ -0,0 +1,39 @@ +defmodule Farmbot.Configurator.Mixfile do + use Mix.Project + System.put_env("NODE_ENV", Mix.env |> Atom.to_string) + + def project do + [app: :farmbot_configurator, + version: "0.1.0", + elixir: "~> 1.3", + build_embedded: Mix.env == :prod, + start_permanent: Mix.env == :prod, + compilers: [:yecc, :leex, :erlang, :elixir, :xref, :app, :configurator], + deps: deps] + end + + def application do + [mod: {Farmbot.Configurator, []}, + applications: applications] + end + + + defp applications do + [ + :logger, + :plug, + :cors_plug, + :poison, + :cowboy + ] + end + + defp deps do + [ + {:plug, "~> 1.0"}, + {:cors_plug, "~> 1.1"}, + {:poison, "~> 3.0"}, + {:cowboy, "~> 1.0.0"}, + ] + end +end diff --git a/apps/farmbot_configurator/package.json b/apps/farmbot_configurator/package.json new file mode 100644 index 00000000..cea41159 --- /dev/null +++ b/apps/farmbot_configurator/package.json @@ -0,0 +1,35 @@ +{ + "name": "farmbot_configurator", + "version": "1.0.0", + "description": "Configuration application for FarmbotOS", + "dependencies": { + "@types/lodash": "^4.14.43", + "css-loader": "^0.26.1", + "lodash": "^4.17.2", + "node-sass": "^4.0.0", + "preact": "^7.1.0", + "preact-redux": "^1.2.0", + "redux": "^3.6.0", + "sass-loader": "^4.1.0", + "style-loader": "^0.13.1", + "ts-loader": "^1.3.3", + "typescript": "^2.1.4", + "webpack": "^2.2.0-rc.0" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "webpack", + "watch": "webpack --watch --color" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/farmbot/farmbot_configurator.git" + }, + "author": "Farmbot.IO", + "license": "MIT", + "bugs": { + "url": "https://github.com/farmbot/farmbot_configurator/issues" + }, + "homepage": "https://github.com/farmbot/farmbot_configurator#readme" +} diff --git a/apps/farmbot_configurator/priv/static/index.html b/apps/farmbot_configurator/priv/static/index.html new file mode 100644 index 00000000..eca1d253 --- /dev/null +++ b/apps/farmbot_configurator/priv/static/index.html @@ -0,0 +1,8 @@ + + + + +
+ + + diff --git a/apps/farmbot_configurator/test/farmbot_configurator_test.exs b/apps/farmbot_configurator/test/farmbot_configurator_test.exs new file mode 100644 index 00000000..a61d6523 --- /dev/null +++ b/apps/farmbot_configurator/test/farmbot_configurator_test.exs @@ -0,0 +1,8 @@ +defmodule Farmbot.ConfiguratorTest do + use ExUnit.Case + doctest Farmbot.Configurator + + test "the truth" do + assert 1 + 1 == 2 + end +end diff --git a/apps/farmbot_configurator/test/test_helper.exs b/apps/farmbot_configurator/test/test_helper.exs new file mode 100644 index 00000000..869559e7 --- /dev/null +++ b/apps/farmbot_configurator/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start() diff --git a/apps/farmbot_configurator/tsconfig.json b/apps/farmbot_configurator/tsconfig.json new file mode 100644 index 00000000..11297e84 --- /dev/null +++ b/apps/farmbot_configurator/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "lib": [ + "es7", + "dom" + ], + "target": "es5", + "module": "commonjs", + "jsx": "react", + "jsxFactory": "h", + "experimentalDecorators": true, + "noImplicitAny": true, + "allowUnreachableCode": false, + "strictNullChecks": true, + "sourceMap": true + }, + "exclude": [ + "node_modules", + "typings" + ], + "compileOnSave": false, + "buildOnSave": false +} \ No newline at end of file diff --git a/apps/farmbot_configurator/web/css/main.scss b/apps/farmbot_configurator/web/css/main.scss new file mode 100644 index 00000000..e69de29b diff --git a/apps/farmbot_configurator/web/ts/entry.tsx b/apps/farmbot_configurator/web/ts/entry.tsx new file mode 100644 index 00000000..25268f88 --- /dev/null +++ b/apps/farmbot_configurator/web/ts/entry.tsx @@ -0,0 +1,10 @@ +import { render, h } from "preact"; +import { Main } from "./main"; +import { GlobalState } from "./interfaces"; +import "../css/main.scss" + +let el = document.querySelector("#app"); + +if (el) { + render(
, el); +} \ No newline at end of file diff --git a/apps/farmbot_configurator/web/ts/interfaces.ts b/apps/farmbot_configurator/web/ts/interfaces.ts new file mode 100644 index 00000000..70711a5c --- /dev/null +++ b/apps/farmbot_configurator/web/ts/interfaces.ts @@ -0,0 +1,8 @@ +export interface GlobalState { + statusBox: StatusBoxProps; + ws: WebSocket; +} + +export interface StatusBoxProps { + message: string; +} \ No newline at end of file diff --git a/apps/farmbot_configurator/web/ts/json_rpc.ts b/apps/farmbot_configurator/web/ts/json_rpc.ts new file mode 100644 index 00000000..4ff38327 --- /dev/null +++ b/apps/farmbot_configurator/web/ts/json_rpc.ts @@ -0,0 +1,20 @@ +export type RpcMessage = RpcNotification | RpcRequest | RpcResponse +/** just like a request but doesn't expect a response. */ +export interface RpcNotification { + method: string; + params: any; + id: string; +} +/** request a thing to happen and get info back as a response. */ +export interface RpcRequest { + method: string; + params: any; + id: null; +} +/** A response to a request. */ +export interface RpcResponse { + results: any; + error: null | any; + /** the id od the request that waranted this response. */ + id: string; +} \ No newline at end of file diff --git a/apps/farmbot_configurator/web/ts/main.tsx b/apps/farmbot_configurator/web/ts/main.tsx new file mode 100644 index 00000000..663d0c6a --- /dev/null +++ b/apps/farmbot_configurator/web/ts/main.tsx @@ -0,0 +1,89 @@ +// import * as React from "react"; +import { h, Component } from "preact"; +import { + RpcMessage, + RpcNotification, + RpcRequest, + RpcResponse +} from "./json_rpc"; +import { GlobalState } from "./interfaces"; + +export class Main extends Component<{}, GlobalState> { + constructor(props: {}) { + super(props); + + // open web socket connection to the bot. + let ws_host = "ws://" + location.host + "/ws" + let ws = new WebSocket(ws_host); + + // set initial state. + this.state = { statusBox: { message: "" }, ws: ws }; + + // i dont know how to javascript. + let that = this + + let handleNotification = function (notification: RpcNotification) { + switch (notification.method) { + case "ping": + // console.log("got ping."); + break; + default: + break; + } + } + + let handleResponse = function (response: RpcResponse) { + console.log("response to: " + response.id); + } + + this.state.ws.onmessage = function (event) { + let data = (JSON.parse(event.data) as RpcMessage); + // we have a new RPC message + if (data.id == null) { + // we have a notification probably shouldnt be doing so much + // type casting + handleNotification((data as RpcNotification)); + return; + } + else { + console.dir(data); + // either a request or a response. + if (data.hasOwnProperty("results")) { + // its a response. + handleResponse((data as RpcResponse)); + return; + } else if (data.hasOwnProperty("method")) { + // its a request. + console.log("The bot is asking for information??"); + return; + } else { + // something terrible has happened. + console.log("uhhh..."); + return; + } + } + } + + } + + render() { + let state = this.state; + let setState = this.setState; + let send_request = function (request: RpcRequest) { + setState({ [request.id]: "pending" }); + state.ws.send(JSON.stringify(request)); + } + return ( +
+ +
+ ); + } +} diff --git a/apps/farmbot_configurator/webpack.config.js b/apps/farmbot_configurator/webpack.config.js new file mode 100644 index 00000000..93760380 --- /dev/null +++ b/apps/farmbot_configurator/webpack.config.js @@ -0,0 +1,27 @@ +module.exports = { + resolve: { + extensions: [".js", ".ts", ".json", ".tsx", ".css", ".scss"] + }, + entry: "./web/ts/entry.tsx", + output: { + path: "./priv/static/", + filename: "bundle.js", + publicPath: "/assets/", + }, + module: { + rules: [ + { + test: /\.tsx?$/, + loader: "ts-loader" + }, + { + test: /\.scss$/, + exclude: /node_modules/, + use: [ + 'style-loader', + 'css-loader', + 'sass-loader' + ] + }] + } +} diff --git a/apps/nerves_system_rpi3/.gitignore b/apps/nerves_system_rpi3/.gitignore new file mode 100644 index 00000000..949c5700 --- /dev/null +++ b/apps/nerves_system_rpi3/.gitignore @@ -0,0 +1,7 @@ +/_build +/cover +/deps +erl_crash.dump +*.ez +build.log +.nerves diff --git a/apps/nerves_system_rpi3/BUILDING.md b/apps/nerves_system_rpi3/BUILDING.md new file mode 100644 index 00000000..4320c352 --- /dev/null +++ b/apps/nerves_system_rpi3/BUILDING.md @@ -0,0 +1,2 @@ +# How to build this repository +NOTE: it is more detailed [here](https://github.com/nerves-project/nerves_system_br) diff --git a/apps/nerves_system_rpi3/CHANGELOG.md b/apps/nerves_system_rpi3/CHANGELOG.md new file mode 100644 index 00000000..b150c631 --- /dev/null +++ b/apps/nerves_system_rpi3/CHANGELOG.md @@ -0,0 +1,94 @@ +# Changelog + +## v0.9.0-farmbot1 +This fork will have added packages for farmbot_os. + * buildroot settings: + * enabled ccache + * added extra busybox config file + * nerves settings: + * changed sname + * linux packages: + * hostapd + * dnsmasq + * avrdude + * dropbear + * BusyBox pacakges: + * mkfs.ext* + * fwup config: + * change data partition do ext4 + +## v0.9.0 + +This version switches to using the `nerves_package` compiler. This will +consolidate overall deps and compilers. + + * Nerves.System.BR v0.8.1 + * Support for distillery + * Support for nerves_package compiler + +## v0.7.0 + +When upgrading to this version, be sure to review the updates to +nerves_defconfig if you have customized this system. + + * nerves_system_br v0.6.2 + * Package updates + * Buildroot 2016.08 + * Linux 4.4 + +## v0.6.1 + + * Package versions + * Nerves.System.BR v0.6.1 + + * New features + * All Raspberry Pi 3-specific configuration is now in this repository + +## v0.6.0 + * Nerves.System.BR v0.6.0 + * Package updates + * Erlang OTP 19 + * Elixir 1.3.1 + * fwup 0.8.0 + * erlinit 0.7.3 + * bborg-overlays (pull in I2C typo fix from upstream) + * Bug fixes + * Synchronize file system kernel configs across all platforms + +## v0.5.2 + * Enhancements + * Enabled USB Printer kernel mod. Needs to be loaded with `modprobe` to use + * Bug Fixes(raspberry pi) + * Enabled multicast in linux config + +## v0.5.1 + * Nerves.System.BR v0.5.1 + * Bug Fixes(nerves-env) + * Added include paths to CFLAGS and CXXFLAGS + * Pass sysroot to LDFLAGS + +## v0.5.0 + * Nerves.System.BR v0.5.0 + * New features + * WiFi drivers enabled by default on RPi2 and RPi3 + * Include wireless regulatory database in Linux kernel by default + on WiFi-enabled platforms. Since kernel/rootfs are read-only and + coupled together for firmware updates, the normal CRDA/udev approach + isn't necessary. + * Upgraded the default BeagleBone Black kernel from 3.8 to 4.4.9. The + standard BBB device tree overlays are included by default even though the + upstream kernel patches no longer include them. + * Change all fwup configurations from two step upgrades to one step + upgrades. If you used the base fwup.conf files to upgrade, you no + longer need to finalize the upgrade. If not, there's no change. + +## v0.4.1 + + * Nerves.System.BR v0.4.1 + * Bug fixes + * syslinux fails to boot when compiled on some gcc 5 systems + * Fixed regression when booting off eMMC on the BBB + + * Package updates + * Erlang 18.3 + * Elixir 1.2.5 diff --git a/apps/nerves_system_rpi3/Config.in b/apps/nerves_system_rpi3/Config.in new file mode 100644 index 00000000..7252ed84 --- /dev/null +++ b/apps/nerves_system_rpi3/Config.in @@ -0,0 +1,4 @@ +# Add project-specific packages for Buildroot here +# +# If these are non-proprietary, please consider contributing them back to +# Nerves or Buildroot. diff --git a/apps/nerves_system_rpi3/LICENSE b/apps/nerves_system_rpi3/LICENSE new file mode 100644 index 00000000..5e0fd33c --- /dev/null +++ b/apps/nerves_system_rpi3/LICENSE @@ -0,0 +1,201 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "{}" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright {yyyy} {name of copyright owner} + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/apps/nerves_system_rpi3/README.md b/apps/nerves_system_rpi3/README.md new file mode 100644 index 00000000..ff201da4 --- /dev/null +++ b/apps/nerves_system_rpi3/README.md @@ -0,0 +1,48 @@ +# Raspberry Pi 3 Model B +This is the base Nerves System configuration for the Raspberry Pi 3 Model B. + +![Fritzing Raspberry Pi 3 image](assets/images/raspberry-pi-3-model-b.png) +
[Image credit](#fritzing) + +| Feature | Description | +| -------------------- | ------------------------------- | +| CPU | 1.2 GHz quad-core ARMv8 | +| Memory | 1 GB DRAM | +| Storage | MicroSD | +| Linux kernel | 4.1 w/ Raspberry Pi patches | +| IEx terminal | HDMI and USB keyboard (can be changed to UART) | +| GPIO, I2C, SPI | Yes - Elixir ALE | +| ADC | No | +| PWM | Yes, but no Elixir support | +| UART | 1 available - ttyS0 | +| Camera | Yes - via rpi-userland | +| Ethernet | Yes | +| WiFi | Yes - Nerves.InterimWiFi | +| Bluetooth | Not yet | + +## Installation + +If [available in Hex](https://hex.pm/docs/publish), the package can be installed as: + + 1. Add nerves_system_rpi3 to your list of dependencies in `mix.exs`: + + def deps do + [{:nerves_system_rpi3, github: "ConnorRigby/nerves_system_rpi3"}] + end + + 2. Ensure nerves_system_rpi3 is started before your application: + + def application do + [applications: [:nerves_system_rpi3]] + end + +## Built-in WiFi Firmware + +WiFi modules almost always require proprietary firmware to be loaded for them to work. The +Linux kernel handles this and firmware blobs are maintained in the +`linux-firmware` project. The firmware for the built-in WiFi module on the RPi3 +hasn't made it to the `linux-firmware` project nor Buildroot, so it is included +here in a `rootfs-additions` overlay directory. The original firmware files came from +https://github.com/RPi-Distro/firmware-nonfree/blob/master/brcm80211/brcm. + +[Image credit](#fritzing): This image is from the [Fritzing](http://fritzing.org/home/) parts library. diff --git a/apps/nerves_system_rpi3/VERSION b/apps/nerves_system_rpi3/VERSION new file mode 100644 index 00000000..ac39a106 --- /dev/null +++ b/apps/nerves_system_rpi3/VERSION @@ -0,0 +1 @@ +0.9.0 diff --git a/apps/nerves_system_rpi3/assets/images/raspberry-pi-3-model-b.png b/apps/nerves_system_rpi3/assets/images/raspberry-pi-3-model-b.png new file mode 100644 index 00000000..c507952f Binary files /dev/null and b/apps/nerves_system_rpi3/assets/images/raspberry-pi-3-model-b.png differ diff --git a/apps/nerves_system_rpi3/busybox_defconfig b/apps/nerves_system_rpi3/busybox_defconfig new file mode 100644 index 00000000..07c4536e --- /dev/null +++ b/apps/nerves_system_rpi3/busybox_defconfig @@ -0,0 +1,1070 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.25.0 +# Fri Dec 16 08:51:40 2016 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +CONFIG_INCLUDE_SUSv2=y +# CONFIG_USE_PORTABLE_CODE is not set +CONFIG_PLATFORM_LINUX=y +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_SHOW_USAGE=y +CONFIG_FEATURE_VERBOSE_USAGE=y +# CONFIG_FEATURE_COMPRESS_USAGE is not set +CONFIG_BUSYBOX=y +CONFIG_FEATURE_INSTALLER=y +# CONFIG_INSTALL_NO_USR is not set +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +# CONFIG_PAM is not set +CONFIG_FEATURE_USE_SENDFILE=y +CONFIG_LONG_OPTS=y +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_CLEAN_UP is not set +# CONFIG_FEATURE_UTMP is not set +# CONFIG_FEATURE_WTMP is not set +# CONFIG_FEATURE_PIDFILE is not set +CONFIG_PID_FILE_PATH="" +CONFIG_FEATURE_SUID=y +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_FEATURE_SYSLOG=y +# CONFIG_FEATURE_HAVE_RPC is not set + +# +# Build Options +# +# CONFIG_STATIC is not set +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_LFS=y +CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_SYSROOT="" +CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_DEBUG_SANITIZE is not set +# CONFIG_UNIT_TEST is not set +# CONFIG_WERROR is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Installation Options ("make install" behavior) +# +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +# CONFIG_FEATURE_USE_BSS_TAIL is not set +CONFIG_FEATURE_RTMINMAX=y +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SMALL=1 +CONFIG_SHA3_SMALL=1 +# CONFIG_FEATURE_FAST_TOP is not set +# CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_FEATURE_USE_TERMIOS is not set +# CONFIG_FEATURE_EDITING is not set +CONFIG_FEATURE_EDITING_MAX_LEN=0 +# CONFIG_FEATURE_EDITING_VI is not set +CONFIG_FEATURE_EDITING_HISTORY=0 +# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set +# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set +# CONFIG_FEATURE_REVERSE_SEARCH is not set +# CONFIG_FEATURE_TAB_COMPLETION is not set +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +CONFIG_FEATURE_SKIP_ROOTFS=y +CONFIG_MONOTONIC_SYSCALL=y +CONFIG_IOCTL_HEX2STR_ERROR=y +# CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +# CONFIG_FEATURE_SEAMLESS_XZ is not set +# CONFIG_FEATURE_SEAMLESS_LZMA is not set +# CONFIG_FEATURE_SEAMLESS_BZ2 is not set +# CONFIG_FEATURE_SEAMLESS_GZ is not set +# CONFIG_FEATURE_SEAMLESS_Z is not set +# CONFIG_AR is not set +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_FEATURE_AR_CREATE is not set +# CONFIG_UNCOMPRESS is not set +# CONFIG_GUNZIP is not set +# CONFIG_FEATURE_GUNZIP_LONG_OPTIONS is not set +# CONFIG_BUNZIP2 is not set +# CONFIG_UNLZMA is not set +# CONFIG_FEATURE_LZMA_FAST is not set +# CONFIG_LZMA is not set +# CONFIG_UNXZ is not set +# CONFIG_XZ is not set +# CONFIG_BZIP2 is not set +# CONFIG_CPIO is not set +# CONFIG_FEATURE_CPIO_O is not set +# CONFIG_FEATURE_CPIO_P is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +# CONFIG_GZIP is not set +# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_GZIP_FAST=0 +# CONFIG_FEATURE_GZIP_LEVELS is not set +# CONFIG_LZOP is not set +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM is not set +# CONFIG_RPM2CPIO is not set +# CONFIG_TAR is not set +# CONFIG_FEATURE_TAR_CREATE is not set +# CONFIG_FEATURE_TAR_AUTODETECT is not set +# CONFIG_FEATURE_TAR_FROM is not set +# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +# CONFIG_FEATURE_TAR_GNU_EXTENSIONS is not set +# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_FEATURE_TAR_TO_COMMAND is not set +# CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_FEATURE_TAR_SELINUX is not set +CONFIG_UNZIP=y + +# +# Coreutils +# +# CONFIG_BASENAME is not set +CONFIG_CAT=y +CONFIG_DATE=y +CONFIG_FEATURE_DATE_ISOFMT=y +# CONFIG_FEATURE_DATE_NANO is not set +CONFIG_FEATURE_DATE_COMPAT=y +# CONFIG_DD is not set +# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set +# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set +# CONFIG_FEATURE_DD_IBS_OBS is not set +# CONFIG_FEATURE_DD_STATUS is not set +# CONFIG_HOSTID is not set +CONFIG_ID=y +# CONFIG_GROUPS is not set +# CONFIG_SHUF is not set +# CONFIG_STAT is not set +# CONFIG_FEATURE_STAT_FORMAT is not set +# CONFIG_FEATURE_STAT_FILESYSTEM is not set +# CONFIG_SYNC is not set +# CONFIG_FEATURE_SYNC_FANCY is not set +# CONFIG_TEST is not set +# CONFIG_FEATURE_TEST_64 is not set +# CONFIG_TOUCH is not set +# CONFIG_FEATURE_TOUCH_NODEREF is not set +# CONFIG_FEATURE_TOUCH_SUSV3 is not set +# CONFIG_TR is not set +# CONFIG_FEATURE_TR_CLASSES is not set +# CONFIG_FEATURE_TR_EQUIV is not set +# CONFIG_TRUNCATE is not set +# CONFIG_UNLINK is not set +# CONFIG_BASE64 is not set +# CONFIG_WHO is not set +# CONFIG_USERS is not set +# CONFIG_CAL is not set +# CONFIG_CATV is not set +# CONFIG_CHGRP is not set +# CONFIG_CHMOD is not set +# CONFIG_CHOWN is not set +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +# CONFIG_CHROOT is not set +# CONFIG_CKSUM is not set +# CONFIG_COMM is not set +CONFIG_CP=y +# CONFIG_FEATURE_CP_LONG_OPTIONS is not set +# CONFIG_CUT is not set +# CONFIG_DF is not set +# CONFIG_FEATURE_DF_FANCY is not set +# CONFIG_DIRNAME is not set +# CONFIG_DOS2UNIX is not set +# CONFIG_UNIX2DOS is not set +# CONFIG_DU is not set +# CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K is not set +# CONFIG_ECHO is not set +# CONFIG_FEATURE_FANCY_ECHO is not set +# CONFIG_ENV is not set +# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set +# CONFIG_EXPAND is not set +# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set +# CONFIG_EXPR is not set +# CONFIG_EXPR_MATH_SUPPORT_64 is not set +# CONFIG_FALSE is not set +# CONFIG_FOLD is not set +# CONFIG_FSYNC is not set +# CONFIG_HEAD is not set +# CONFIG_FEATURE_FANCY_HEAD is not set +# CONFIG_INSTALL is not set +# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set +# CONFIG_LN is not set +# CONFIG_LOGNAME is not set +CONFIG_LS=y +# CONFIG_FEATURE_LS_FILETYPES is not set +# CONFIG_FEATURE_LS_FOLLOWLINKS is not set +# CONFIG_FEATURE_LS_RECURSIVE is not set +# CONFIG_FEATURE_LS_SORTFILES is not set +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +# CONFIG_FEATURE_LS_COLOR is not set +# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set +# CONFIG_MD5SUM is not set +# CONFIG_MKDIR is not set +# CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set +# CONFIG_MKFIFO is not set +# CONFIG_MKNOD is not set +# CONFIG_MV is not set +# CONFIG_FEATURE_MV_LONG_OPTIONS is not set +# CONFIG_NICE is not set +# CONFIG_NOHUP is not set +# CONFIG_OD is not set +# CONFIG_PRINTENV is not set +# CONFIG_PRINTF is not set +CONFIG_PWD=y +# CONFIG_READLINK is not set +# CONFIG_FEATURE_READLINK_FOLLOW is not set +# CONFIG_REALPATH is not set +CONFIG_RM=y +# CONFIG_RMDIR is not set +# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set +# CONFIG_SEQ is not set +# CONFIG_SHA1SUM is not set +CONFIG_SHA256SUM=y +# CONFIG_SHA512SUM is not set +# CONFIG_SHA3SUM is not set +# CONFIG_SLEEP is not set +# CONFIG_FEATURE_FANCY_SLEEP is not set +# CONFIG_FEATURE_FLOAT_SLEEP is not set +# CONFIG_SORT is not set +# CONFIG_FEATURE_SORT_BIG is not set +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +# CONFIG_STTY is not set +# CONFIG_SUM is not set +# CONFIG_TAC is not set +# CONFIG_TAIL is not set +# CONFIG_FEATURE_FANCY_TAIL is not set +# CONFIG_TEE is not set +# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set +# CONFIG_TRUE is not set +# CONFIG_TTY is not set +# CONFIG_UNAME is not set +CONFIG_UNAME_OSNAME="" +# CONFIG_UNEXPAND is not set +# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set +# CONFIG_UNIQ is not set +# CONFIG_USLEEP is not set +# CONFIG_UUDECODE is not set +# CONFIG_UUENCODE is not set +# CONFIG_WC is not set +# CONFIG_FEATURE_WC_LARGE is not set +# CONFIG_WHOAMI is not set +# CONFIG_YES is not set + +# +# Common options +# +CONFIG_FEATURE_VERBOSE=y + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for ls, more and telnet +# +CONFIG_FEATURE_AUTOWIDTH=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y + +# +# Console Utilities +# +# CONFIG_CHVT is not set +# CONFIG_FGCONSOLE is not set +# CONFIG_CLEAR is not set +# CONFIG_DEALLOCVT is not set +# CONFIG_DUMPKMAP is not set +# CONFIG_KBD_MODE is not set +# CONFIG_LOADFONT is not set +# CONFIG_LOADKMAP is not set +# CONFIG_OPENVT is not set +# CONFIG_RESET is not set +# CONFIG_RESIZE is not set +# CONFIG_FEATURE_RESIZE_PRINT is not set +# CONFIG_SETCONSOLE is not set +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_SETFONT is not set +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" +# CONFIG_SETKEYCODES is not set +# CONFIG_SETLOGCONS is not set +# CONFIG_SHOWKEY is not set +# CONFIG_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_FEATURE_LOADFONT_RAW is not set + +# +# Debian Utilities +# +# CONFIG_MKTEMP is not set +# CONFIG_PIPE_PROGRESS is not set +# CONFIG_RUN_PARTS is not set +# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +# CONFIG_START_STOP_DAEMON is not set +# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +# CONFIG_WHICH is not set + +# +# Editors +# +# CONFIG_AWK is not set +# CONFIG_FEATURE_AWK_LIBM is not set +# CONFIG_FEATURE_AWK_GNU_EXTENSIONS is not set +# CONFIG_CMP is not set +# CONFIG_DIFF is not set +# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set +# CONFIG_FEATURE_DIFF_DIR is not set +# CONFIG_ED is not set +# CONFIG_PATCH is not set +# CONFIG_SED is not set +# CONFIG_VI is not set +CONFIG_FEATURE_VI_MAX_LEN=0 +# CONFIG_FEATURE_VI_8BIT is not set +# CONFIG_FEATURE_VI_COLON is not set +# CONFIG_FEATURE_VI_YANKMARK is not set +# CONFIG_FEATURE_VI_SEARCH is not set +# CONFIG_FEATURE_VI_REGEX_SEARCH is not set +# CONFIG_FEATURE_VI_USE_SIGNALS is not set +# CONFIG_FEATURE_VI_DOT_CMD is not set +# CONFIG_FEATURE_VI_READONLY is not set +# CONFIG_FEATURE_VI_SETOPTS is not set +# CONFIG_FEATURE_VI_SET is not set +# CONFIG_FEATURE_VI_WIN_RESIZE is not set +# CONFIG_FEATURE_VI_ASK_TERMINAL is not set +# CONFIG_FEATURE_VI_UNDO is not set +# CONFIG_FEATURE_VI_UNDO_QUEUE is not set +CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0 +# CONFIG_FEATURE_ALLOW_EXEC is not set + +# +# Finding Utilities +# +# CONFIG_FIND is not set +# CONFIG_FEATURE_FIND_PRINT0 is not set +# CONFIG_FEATURE_FIND_MTIME is not set +# CONFIG_FEATURE_FIND_MMIN is not set +# CONFIG_FEATURE_FIND_PERM is not set +# CONFIG_FEATURE_FIND_TYPE is not set +# CONFIG_FEATURE_FIND_XDEV is not set +# CONFIG_FEATURE_FIND_MAXDEPTH is not set +# CONFIG_FEATURE_FIND_NEWER is not set +# CONFIG_FEATURE_FIND_INUM is not set +# CONFIG_FEATURE_FIND_EXEC is not set +# CONFIG_FEATURE_FIND_EXEC_PLUS is not set +# CONFIG_FEATURE_FIND_USER is not set +# CONFIG_FEATURE_FIND_GROUP is not set +# CONFIG_FEATURE_FIND_NOT is not set +# CONFIG_FEATURE_FIND_DEPTH is not set +# CONFIG_FEATURE_FIND_PAREN is not set +# CONFIG_FEATURE_FIND_SIZE is not set +# CONFIG_FEATURE_FIND_PRUNE is not set +# CONFIG_FEATURE_FIND_DELETE is not set +# CONFIG_FEATURE_FIND_PATH is not set +# CONFIG_FEATURE_FIND_REGEX is not set +# CONFIG_FEATURE_FIND_CONTEXT is not set +# CONFIG_FEATURE_FIND_LINKS is not set +# CONFIG_GREP is not set +# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set +# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set +# CONFIG_FEATURE_GREP_CONTEXT is not set +# CONFIG_XARGS is not set +# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set +# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set +# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set +# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set +# CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR is not set + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_HALT=y +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +# CONFIG_INIT is not set +CONFIG_LINUXRC=y +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +# CONFIG_FEATURE_INIT_SCTTY is not set +# CONFIG_FEATURE_INIT_SYSLOG is not set +# CONFIG_FEATURE_EXTRA_QUIET is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +CONFIG_INIT_TERMINAL_TYPE="" +CONFIG_FEATURE_INIT_MODIFY_CMDLINE=y +# CONFIG_MESG is not set +# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set + +# +# Login/Password Management Utilities +# +# CONFIG_FEATURE_SHADOWPASSWDS is not set +CONFIG_USE_BB_PWD_GRP=y +# CONFIG_USE_BB_SHADOW is not set +# CONFIG_USE_BB_CRYPT is not set +# CONFIG_USE_BB_CRYPT_SHA is not set +# CONFIG_ADD_SHELL is not set +# CONFIG_REMOVE_SHELL is not set +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_ADDUSER is not set +# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_LAST_ID=0 +CONFIG_FIRST_SYSTEM_ID=0 +CONFIG_LAST_SYSTEM_ID=0 +# CONFIG_CHPASSWD is not set +CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" +# CONFIG_CRYPTPW is not set +CONFIG_MKPASSWD=y +# CONFIG_DELUSER is not set +# CONFIG_DELGROUP is not set +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_GETTY is not set +# CONFIG_LOGIN is not set +# CONFIG_LOGIN_SESSION_AS_CHILD is not set +# CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_FEATURE_SECURETTY is not set +# CONFIG_PASSWD is not set +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_SU is not set +# CONFIG_FEATURE_SU_SYSLOG is not set +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +# CONFIG_CHATTR is not set +# CONFIG_FSCK is not set +# CONFIG_LSATTR is not set +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_MODINFO is not set +# CONFIG_MODPROBE_SMALL is not set +# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_INSMOD is not set +CONFIG_RMMOD=y +CONFIG_LSMOD=y +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +CONFIG_MODPROBE=y +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_DEPMOD is not set + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +CONFIG_FEATURE_CHECK_TAINTED_MODULE=y +CONFIG_FEATURE_MODUTILS_ALIAS=y +CONFIG_FEATURE_MODUTILS_SYMBOLS=y +CONFIG_DEFAULT_MODULES_DIR="/lib/modules" +CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" + +# +# Linux System Utilities +# +CONFIG_BLKDISCARD=y +# CONFIG_BLOCKDEV is not set +CONFIG_FATATTR=y +# CONFIG_FSTRIM is not set +# CONFIG_MDEV is not set +# CONFIG_FEATURE_MDEV_CONF is not set +# CONFIG_FEATURE_MDEV_RENAME is not set +# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set +# CONFIG_FEATURE_MDEV_EXEC is not set +# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set +CONFIG_MOUNT=y +# CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_FEATURE_MOUNT_VERBOSE is not set +# CONFIG_FEATURE_MOUNT_HELPERS is not set +# CONFIG_FEATURE_MOUNT_LABEL is not set +# CONFIG_FEATURE_MOUNT_NFS is not set +# CONFIG_FEATURE_MOUNT_CIFS is not set +CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_FEATURE_MOUNT_FSTAB=y +# CONFIG_FEATURE_MOUNT_OTHERTAB is not set +CONFIG_NSENTER=y +CONFIG_FEATURE_NSENTER_LONG_OPTS=y +# CONFIG_REV is not set +# CONFIG_SETARCH is not set +CONFIG_UEVENT=y +CONFIG_UNSHARE=y +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKID is not set +# CONFIG_FEATURE_BLKID_TYPE is not set +CONFIG_DMESG=y +CONFIG_FEATURE_DMESG_PRETTY=y +# CONFIG_FBSET is not set +# CONFIG_FEATURE_FBSET_FANCY is not set +# CONFIG_FEATURE_FBSET_READMODE is not set +# CONFIG_FDFLUSH is not set +# CONFIG_FDFORMAT is not set +# CONFIG_FDISK is not set +# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set +# CONFIG_FEATURE_FDISK_WRITABLE is not set +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +# CONFIG_FEATURE_GPT_LABEL is not set +# CONFIG_FEATURE_FDISK_ADVANCED is not set +# CONFIG_FINDFS is not set +# CONFIG_FLOCK is not set +# CONFIG_FREERAMDISK is not set +# CONFIG_FSCK_MINIX is not set +CONFIG_MKFS_EXT2=y +# CONFIG_MKFS_MINIX is not set +# CONFIG_FEATURE_MINIX2 is not set +# CONFIG_MKFS_REISER is not set +# CONFIG_MKFS_VFAT is not set +# CONFIG_GETOPT is not set +# CONFIG_FEATURE_GETOPT_LONG is not set +# CONFIG_HEXDUMP is not set +# CONFIG_FEATURE_HEXDUMP_REVERSE is not set +# CONFIG_HD is not set +# CONFIG_HWCLOCK is not set +# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set +# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_IPCRM is not set +# CONFIG_IPCS is not set +# CONFIG_LOSETUP is not set +# CONFIG_LSPCI is not set +# CONFIG_LSUSB is not set +# CONFIG_MKSWAP is not set +# CONFIG_FEATURE_MKSWAP_UUID is not set +# CONFIG_MORE is not set +# CONFIG_PIVOT_ROOT is not set +# CONFIG_RDATE is not set +# CONFIG_RDEV is not set +# CONFIG_READPROFILE is not set +# CONFIG_RTCWAKE is not set +# CONFIG_SCRIPT is not set +# CONFIG_SCRIPTREPLAY is not set +# CONFIG_SWAPONOFF is not set +# CONFIG_FEATURE_SWAPON_DISCARD is not set +# CONFIG_FEATURE_SWAPON_PRI is not set +# CONFIG_SWITCH_ROOT is not set +CONFIG_UMOUNT=y +CONFIG_FEATURE_UMOUNT_ALL=y + +# +# Common options for mount/umount +# +CONFIG_FEATURE_MOUNT_LOOP=y +CONFIG_FEATURE_MOUNT_LOOP_CREATE=y +# CONFIG_FEATURE_MTAB_SUPPORT is not set +# CONFIG_VOLUMEID is not set +# CONFIG_FEATURE_VOLUMEID_BCACHE is not set +# CONFIG_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_FEATURE_VOLUMEID_EXFAT is not set +# CONFIG_FEATURE_VOLUMEID_EXT is not set +# CONFIG_FEATURE_VOLUMEID_F2FS is not set +# CONFIG_FEATURE_VOLUMEID_FAT is not set +# CONFIG_FEATURE_VOLUMEID_HFS is not set +# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_FEATURE_VOLUMEID_JFS is not set +# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set +# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_FEATURE_VOLUMEID_LUKS is not set +# CONFIG_FEATURE_VOLUMEID_NILFS is not set +# CONFIG_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set +# CONFIG_FEATURE_VOLUMEID_SYSV is not set +# CONFIG_FEATURE_VOLUMEID_UDF is not set +# CONFIG_FEATURE_VOLUMEID_XFS is not set + +# +# Miscellaneous Utilities +# +# CONFIG_CONSPY is not set +# CONFIG_CROND is not set +# CONFIG_FEATURE_CROND_D is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_FEATURE_CROND_DIR="" +CONFIG_I2CGET=y +CONFIG_I2CSET=y +CONFIG_I2CDUMP=y +CONFIG_I2CDETECT=y +# CONFIG_LESS is not set +CONFIG_FEATURE_LESS_MAXLINES=0 +# CONFIG_FEATURE_LESS_BRACKETS is not set +# CONFIG_FEATURE_LESS_FLAGS is not set +# CONFIG_FEATURE_LESS_TRUNCATE is not set +# CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set +# CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_FEATURE_LESS_LINENUMS is not set +# CONFIG_NANDWRITE is not set +# CONFIG_NANDDUMP is not set +# CONFIG_RFKILL is not set +# CONFIG_SETSERIAL is not set +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_UBIMKVOL is not set +# CONFIG_UBIRMVOL is not set +# CONFIG_UBIRSVOL is not set +# CONFIG_UBIUPDATEVOL is not set +CONFIG_UBIRENAME=y +# CONFIG_WALL is not set +# CONFIG_ADJTIMEX is not set +# CONFIG_BBCONFIG is not set +# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_CHRT is not set +# CONFIG_CRONTAB is not set +# CONFIG_DC is not set +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_DEVMEM is not set +# CONFIG_EJECT is not set +# CONFIG_FEATURE_EJECT_SCSI is not set +# CONFIG_FBSPLASH is not set +# CONFIG_FLASHCP is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASH_ERASEALL is not set +# CONFIG_IONICE is not set +# CONFIG_INOTIFYD is not set +# CONFIG_LAST is not set +# CONFIG_FEATURE_LAST_FANCY is not set +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_MAN is not set +# CONFIG_MICROCOM is not set +# CONFIG_MOUNTPOINT is not set +# CONFIG_MT is not set +# CONFIG_RAIDAUTORUN is not set +# CONFIG_READAHEAD is not set +# CONFIG_RUNLEVEL is not set +# CONFIG_RX is not set +# CONFIG_SETSID is not set +# CONFIG_STRINGS is not set +# CONFIG_TIME is not set +# CONFIG_TIMEOUT is not set +# CONFIG_TTYSIZE is not set +# CONFIG_VOLNAME is not set +# CONFIG_WATCHDOG is not set + +# +# Networking Utilities +# +# CONFIG_NAMEIF is not set +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_NBDCLIENT is not set +# CONFIG_NC is not set +# CONFIG_NC_SERVER is not set +# CONFIG_NC_EXTRA is not set +# CONFIG_NC_110_COMPAT is not set +# CONFIG_PING is not set +# CONFIG_PING6 is not set +# CONFIG_FEATURE_FANCY_PING is not set +# CONFIG_WGET is not set +# CONFIG_FEATURE_WGET_STATUSBAR is not set +# CONFIG_FEATURE_WGET_AUTHENTICATION is not set +# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set +# CONFIG_FEATURE_WGET_TIMEOUT is not set +# CONFIG_FEATURE_WGET_OPENSSL is not set +# CONFIG_FEATURE_WGET_SSL_HELPER is not set +# CONFIG_WHOIS is not set +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_ARP is not set +# CONFIG_ARPING is not set +# CONFIG_BRCTL is not set +# CONFIG_FEATURE_BRCTL_FANCY is not set +# CONFIG_FEATURE_BRCTL_SHOW is not set +# CONFIG_DNSD is not set +# CONFIG_ETHER_WAKE is not set +# CONFIG_FAKEIDENTD is not set +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTP_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FEATURE_FTP_AUTHENTICATION is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +# CONFIG_HOSTNAME is not set +# CONFIG_HTTPD is not set +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_FEATURE_HTTPD_GZIP is not set +# CONFIG_IFCONFIG is not set +# CONFIG_FEATURE_IFCONFIG_STATUS is not set +# CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +# CONFIG_FEATURE_IFCONFIG_HW is not set +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +# CONFIG_IFENSLAVE is not set +# CONFIG_IFPLUGD is not set +# CONFIG_IFUPDOWN is not set +CONFIG_IFUPDOWN_IFSTATE_PATH="" +# CONFIG_FEATURE_IFUPDOWN_IP is not set +# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set +# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set +# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set +# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set +# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_INETD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +CONFIG_IP=y +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2" +CONFIG_FEATURE_IP_TUNNEL=y +CONFIG_FEATURE_IP_RULE=y +CONFIG_FEATURE_IP_NEIGH=y +CONFIG_FEATURE_IP_SHORT_FORMS=y +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +CONFIG_IPADDR=y +CONFIG_IPLINK=y +CONFIG_IPROUTE=y +CONFIG_IPTUNNEL=y +CONFIG_IPRULE=y +CONFIG_IPNEIGH=y +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +# CONFIG_NETSTAT is not set +# CONFIG_FEATURE_NETSTAT_WIDE is not set +# CONFIG_FEATURE_NETSTAT_PRG is not set +# CONFIG_NSLOOKUP is not set +CONFIG_NTPD=y +# CONFIG_FEATURE_NTPD_SERVER is not set +CONFIG_FEATURE_NTPD_CONF=y +# CONFIG_PSCAN is not set +# CONFIG_ROUTE is not set +# CONFIG_SLATTACH is not set +# CONFIG_TCPSVD is not set +# CONFIG_TELNET is not set +# CONFIG_FEATURE_TELNET_TTYPE is not set +# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set +# CONFIG_TELNETD is not set +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set +# CONFIG_TFTP is not set +# CONFIG_TFTPD is not set +# CONFIG_FEATURE_TFTP_GET is not set +# CONFIG_FEATURE_TFTP_PUT is not set +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_TFTP_DEBUG is not set +# CONFIG_TRACEROUTE is not set +# CONFIG_TRACEROUTE6 is not set +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_TUNCTL is not set +# CONFIG_FEATURE_TUNCTL_UG is not set +# CONFIG_UDHCPC6 is not set +# CONFIG_UDHCPD is not set +# CONFIG_DHCPRELAY is not set +# CONFIG_DUMPLEASES is not set +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +CONFIG_DHCPD_LEASES_FILE="" +CONFIG_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y +# CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_UDHCP_DEBUG=9 +CONFIG_FEATURE_UDHCP_RFC3397=y +CONFIG_FEATURE_UDHCP_8021Q=y +CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" +# CONFIG_UDPSVD is not set +# CONFIG_VCONFIG is not set +# CONFIG_ZCIP is not set + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +CONFIG_FEATURE_MIME_CHARSET="" +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +# CONFIG_IOSTAT is not set +# CONFIG_LSOF is not set +# CONFIG_MPSTAT is not set +# CONFIG_NMETER is not set +# CONFIG_PMAP is not set +# CONFIG_POWERTOP is not set +# CONFIG_PSTREE is not set +# CONFIG_PWDX is not set +# CONFIG_SMEMCAP is not set +# CONFIG_TOP is not set +# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set +# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +# CONFIG_UPTIME is not set +# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set +# CONFIG_FREE is not set +# CONFIG_FUSER is not set +CONFIG_KILL=y +CONFIG_KILLALL=y +# CONFIG_KILLALL5 is not set +# CONFIG_PGREP is not set +# CONFIG_PIDOF is not set +# CONFIG_FEATURE_PIDOF_SINGLE is not set +# CONFIG_FEATURE_PIDOF_OMIT is not set +# CONFIG_PKILL is not set +# CONFIG_PS is not set +# CONFIG_FEATURE_PS_WIDE is not set +# CONFIG_FEATURE_PS_LONG is not set +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_RENICE is not set +# CONFIG_BB_SYSCTL is not set +# CONFIG_FEATURE_SHOW_THREADS is not set +# CONFIG_WATCH is not set + +# +# Runit Utilities +# +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVLOGD is not set +# CONFIG_CHCON is not set +# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_SETSEBOOL is not set +# CONFIG_SESTATUS is not set + +# +# Shells +# +CONFIG_ASH=y +# CONFIG_ASH_BASH_COMPAT is not set +# CONFIG_ASH_IDLE_TIMEOUT is not set +# CONFIG_ASH_JOB_CONTROL is not set +# CONFIG_ASH_ALIAS is not set +# CONFIG_ASH_GETOPTS is not set +CONFIG_ASH_BUILTIN_ECHO=y +# CONFIG_ASH_BUILTIN_PRINTF is not set +# CONFIG_ASH_BUILTIN_TEST is not set +# CONFIG_ASH_HELP is not set +# CONFIG_ASH_CMDCMD is not set +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +# CONFIG_ASH_RANDOM_SUPPORT is not set +# CONFIG_ASH_EXPAND_PRMT is not set +# CONFIG_CTTYHACK is not set +# CONFIG_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_BRACE_EXPANSION is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_SAVEHISTORY is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_MODE_X is not set +# CONFIG_MSH is not set +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +# CONFIG_FEATURE_BASH_IS_ASH is not set +# CONFIG_FEATURE_BASH_IS_HUSH is not set +CONFIG_FEATURE_BASH_IS_NONE=y +# CONFIG_SH_MATH_SUPPORT is not set +# CONFIG_SH_MATH_SUPPORT_64 is not set +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +# CONFIG_FEATURE_SH_HISTFILESIZE is not set + +# +# System Logging Utilities +# +# CONFIG_KLOGD is not set +# CONFIG_FEATURE_KLOGD_KLOGCTL is not set +# CONFIG_LOGGER is not set +# CONFIG_LOGREAD is not set +# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set +# CONFIG_SYSLOGD is not set +# CONFIG_FEATURE_ROTATE_LOGFILE is not set +# CONFIG_FEATURE_REMOTE_LOG is not set +# CONFIG_FEATURE_SYSLOGD_DUP is not set +# CONFIG_FEATURE_SYSLOGD_CFG is not set +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 +# CONFIG_FEATURE_IPC_SYSLOG is not set +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_FEATURE_KMSG_SYSLOG is not set diff --git a/apps/nerves_system_rpi3/cmdline.txt b/apps/nerves_system_rpi3/cmdline.txt new file mode 100644 index 00000000..b80120a5 --- /dev/null +++ b/apps/nerves_system_rpi3/cmdline.txt @@ -0,0 +1 @@ +console=tty1 console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait diff --git a/apps/nerves_system_rpi3/config.txt b/apps/nerves_system_rpi3/config.txt new file mode 100644 index 00000000..68782ebf --- /dev/null +++ b/apps/nerves_system_rpi3/config.txt @@ -0,0 +1,24 @@ +# Please note that this is only a sample, we recommend you to change it to fit +# your needs. +# You should override this file using a post-build script. +# See http://buildroot.org/downloads/manual/manual.html#rootfs-custom +# and http://elinux.org/RPiconfig for a description of config.txt syntax +# Device tree options are documented at +# https://github.com/raspberrypi/documentation/blob/master/configuration/device-tree.md + +kernel=zImage + +# This, along with the Raspberry Pi "x" firmware is need for the camera +# to work. See Target packages->Hardware handling->Firmware for "x" firmware. +gpu_mem=128 + +# Enable I2C and SPI +dtparam=i2c_arm=on,spi=on + +# Comment this in or modify to enable OneWire +# NOTE: check that the overlay that you specify is in the boot partition or +# this won't work. +#dtoverlay=w1-gpio-pullup,gpiopin=4 + +# Enable the UART (/dev/ttyS0) on the RPi3. +enable_uart=1 diff --git a/apps/nerves_system_rpi3/fwup.conf b/apps/nerves_system_rpi3/fwup.conf new file mode 100644 index 00000000..23294062 --- /dev/null +++ b/apps/nerves_system_rpi3/fwup.conf @@ -0,0 +1,319 @@ +# Firmware configuration file for the Raspberry Pi 3 + +# Default paths if not specified via the commandline +define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs") + +# This configuration file will create an image that +# has an MBR and the following 3 partitions: +# +# +----------------------------+ +# | MBR | +# +----------------------------+ +# | p0: Boot partition (FAT32) | +# | zImage, bootcode.bin, | +# | config.txt, etc. | +# +----------------------------+ +# | p1*: Rootfs A (squashfs) | +# +----------------------------+ +# | p1*: Rootfs B (squashfs) | +# +----------------------------+ +# | p2: Application (FAT32) | +# +----------------------------+ +# +# The p1 partition points to whichever of Rootfs A or B that +# is active. +# +# The image is sized to be less than 1 GB so that it fits on +# nearly any SDCard around. If you have a larger SDCard and +# need more space, feel free to bump the partition sizes +# below. + +# The Raspberry Pi is incredibly picky on the partition sizes +# and in ways that I don't understand. Test changes one at a +# time to make sure that they boot. (Sizes are in 512 byte +# blocks) +define(BOOT_PART_OFFSET, 63) +define(BOOT_PART_COUNT, 77261) + +# Let the rootfs have room to grow up to 128 MiB and align +# it to the nearest 1 MB boundary +define(ROOTFS_A_PART_OFFSET, 77324) +define(ROOTFS_A_PART_COUNT, 289044) +define(ROOTFS_B_PART_OFFSET, 366368) +define(ROOTFS_B_PART_COUNT, 289044) + +# Application partition. This partition can occupy all of the +# remaining space. Size it to fit the destination. +define(APP_PART_OFFSET, 655412) +define(APP_PART_COUNT, 1048576) + +# Firmware metadata +meta-product = "Nerves Firmware" +meta-description = "" +meta-version = ${NERVES_SDK_VERSION} +meta-platform = "rpi3" +meta-architecture = "arm" +meta-author = "Frank Hunleth" + +# File resources are listed in the order that they are included in the .fw file +# This is important, since this is the order that they're written on a firmware +# update due to the event driven nature of the update system. +file-resource bootcode.bin { + host-path = "${NERVES_SYSTEM}/images/rpi-firmware/bootcode.bin" +} +file-resource fixup.dat { + host-path = "${NERVES_SYSTEM}/images/rpi-firmware/fixup.dat" +} +file-resource start.elf { + host-path = "${NERVES_SYSTEM}/images/rpi-firmware/start.elf" +} +file-resource config.txt { + host-path = "${NERVES_SYSTEM}/images/config.txt" +} +file-resource cmdline.txt { + host-path = "${NERVES_SYSTEM}/images/cmdline.txt" +} +file-resource zImage { + # All Nerves configs use the DT kernel, but if you don't want it, remove + # the .mkknlimg part of the next line. + host-path = "${NERVES_SYSTEM}/images/zImage.mkknlimg" +} +file-resource bcm2710-rpi-3-b.dtb { + host-path = "${NERVES_SYSTEM}/images/bcm2710-rpi-3-b.dtb" +} +file-resource w1-gpio-pullup.dtbo { + host-path = "${NERVES_SYSTEM}/images/rpi-firmware/overlays/w1-gpio-pullup.dtbo" +} + +file-resource rootfs.img { + host-path = ${ROOTFS} +} + +mbr mbr-a { + partition 0 { + block-offset = ${BOOT_PART_OFFSET} + block-count = ${BOOT_PART_COUNT} + type = 0xc # FAT32 + boot = true + } + partition 1 { + block-offset = ${ROOTFS_A_PART_OFFSET} + block-count = ${ROOTFS_A_PART_COUNT} + type = 0x83 # Linux + } + partition 2 { + block-offset = ${APP_PART_OFFSET} + block-count = ${APP_PART_COUNT} + type = 0x83 # FAT32 + } + # partition 3 is unused +} + +mbr mbr-b { + partition 0 { + block-offset = ${BOOT_PART_OFFSET} + block-count = ${BOOT_PART_COUNT} + type = 0xc # FAT32 + boot = true + } + partition 1 { + block-offset = ${ROOTFS_B_PART_OFFSET} + block-count = ${ROOTFS_B_PART_COUNT} + type = 0x83 # Linux + } + partition 2 { + block-offset = ${APP_PART_OFFSET} + block-count = ${APP_PART_COUNT} + type = 0x83 # FAT32 + } + # partition 3 is unused +} + +# This firmware task writes everything to the destination media +task complete { + # Only match if not mounted + require-unmounted-destination = true + + # Everything that gets written can be verified on the fly. + # This speeds things up, since we don't care about detecting + # errors before data gets written. + verify-on-the-fly = true + + on-init { + mbr_write(mbr-a) + + fat_mkfs(${BOOT_PART_OFFSET}, ${BOOT_PART_COUNT}) + fat_setlabel(${BOOT_PART_OFFSET}, "BOOT") + fat_mkdir(${BOOT_PART_OFFSET}, "overlays") + } + + on-resource config.txt { fat_write(${BOOT_PART_OFFSET}, "config.txt") } + on-resource cmdline.txt { fat_write(${BOOT_PART_OFFSET}, "cmdline.txt") } + on-resource bootcode.bin { fat_write(${BOOT_PART_OFFSET}, "bootcode.bin") } + on-resource start.elf { fat_write(${BOOT_PART_OFFSET}, "start.elf") } + on-resource fixup.dat { fat_write(${BOOT_PART_OFFSET}, "fixup.dat") } + on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage") } + on-resource bcm2710-rpi-3-b.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb") } + on-resource w1-gpio-pullup.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo") } + + on-resource rootfs.img { + # write to the first rootfs partition + raw_write(${ROOTFS_A_PART_OFFSET}) + } + + on-finish { + # Initialize a big partition for application data + # This is done last so that the boot partition can be written to completely + # before the first write to this partition. Not skipping back and forth between + # FAT filesystems saves a little time when programming the Flash. + fat_mkfs(${APP_PART_OFFSET}, ${APP_PART_COUNT}) + fat_setlabel(${APP_PART_OFFSET}, "APPDATA") + } +} + +task upgrade.a { + # This task upgrades the A partition + require-partition1-offset = ${ROOTFS_B_PART_OFFSET} + + # Since the upgrade won't run until it has been finalized, it's ok + # to write data as it is read. + verify-on-the-fly = true + + on-init { + # Erase any old saved files from previous upgrades + fat_rm(${BOOT_PART_OFFSET}, "zImage.pre") + fat_rm(${BOOT_PART_OFFSET}, "config.txt.pre") + fat_rm(${BOOT_PART_OFFSET}, "cmdline.txt.pre") + fat_rm(${BOOT_PART_OFFSET}, "bootcode.bin.pre") + fat_rm(${BOOT_PART_OFFSET}, "start.elf.pre") + fat_rm(${BOOT_PART_OFFSET}, "fixup.dat.pre") + fat_rm(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb.pre") + + # Make the overlays directory in case it isn't already there. + fat_mkdir(${BOOT_PART_OFFSET}, "overlays") + fat_rm(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.pre") + } + + # Write the new firmware and Linux images, but don't + # commit them. That way if the user aborts midway, we + # still are using the original firmware. + on-resource config.txt { fat_write(${BOOT_PART_OFFSET}, "config.txt.new") } + on-resource cmdline.txt { fat_write(${BOOT_PART_OFFSET}, "cmdline.txt.new") } + on-resource bootcode.bin { fat_write(${BOOT_PART_OFFSET}, "bootcode.bin.new") } + on-resource start.elf { fat_write(${BOOT_PART_OFFSET}, "start.elf.new") } + on-resource fixup.dat { fat_write(${BOOT_PART_OFFSET}, "fixup.dat.new") } + on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.new") } + on-resource bcm2710-rpi-3-b.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb.new") } + on-resource w1-gpio-pullup.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new") } + + on-resource rootfs.img { + # write to the first rootfs partition + raw_write(${ROOTFS_A_PART_OFFSET}) + } + + on-finish { + # Switch over to boot the new firmware + mbr_write(mbr-a) + + fat_mv(${BOOT_PART_OFFSET}, "zImage", "zImage.pre") + fat_mv(${BOOT_PART_OFFSET}, "config.txt", "config.txt.pre") + fat_mv(${BOOT_PART_OFFSET}, "cmdline.txt", "cmdline.txt.pre") + fat_mv(${BOOT_PART_OFFSET}, "bootcode.bin", "bootcode.bin.pre") + fat_mv(${BOOT_PART_OFFSET}, "start.elf", "start.elf.pre") + fat_mv(${BOOT_PART_OFFSET}, "fixup.dat", "fixup.dat.pre") + fat_mv(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb", "bcm2710-rpi-3-b.dtb.pre") + fat_mv(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo", "overlays/w1-gpio-pullup.dtbo.pre") + + fat_mv(${BOOT_PART_OFFSET}, "zImage.new", "zImage") + fat_mv(${BOOT_PART_OFFSET}, "config.txt.new", "config.txt") + fat_mv(${BOOT_PART_OFFSET}, "cmdline.txt.new", "cmdline.txt") + fat_mv(${BOOT_PART_OFFSET}, "bootcode.bin.new", "bootcode.bin") + fat_mv(${BOOT_PART_OFFSET}, "start.elf.new", "start.elf") + fat_mv(${BOOT_PART_OFFSET}, "fixup.dat.new", "fixup.dat") + fat_mv(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb.new", "bcm2710-rpi-3-b.dtb") + fat_mv(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new", "overlays/w1-gpio-pullup.dtbo") + } + + on-error { + # Clean up in case something goes wrong + fat_rm(${BOOT_PART_OFFSET}, "zImage.new") + fat_rm(${BOOT_PART_OFFSET}, "config.txt.new") + fat_rm(${BOOT_PART_OFFSET}, "cmdline.txt.new") + fat_rm(${BOOT_PART_OFFSET}, "bootcode.bin.new") + fat_rm(${BOOT_PART_OFFSET}, "start.elf.new") + fat_rm(${BOOT_PART_OFFSET}, "fixup.dat.new") + fat_rm(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb.new") + fat_rm(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new") + } +} + +task upgrade.b { + # This task upgrades the B partition + require-partition1-offset = ${ROOTFS_A_PART_OFFSET} + + # Since the upgrade won't run until it has been finalized, it's ok + # to write data as it is read. + verify-on-the-fly = true + + on-init { + fat_rm(${BOOT_PART_OFFSET}, "zImage.pre") + fat_rm(${BOOT_PART_OFFSET}, "config.txt.pre") + fat_rm(${BOOT_PART_OFFSET}, "cmdline.txt.pre") + fat_rm(${BOOT_PART_OFFSET}, "bootcode.bin.pre") + fat_rm(${BOOT_PART_OFFSET}, "start.elf.pre") + fat_rm(${BOOT_PART_OFFSET}, "fixup.dat.pre") + fat_rm(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb.pre") + + fat_mkdir(${BOOT_PART_OFFSET}, "overlays") + fat_rm(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.pre") + } + + on-resource config.txt { fat_write(${BOOT_PART_OFFSET}, "config.txt.new") } + on-resource cmdline.txt { fat_write(${BOOT_PART_OFFSET}, "cmdline.txt.new") } + on-resource bootcode.bin { fat_write(${BOOT_PART_OFFSET}, "bootcode.bin.new") } + on-resource start.elf { fat_write(${BOOT_PART_OFFSET}, "start.elf.new") } + on-resource fixup.dat { fat_write(${BOOT_PART_OFFSET}, "fixup.dat.new") } + on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.new") } + on-resource bcm2710-rpi-3-b.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb.new") } + on-resource w1-gpio-pullup.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new") } + + on-resource rootfs.img { + # write to the first rootfs partition + raw_write(${ROOTFS_B_PART_OFFSET}) + } + + on-finish { + # Switch over to boot the new firmware + mbr_write(mbr-b) + + fat_mv(${BOOT_PART_OFFSET}, "zImage", "zImage.pre") + fat_mv(${BOOT_PART_OFFSET}, "config.txt", "config.txt.pre") + fat_mv(${BOOT_PART_OFFSET}, "cmdline.txt", "cmdline.txt.pre") + fat_mv(${BOOT_PART_OFFSET}, "bootcode.bin", "bootcode.bin.pre") + fat_mv(${BOOT_PART_OFFSET}, "start.elf", "start.elf.pre") + fat_mv(${BOOT_PART_OFFSET}, "fixup.dat", "fixup.dat.pre") + fat_mv(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb", "bcm2710-rpi-3-b.dtb.pre") + fat_mv(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo", "overlays/w1-gpio-pullup.dtbo.pre") + + fat_mv(${BOOT_PART_OFFSET}, "zImage.new", "zImage") + fat_mv(${BOOT_PART_OFFSET}, "config.txt.new", "config.txt") + fat_mv(${BOOT_PART_OFFSET}, "cmdline.txt.new", "cmdline.txt") + fat_mv(${BOOT_PART_OFFSET}, "bootcode.bin.new", "bootcode.bin") + fat_mv(${BOOT_PART_OFFSET}, "start.elf.new", "start.elf") + fat_mv(${BOOT_PART_OFFSET}, "fixup.dat.new", "fixup.dat") + fat_mv(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb.new", "bcm2710-rpi-3-b.dtb") + fat_mv(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new", "overlays/w1-gpio-pullup.dtbo") + } + + on-error { + # Clean up in case something goes wrong + fat_rm(${BOOT_PART_OFFSET}, "zImage.new") + fat_rm(${BOOT_PART_OFFSET}, "config.txt.new") + fat_rm(${BOOT_PART_OFFSET}, "cmdline.txt.new") + fat_rm(${BOOT_PART_OFFSET}, "bootcode.bin.new") + fat_rm(${BOOT_PART_OFFSET}, "start.elf.new") + fat_rm(${BOOT_PART_OFFSET}, "fixup.dat.new") + fat_rm(${BOOT_PART_OFFSET}, "bcm2710-rpi-3-b.dtb.new") + fat_rm(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new") + } +} diff --git a/apps/nerves_system_rpi3/linux-4.4.defconfig b/apps/nerves_system_rpi3/linux-4.4.defconfig new file mode 100644 index 00000000..1ea9204d --- /dev/null +++ b/apps/nerves_system_rpi3/linux-4.4.defconfig @@ -0,0 +1,256 @@ +# CONFIG_ARM_PATCH_PHYS_VIRT is not set +CONFIG_PHYS_OFFSET=0 +CONFIG_LOCALVERSION="-v7" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_FHANDLE=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_MEMCG=y +CONFIG_BLK_CGROUP=y +CONFIG_NAMESPACES=y +CONFIG_SCHED_AUTOGROUP=y +CONFIG_BLK_DEV_INITRD=y +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set +CONFIG_EMBEDDED=y +# CONFIG_COMPAT_BRK is not set +CONFIG_JUMP_LABEL=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_BLK_DEV_THROTTLING=y +CONFIG_PARTITION_ADVANCED=y +CONFIG_MAC_PARTITION=y +CONFIG_CFQ_GROUP_IOSCHED=y +CONFIG_ARCH_BCM2709=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_SMP=y +CONFIG_HAVE_ARM_ARCH_TIMER=y +CONFIG_VMSPLIT_2G=y +CONFIG_PREEMPT=y +CONFIG_AEABI=y +CONFIG_OABI_COMPAT=y +# CONFIG_CPU_SW_DOMAIN_PAN is not set +CONFIG_CLEANCACHE=y +CONFIG_FRONTSWAP=y +CONFIG_CMA=y +CONFIG_UACCESS_WITH_MEMCPY=y +CONFIG_SECCOMP=y +# CONFIG_ATAGS is not set +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=squashfs rootwait" +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_STAT is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_VFP=y +CONFIG_NEON=y +CONFIG_KERNEL_MODE_NEON=y +# CONFIG_SUSPEND is not set +CONFIG_PM=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_SYN_COOKIES=y +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_IPV6 is not set +CONFIG_CFG80211=y +CONFIG_CFG80211_INTERNAL_REGDB=y +CONFIG_CFG80211_WEXT=y +CONFIG_MAC80211=y +CONFIG_RFKILL=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_DMA_CMA=y +CONFIG_CMA_SIZE_MBYTES=5 +CONFIG_OF_CONFIGFS=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_EEPROM_AT24=m +CONFIG_SCSI=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +# CONFIG_SCSI_LOWLEVEL is not set +CONFIG_NETDEVICES=y +# CONFIG_ETHERNET is not set +CONFIG_USB_USBNET=y +# CONFIG_USB_NET_AX8817X is not set +# CONFIG_USB_NET_AX88179_178A is not set +# CONFIG_USB_NET_CDCETHER is not set +# CONFIG_USB_NET_CDC_NCM is not set +CONFIG_USB_NET_SMSC95XX=y +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_CDC_SUBSET is not set +# CONFIG_USB_NET_ZAURUS is not set +CONFIG_BRCMFMAC=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_EVDEV=m +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_SERIO is not set +CONFIG_BRCM_CHAR_DRIVERS=y +CONFIG_BCM_VC_CMA=y +CONFIG_BCM_VCIO=y +CONFIG_BCM_VC_SM=y +CONFIG_BCM2835_DEVGPIOMEM=y +# CONFIG_LEGACY_PTYS is not set +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set +CONFIG_SERIAL_8250_CONSOLE=y +# CONFIG_SERIAL_8250_DMA is not set +CONFIG_SERIAL_8250_NR_UARTS=1 +CONFIG_SERIAL_8250_RUNTIME_UARTS=0 +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_TTY_PRINTK=y +CONFIG_HW_RANDOM=y +CONFIG_RAW_DRIVER=y +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_BCM2708=y +CONFIG_SPI=y +CONFIG_SPI_BCM2835=y +CONFIG_SPI_SPIDEV=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_STMPE=y +CONFIG_W1=y +CONFIG_W1_MASTER_GPIO=y +CONFIG_W1_SLAVE_THERM=y +# CONFIG_HWMON is not set +CONFIG_THERMAL=y +CONFIG_THERMAL_BCM2835=y +CONFIG_WATCHDOG=y +CONFIG_BCM2835_WDT=m +CONFIG_MFD_STMPE=y +CONFIG_STMPE_SPI=y +CONFIG_FB=y +CONFIG_FB_BCM2708=y +CONFIG_FB_RPISENSE=m +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_SOUND=y +CONFIG_SND=m +CONFIG_SND_SEQUENCER=m +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_BCM2835=m +CONFIG_SND_SOC=m +CONFIG_SND_BCM2835_SOC_I2S=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m +CONFIG_SND_BCM2708_SOC_RPI_DAC=m +CONFIG_SND_BCM2708_SOC_RPI_PROTO=m +CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m +CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m +CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m +CONFIG_SND_BCM2708_SOC_RASPIDAC3=m +CONFIG_SND_SOC_ADAU1701=m +CONFIG_SND_SOC_WM8804_I2C=m +CONFIG_SND_SIMPLE_CARD=m +CONFIG_SOUND_PRIME=m +CONFIG_HIDRAW=y +CONFIG_HID_PID=y +CONFIG_HID_APPLE=y +CONFIG_USB_HIDDEV=y +CONFIG_USB=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_DWCOTG=y +CONFIG_USB_ACM=y +CONFIG_USB_PRINTER=m +CONFIG_USB_WDM=m +CONFIG_USB_STORAGE=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK_MINORS=32 +CONFIG_MMC_BCM2835=y +CONFIG_MMC_BCM2835_DMA=y +CONFIG_MMC_BCM2835_SDHOST=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_BACKLIGHT=y +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y +CONFIG_LEDS_TRIGGER_TRANSIENT=y +CONFIG_LEDS_TRIGGER_CAMERA=y +CONFIG_LEDS_TRIGGER_INPUT=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_HCTOSYS is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_BCM2835=y +CONFIG_DMA_BCM2708=y +CONFIG_UIO=m +CONFIG_UIO_PDRV_GENIRQ=m +CONFIG_STAGING=y +CONFIG_R8712U=y +CONFIG_STAGING_MEDIA=y +CONFIG_MAILBOX=y +CONFIG_BCM2835_MBOX=y +# CONFIG_IOMMU_SUPPORT is not set +CONFIG_RASPBERRYPI_POWER=y +CONFIG_PWM=y +CONFIG_PWM_BCM2835=m +CONFIG_RASPBERRYPI_FIRMWARE=y +CONFIG_EXT4_FS=y +CONFIG_FANOTIFY=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_SQUASHFS=y +# CONFIG_NETWORK_FILESYSTEMS is not set +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_850=y +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_UTF8=y +CONFIG_PRINTK_TIME=y +CONFIG_BOOT_PRINTK_DELAY=y +CONFIG_DEBUG_MEMORY_INIT=y +CONFIG_DETECT_HUNG_TASK=y +# CONFIG_DEBUG_PREEMPT is not set +CONFIG_STACKTRACE=y +# CONFIG_FTRACE is not set +# CONFIG_CRYPTO_HW is not set diff --git a/apps/nerves_system_rpi3/linux-4.x.defconfig b/apps/nerves_system_rpi3/linux-4.x.defconfig new file mode 100644 index 00000000..7e693773 --- /dev/null +++ b/apps/nerves_system_rpi3/linux-4.x.defconfig @@ -0,0 +1,240 @@ +# CONFIG_ARM_PATCH_PHYS_VIRT is not set +CONFIG_PHYS_OFFSET=0 +CONFIG_LOCALVERSION="-v7" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_FHANDLE=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_MEMCG=y +CONFIG_BLK_CGROUP=y +CONFIG_NAMESPACES=y +CONFIG_SCHED_AUTOGROUP=y +CONFIG_BLK_DEV_INITRD=y +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set +CONFIG_EMBEDDED=y +# CONFIG_COMPAT_BRK is not set +CONFIG_JUMP_LABEL=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_BLK_DEV_THROTTLING=y +CONFIG_PARTITION_ADVANCED=y +CONFIG_MAC_PARTITION=y +CONFIG_CFQ_GROUP_IOSCHED=y +CONFIG_ARCH_BCM2709=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_SMP=y +CONFIG_HAVE_ARM_ARCH_TIMER=y +CONFIG_VMSPLIT_2G=y +CONFIG_PREEMPT=y +CONFIG_AEABI=y +CONFIG_OABI_COMPAT=y +# CONFIG_CPU_SW_DOMAIN_PAN is not set +CONFIG_CLEANCACHE=y +CONFIG_FRONTSWAP=y +CONFIG_CMA=y +CONFIG_UACCESS_WITH_MEMCPY=y +CONFIG_SECCOMP=y +# CONFIG_ATAGS is not set +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=squashfs rootwait" +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_STAT is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_VFP=y +CONFIG_NEON=y +CONFIG_KERNEL_MODE_NEON=y +# CONFIG_SUSPEND is not set +CONFIG_PM=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_SYN_COOKIES=y +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_IPV6 is not set +CONFIG_CFG80211=y +# CONFIG_CFG80211_DEFAULT_PS is not set +CONFIG_CFG80211_INTERNAL_REGDB=y +CONFIG_CFG80211_WEXT=y +CONFIG_MAC80211=y +CONFIG_MAC80211_LEDS=y +CONFIG_RFKILL=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_DMA_CMA=y +CONFIG_CMA_SIZE_MBYTES=5 +CONFIG_OF_CONFIGFS=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_EEPROM_AT24=m +CONFIG_SCSI=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +# CONFIG_SCSI_LOWLEVEL is not set +CONFIG_NETDEVICES=y +# CONFIG_ETHERNET is not set +CONFIG_USB_USBNET=y +# CONFIG_USB_NET_AX8817X is not set +# CONFIG_USB_NET_AX88179_178A is not set +# CONFIG_USB_NET_CDCETHER is not set +# CONFIG_USB_NET_CDC_NCM is not set +CONFIG_USB_NET_SMSC95XX=y +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_CDC_SUBSET is not set +# CONFIG_USB_NET_ZAURUS is not set +CONFIG_BRCMFMAC=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_EVDEV=m +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_STMPE=m +# CONFIG_SERIO is not set +CONFIG_BRCM_CHAR_DRIVERS=y +CONFIG_BCM_VC_CMA=y +CONFIG_BCM_VCIO=y +CONFIG_BCM_VC_SM=y +CONFIG_BCM2835_DEVGPIOMEM=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_LEGACY_PTYS is not set +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set +CONFIG_SERIAL_8250_CONSOLE=y +# CONFIG_SERIAL_8250_DMA is not set +CONFIG_SERIAL_8250_NR_UARTS=1 +CONFIG_SERIAL_8250_RUNTIME_UARTS=0 +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_TTY_PRINTK=y +CONFIG_HW_RANDOM=y +CONFIG_RAW_DRIVER=y +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_BCM2708=y +CONFIG_SPI=y +CONFIG_SPI_BCM2835=m +CONFIG_SPI_SPIDEV=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_STMPE=y +# CONFIG_HWMON is not set +CONFIG_THERMAL=y +CONFIG_THERMAL_BCM2835=y +CONFIG_WATCHDOG=y +CONFIG_BCM2835_WDT=m +CONFIG_MFD_RPISENSE_CORE=y +CONFIG_MFD_STMPE=y +CONFIG_STMPE_SPI=y +CONFIG_FB=y +CONFIG_FB_BCM2708=y +CONFIG_BACKLIGHT_LCD_SUPPORT=y +# CONFIG_LCD_CLASS_DEVICE is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_RPI=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_HIDRAW=y +CONFIG_HID_APPLE=y +CONFIG_HID_PID=y +CONFIG_USB_HIDDEV=y +CONFIG_USB=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_DWCOTG=y +CONFIG_USB_ACM=y +CONFIG_USB_STORAGE=y +CONFIG_USB_SERIAL=y +CONFIG_USB_SERIAL_CONSOLE=y +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_CH341=y +CONFIG_USB_SERIAL_CP210X=y +CONFIG_USB_SERIAL_FTDI_SIO=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK_MINORS=32 +CONFIG_MMC_BCM2835=y +CONFIG_MMC_BCM2835_DMA=y +CONFIG_MMC_BCM2835_SDHOST=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_BACKLIGHT=y +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y +CONFIG_LEDS_TRIGGER_TRANSIENT=y +CONFIG_LEDS_TRIGGER_CAMERA=y +CONFIG_LEDS_TRIGGER_INPUT=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_HCTOSYS is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_BCM2835=y +CONFIG_DMA_BCM2708=y +CONFIG_UIO=m +CONFIG_UIO_PDRV_GENIRQ=m +CONFIG_STAGING=y +CONFIG_STAGING_MEDIA=y +CONFIG_MAILBOX=y +CONFIG_BCM2835_MBOX=y +CONFIG_RASPBERRYPI_POWER=y +CONFIG_PWM=y +CONFIG_PWM_BCM2835=m +CONFIG_GENERIC_PHY=y +CONFIG_RASPBERRYPI_FIRMWARE=y +CONFIG_EXT4_FS=y +CONFIG_FANOTIFY=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_SQUASHFS=y +# CONFIG_NETWORK_FILESYSTEMS is not set +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_850=y +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_UTF8=y +CONFIG_PRINTK_TIME=y +CONFIG_BOOT_PRINTK_DELAY=y +CONFIG_DEBUG_MEMORY_INIT=y +CONFIG_DETECT_HUNG_TASK=y +# CONFIG_DEBUG_PREEMPT is not set +CONFIG_STACKTRACE=y +# CONFIG_FTRACE is not set +# CONFIG_CRYPTO_HW is not set diff --git a/apps/nerves_system_rpi3/mix.exs b/apps/nerves_system_rpi3/mix.exs new file mode 100644 index 00000000..b671c655 --- /dev/null +++ b/apps/nerves_system_rpi3/mix.exs @@ -0,0 +1,42 @@ +defmodule NervesSystemRpi3.Mixfile do + use Mix.Project + + @version Path.join(__DIR__, "VERSION") + |> File.read! + |> String.strip + + def project do + [app: :nerves_system_rpi3, + version: @version, + elixir: "~> 1.2", + build_path: "../../_build", + config_path: "../../config/config.exs", + deps_path: "../../deps", + lockfile: "../../mix.lock", + compilers: Mix.compilers ++ [:nerves_package], + description: description(), + package: package(), + deps: deps()] + end + + def application, do: [] + + defp deps do + [{:nerves, "~> 0.4.0"}, + {:nerves_system_br, "~> 0.8.1"}, + {:nerves_toolchain_arm_unknown_linux_gnueabihf, "~> 0.8.0"}] + end + + defp description do + """ + Nerves System - Raspberry Pi 3 B + """ + end + + defp package do + [maintainers: ["Frank Hunleth", "Justin Schneck"], + files: ["LICENSE", "mix.exs", "nerves_defconfig", "nerves.exs", "README.md", "VERSION", "rootfs-additions", "fwup.conf", "cmdline.txt", "linux-4.4.defconfig", "config.txt", "post-createfs.sh"], + licenses: ["Apache 2.0"], + links: %{"Github" => "https://github.com/nerves-project/nerves_system_rpi3"}] + end +end diff --git a/apps/nerves_system_rpi3/nerves.exs b/apps/nerves_system_rpi3/nerves.exs new file mode 100644 index 00000000..5ae64d59 --- /dev/null +++ b/apps/nerves_system_rpi3/nerves.exs @@ -0,0 +1,30 @@ +use Mix.Config + +version = + Path.join(__DIR__, "VERSION") + |> File.read! + |> String.strip + +pkg = :nerves_system_rpi3 + +config pkg, :nerves_env, + type: :system, + version: version, + compiler: :nerves_package, + artifact_url: [ + # TODO change this to farmbot + "https://github.com/nerves-project/#{pkg}/releases/download/v#{version}/#{pkg}-v#{version}.tar.gz", + ], + platform: Nerves.System.BR, + platform_config: [ + defconfig: "nerves_defconfig", + ], + checksum: [ + "rootfs-additions", + "linux-4.4.defconfig", + "fwup.conf", + "cmdline.txt", + "config.txt", + "post-createfs.sh", + "VERSION" + ] diff --git a/apps/nerves_system_rpi3/nerves_defconfig b/apps/nerves_system_rpi3/nerves_defconfig new file mode 100644 index 00000000..f0409eef --- /dev/null +++ b/apps/nerves_system_rpi3/nerves_defconfig @@ -0,0 +1,71 @@ +BR2_arm=y +BR2_cortex_a7=y +BR2_ARM_FPU_NEON_VFPV4=y +BR2_CCACHE=y +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/nerves-project/toolchains/releases/download/v0.8.0/nerves_toolchain_arm_unknown_linux_gnueabihf-0.8.0.linux-x86_64.tar.xz" +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-unknown-linux-gnueabihf" +BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y +BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_4=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y +BR2_TOOLCHAIN_EXTERNAL_CXX=y +BR2_TARGET_GENERIC_HOSTNAME="" +BR2_TARGET_GENERIC_ISSUE="" +BR2_INIT_NONE=y +# BR2_TARGET_GENERIC_GETTY is not set +# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set +BR2_ENABLE_LOCALE_WHITELIST="locale-archive" +BR2_GENERATE_LOCALE="en_US.UTF-8" +BR2_ROOTFS_OVERLAY="${NERVES_SYSTEM}/board/nerves-common/rootfs-additions ${NERVES_DEFCONFIG_DIR}/rootfs-additions" +BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL}/board/nerves-common/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="${NERVES_DEFCONFIG_DIR}/post-createfs.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="26f3b72a9c049be10e6af196252283e1f6ab9d1f" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${NERVES_DEFCONFIG_DIR}/linux-4.x.defconfig" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b" +BR2_LINUX_KERNEL_EXT_KERNEL_WIRELESS_REGDB=y +BR2_PACKAGE_BUSYBOX_CONFIG="${NERVES_SYSTEM}/board/nerves-common/busybox-1.22.config" +BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="${NERVES_DEFCONFIG_DIR}/busybox_defconfig" +BR2_PACKAGE_E2FSPROGS=y +# BR2_PACKAGE_E2FSPROGS_BADBLOCKS is not set +# BR2_PACKAGE_E2FSPROGS_CHATTR is not set +# BR2_PACKAGE_E2FSPROGS_DUMPE2FS is not set +# BR2_PACKAGE_E2FSPROGS_E2FREEFRAG is not set +# BR2_PACKAGE_E2FSPROGS_E2FSCK is not set +# BR2_PACKAGE_E2FSPROGS_E2LABEL is not set +# BR2_PACKAGE_E2FSPROGS_E2UNDO is not set +# BR2_PACKAGE_E2FSPROGS_FILEFRAG is not set +# BR2_PACKAGE_E2FSPROGS_FSCK is not set +# BR2_PACKAGE_E2FSPROGS_LOGSAVE is not set +# BR2_PACKAGE_E2FSPROGS_LSATTR is not set +# BR2_PACKAGE_E2FSPROGS_MKLOSTFOUND is not set +# BR2_PACKAGE_E2FSPROGS_TUNE2FS is not set +# BR2_PACKAGE_E2FSPROGS_UUIDGEN is not set +BR2_PACKAGE_FWUP=y +BR2_PACKAGE_RPI_FIRMWARE=y +BR2_PACKAGE_RPI_FIRMWARE_X=y +BR2_PACKAGE_AVRDUDE=y +BR2_PACKAGE_RPI_USERLAND=y +BR2_PACKAGE_ERLANG_SMP=y +BR2_PACKAGE_LIBMNL=y +BR2_PACKAGE_DNSMASQ=y +BR2_PACKAGE_DROPBEAR=y +BR2_PACKAGE_HOSTAPD=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG=y +BR2_TARGET_ROOTFS_SQUASHFS=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_NERVES_SYSTEM_NAME="nerves_system_rpi3" +BR2_NERVES_ADDITIONAL_IMAGE_FILES="$(NERVES_DEFCONFIG_DIR)/fwup.conf ${NERVES_DEFCONFIG_DIR}/cmdline.txt ${NERVES_DEFCONFIG_DIR}/config.txt" +BR2_PACKAGE_BOARDID=y +BR2_PACKAGE_ERLANG_HISTORY=y +BR2_PACKAGE_NERVES_CONFIG=y +BR2_PACKAGE_NERVES_CONFIG_NO_ERLINIT_CONF=y +BR2_PACKAGE_NERVES_CONFIG_APPS="crypto" +BR2_PACKAGE_NERVES_CONFIG_SNAME="farmbot" diff --git a/apps/nerves_system_rpi3/post-createfs.sh b/apps/nerves_system_rpi3/post-createfs.sh new file mode 100755 index 00000000..5ec12c95 --- /dev/null +++ b/apps/nerves_system_rpi3/post-createfs.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +FWUP_CONFIG=$NERVES_DEFCONFIG_DIR/fwup.conf + +# Mark the Raspberry Pi kernel image as using device tree +$HOST_DIR/usr/bin/mkknlimg \ + $BINARIES_DIR/zImage $BINARIES_DIR/zImage.mkknlimg + +# Run the common post-image processing for nerves +$BR2_EXTERNAL/board/nerves-common/post-createfs.sh $TARGET_DIR $FWUP_CONFIG diff --git a/config/rootfs-additions-rpi3/etc/erlinit.config b/apps/nerves_system_rpi3/rootfs-additions/etc/erlinit.config similarity index 100% rename from config/rootfs-additions-rpi3/etc/erlinit.config rename to apps/nerves_system_rpi3/rootfs-additions/etc/erlinit.config diff --git a/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac4330-sdio.bin b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac4330-sdio.bin new file mode 100644 index 00000000..e3bc3554 Binary files /dev/null and b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac4330-sdio.bin differ diff --git a/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac4330-sdio.txt b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac4330-sdio.txt new file mode 100644 index 00000000..9546246b --- /dev/null +++ b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac4330-sdio.txt @@ -0,0 +1,40 @@ +# bcm94330wlsdgb.txt +manfid=0x2d0 +prodid=0x0552 +vendid=0x14e4 +devid=0x4360 +boardtype=0x0552 +boardrev=0x11 +# this design has 2.4GHz SP3T switch +boardflags=0x00080200 +nocrc=1 +xtalfreq=37400 +boardnum=22 +macaddr=00:90:4c:c5:12:38 +ag0=255 +aa2g=1 +ccode=CN +pa0b0=0x14d0 +pa0b1=0xfd98 +pa0b2=0xff78 +rssismf2g=0xa +rssismc2g=0x3 +rssisav2g=0x7 +maxp2ga0=0x50 +sromrev=3 +il0macaddr=00:90:4c:c5:12:38 +wl0id=0x431b +cckPwrOffset=5 +ofdm2gpo=0x66666666 +mcs2gpo0=0x6666 +mcs2gpo1=0x6666 +swctrlmap_2g=0x04040404,0x02020202,0x02020404,0x10202,0x1ff +swctrlmap_5g=0x00100010,0x00280020,0x00200010,0x14202,0x2f8 +rfreg033=0x19 +rfreg033_cck=0x1f +dacrate2g=160 +txalpfbyp2g=1 +bphyscale=17 +cckPwrIdxCorr=-15 +pacalidx2g=45 +txgaintbl=1 diff --git a/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.bin b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.bin new file mode 100644 index 00000000..84ab5b0d Binary files /dev/null and b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.bin differ diff --git a/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.txt b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.txt new file mode 100644 index 00000000..ea4f648a --- /dev/null +++ b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.txt @@ -0,0 +1,66 @@ +# NVRAM file for BCM943430WLPTH +# 2.4 GHz, 20 MHz BW mode + +# The following parameter values are just placeholders, need to be updated. +manfid=0x2d0 +prodid=0x0727 +vendid=0x14e4 +devid=0x43e2 +boardtype=0x0727 +boardrev=0x1101 +boardnum=22 +macaddr=00:90:4c:c5:12:38 +sromrev=11 +boardflags=0x00404201 +boardflags3=0x08000000 +xtalfreq=37400 +nocrc=1 +ag0=255 +aa2g=1 +ccode=ALL + +pa0itssit=0x20 +extpagain2g=0 +#PA parameters for 2.4GHz, measured at CHIP OUTPUT +pa2ga0=-168,7161,-820 +AvVmid_c0=0x0,0xc8 +cckpwroffset0=5 + +# PPR params +maxp2ga0=84 +txpwrbckof=6 +cckbw202gpo=0 +legofdmbw202gpo=0x66111111 +mcsbw202gpo=0x77711111 +propbw202gpo=0xdd + +# OFDM IIR : +ofdmdigfilttype=18 +ofdmdigfilttypebe=18 +# PAPD mode: +papdmode=1 +papdvalidtest=1 +pacalidx2g=42 +papdepsoffset=-22 +papdendidx=58 + +# LTECX flags +ltecxmux=0 +ltecxpadnum=0x0102 +ltecxfnsel=0x44 +ltecxgcigpio=0x01 + +il0macaddr=00:90:4c:c5:12:38 +wl0id=0x431b + +deadman_to=0xffffffff +# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG +muxenab=0x1 +# CLDO PWM voltage settings - 0x4 - 1.1 volt +#cldo_pwm=0x4 + +#VCO freq 326.4MHz +spurconfig=0x3 + +edonthd20l=-75 +edoffthd20ul=-80 diff --git a/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.txt.bac b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.txt.bac new file mode 100644 index 00000000..ea4f648a --- /dev/null +++ b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43430-sdio.txt.bac @@ -0,0 +1,66 @@ +# NVRAM file for BCM943430WLPTH +# 2.4 GHz, 20 MHz BW mode + +# The following parameter values are just placeholders, need to be updated. +manfid=0x2d0 +prodid=0x0727 +vendid=0x14e4 +devid=0x43e2 +boardtype=0x0727 +boardrev=0x1101 +boardnum=22 +macaddr=00:90:4c:c5:12:38 +sromrev=11 +boardflags=0x00404201 +boardflags3=0x08000000 +xtalfreq=37400 +nocrc=1 +ag0=255 +aa2g=1 +ccode=ALL + +pa0itssit=0x20 +extpagain2g=0 +#PA parameters for 2.4GHz, measured at CHIP OUTPUT +pa2ga0=-168,7161,-820 +AvVmid_c0=0x0,0xc8 +cckpwroffset0=5 + +# PPR params +maxp2ga0=84 +txpwrbckof=6 +cckbw202gpo=0 +legofdmbw202gpo=0x66111111 +mcsbw202gpo=0x77711111 +propbw202gpo=0xdd + +# OFDM IIR : +ofdmdigfilttype=18 +ofdmdigfilttypebe=18 +# PAPD mode: +papdmode=1 +papdvalidtest=1 +pacalidx2g=42 +papdepsoffset=-22 +papdendidx=58 + +# LTECX flags +ltecxmux=0 +ltecxpadnum=0x0102 +ltecxfnsel=0x44 +ltecxgcigpio=0x01 + +il0macaddr=00:90:4c:c5:12:38 +wl0id=0x431b + +deadman_to=0xffffffff +# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG +muxenab=0x1 +# CLDO PWM voltage settings - 0x4 - 1.1 volt +#cldo_pwm=0x4 + +#VCO freq 326.4MHz +spurconfig=0x3 + +edonthd20l=-75 +edoffthd20ul=-80 diff --git a/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43455-sdio.bin b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43455-sdio.bin new file mode 100644 index 00000000..0212bcf1 Binary files /dev/null and b/apps/nerves_system_rpi3/rootfs-additions/lib/firmware/brcm/brcmfmac43455-sdio.bin differ diff --git a/apps/nerves_system_rpi3/rootfs-additions/root b/apps/nerves_system_rpi3/rootfs-additions/root new file mode 120000 index 00000000..cad23091 --- /dev/null +++ b/apps/nerves_system_rpi3/rootfs-additions/root @@ -0,0 +1 @@ +/tmp \ No newline at end of file diff --git a/apps/os/.gitignore b/apps/os/.gitignore new file mode 100644 index 00000000..522a78cf --- /dev/null +++ b/apps/os/.gitignore @@ -0,0 +1,14 @@ +# App artifacts +/_build +/db +/deps +/*.ez + +# Nerves images +/_images + +# Generate on crash by the VM +erl_crash.dump +npm-debug.log +ttb_last_config +cover diff --git a/COMPAT b/apps/os/COMPAT similarity index 100% rename from COMPAT rename to apps/os/COMPAT diff --git a/FAQ.md b/apps/os/FAQ.md similarity index 100% rename from FAQ.md rename to apps/os/FAQ.md diff --git a/LICENSE b/apps/os/LICENSE similarity index 100% rename from LICENSE rename to apps/os/LICENSE diff --git a/apps/os/README.md b/apps/os/README.md new file mode 100644 index 00000000..f613adcc --- /dev/null +++ b/apps/os/README.md @@ -0,0 +1,125 @@ +[![Build Status](https://travis-ci.org/FarmBot/farmbot_os.svg?branch=master)](https://travis-ci.org/FarmBot/farmbot_os.svg?branch=master) + +# FarmBot Software for the Raspberry Pi 3 +The "brains" of Farmbot. Responsible for receiving the commands from [the browser](https://github.com/FarmBot/farmbot-web-frontend) or the [FarmBot API](https://github.com/FarmBot/Farmbot-Web-API). It executes them and reports back the results to any subscribed user(s). + +# First Time Installation + +If you are setting up your FarmBot for the first time, download the latest FarmBot OS `.img` file [here](https://github.com/FarmBot/farmbot_os/releases/latest). + +## Windows users + +* Download [Win32 Disk Imager](https://sourceforge.net/projects/win32diskimager/) +* Select the `.img` file you downloaded +* Select your sdcard's drive letter +* Click `write` + +## Linux / OSX / UNIX +* `dd if=img_file of=/dev/sdX` +* where img_file is the path to you `.img` file, and X is your device's drive letter. + +## Running + 0. Plug your SD Card into your RPi3 + 0. Plug your Arduino into your RPi3 + 0. Plug your power into your RPi3 + 0. From a WiFi enabled device*, search for the SSID `FarmbotConfigurator` + 0. Connect to that and open a web browser to [http://192.168.24.1/](http://192.168.24.1) + 0. Follow the on screen instructions to configure your FarmBot. Once you save your configuration FarmBot will connect to your home WiFi network and to the FarmBot web application. + +\* If you are using a smartphone you may need to disable cellular data to allow your phone's browser to connect to the configurator. + +## Updating the firmware +To update the firmware on the Raspberry Pi and the Arduino, simply use the "update" buttons on the web application. There is no need to reinstall the entire OS. + +# Issues +Please read through the [FAQ](FAQ.md). If you don't see what you need please by all means open a Github Issue! + +# Building / Development (for developers only) + +## Technical Stuff +* Written in [Elixir](http://elixir-lang.org/) using [Nerves Project](http://nerves-project.org/). +* Device status info such as X,Y,Z and calibration data is stored on the Data partition Nerves allows. +* Backups to the cloud provided by [Farmbot API](https://github.com/farmbot/farmbot-web-api) +* Messaging happens via [MQTT](https://github.com/farmbot/mqtt-gateway) + +## Building +[You need Linux to build Linux.](http://www.whylinuxisbetter.net/). Windows is not supported. Bash for Windows and Cygwin will not work. A VM or dual boot environment will work. So with that rant out of the way, and ready for revision here are the steps to build: +* Install Elixir and Erlang. ([installer script]("https://gist.github.com/ConnorRigby/8a8bffff935d1a43cd74c4b8cf28a845")) +* Install [`Nerves`](https://hexdocs.pm/nerves/installation.html) and all related dependencies. +* clone this repo. `git clone https://github.com/FarmBot/farmbot-raspberry-pi-controller.git` +* `cd farmbot-raspberry-pi-controller`. +* Insert an sdcard into your development machine and run: + +```bash +MIX_ENV=prod mix deps.get +MIX_ENV=prod mix firmware +MIX_ENV=prod mix firmware.burn +``` + +You can also run locally (not on an RPI3- Windows is supported for this): + +```bash +export MIX_ENV=dev +rm -rf _deps build _images +mix deps.get +iex -S mix +``` + +You should only need to do the first two commands once. + +## Running Tests +There aren't a lot of tests, but they do exist and can be run by executing the following: +```bash +MIX_ENV=test mix deps.get +mix test --no-start +``` + +Make sure to have the `--no-start` in there. Otherwise it will try to start the +supervision tree, and tests will be broken and what not. + +## Debugging on hardware + +The Raspberry Pi will boot up with an Iex console on the hardware UART. If you need to debug something this is the easiest to get too. + +If you do not have a 3.3v FTDI cable, you can build the firmware with the console on HDMI. +In the `erlinit.config` file change `-c ttyS0` to `-c ttyS1`. This requires a usb mouse, keyboard and monitor into your pi. + +## Development Tips + +You can connect IEx to the running pi by running +`iex --name console@localhost --remsh farmbot@ --cookie democookie`. + +Debug message still only will print to UART or HDMI (whichever you have configured) + +If you frequently build the firmware, removing the sdcard and writing the build every time gets pretty old. You can upload firmware to an already running farmbot one of two ways after you run a successful `mix firmware` +0. You can upload the image to the pi using CURL or similar. `curl -T _images/rpi3/fw.fw "http://$RPI_IP_ADDRESS:8988/firmware" -H "Content-Type: application/x-firmware" -H "X-Reboot: true"` +0. Or you can host the .fw file on your pc using a webserver ie `npm install serve` and download it from the pi.This should be ran ON THE PI ITSELF `Downloader.download_and_install_update("http:///WHEREVER YOUR FILE IS")` + +# Building for production + +## Major version change +you will have to do one of two things: +0. Do a fresh clone of this repo. (prefered) +0. Clean everything out with something along the lines of `rm -rf _build deps _images rel/fw` + +Then follow these steps then follow the steps for a minor version. +```bash +export MIX_ENV=prod +mix deps.get +``` +this will generate a .fw file in the images dir. this will be an update file. A raw image file is then generated from this file + +## Minor Version +```bash +export MIX_ENV=prod +mix firmware +cd _images/rpi3/ +fwup -a -d firmware.img -i fw.fw -t complete +``` + +These two files should be put into the github release. +If someone would like to write a Mix Task for this it'd be much appreciated. + +# Want to Help? + +[Low Hanging Fruit](https://github.com/FarmBot/farmbot_os/search?utf8=%E2%9C%93&q=TODO) diff --git a/VERSION b/apps/os/VERSION similarity index 100% rename from VERSION rename to apps/os/VERSION diff --git a/config/.credo.exs b/apps/os/config/.credo.exs similarity index 100% rename from config/.credo.exs rename to apps/os/config/.credo.exs diff --git a/apps/os/config/config.exs b/apps/os/config/config.exs new file mode 100644 index 00000000..aba88d4f --- /dev/null +++ b/apps/os/config/config.exs @@ -0,0 +1,21 @@ +use Mix.Config +import_config "#{Mix.env}.exs" + +config :farmbot_auth, + callbacks: [Farmbot.RPC.Transport.GenMqtt.Handler] + +config :json_rpc, + transport: Farmbot.RPC.Transport.GenMqtt.Handler, + handler: Farmbot.RPC.Handler + +config :uart, + baud: 115200 + +config :logger, + utc_logs: true + +config :quantum, cron: [ + "5 1 * * *": {Farmbot.Updates.Handler, :do_update_check} +] + +config :farmbot, config_file: "default_config_#{Mix.Project.config[:target]}.json" diff --git a/apps/os/config/dev.exs b/apps/os/config/dev.exs new file mode 100644 index 00000000..3b854808 --- /dev/null +++ b/apps/os/config/dev.exs @@ -0,0 +1,3 @@ +use Mix.Config +config :farmbot, state_path: "/tmp" +import_config "hardware/#{Mix.Project.config[:target]}/hardware.exs" diff --git a/config/hardware_development.exs b/apps/os/config/hardware/development/hardware.exs similarity index 100% rename from config/hardware_development.exs rename to apps/os/config/hardware/development/hardware.exs diff --git a/config/hardware_qemu.exs b/apps/os/config/hardware/qemu/hardware.exs similarity index 100% rename from config/hardware_qemu.exs rename to apps/os/config/hardware/qemu/hardware.exs diff --git a/config/hardware_rpi3.exs b/apps/os/config/hardware/rpi3/hardware.exs similarity index 100% rename from config/hardware_rpi3.exs rename to apps/os/config/hardware/rpi3/hardware.exs diff --git a/apps/os/config/hardware/rpi3/rootfs-additions/etc/erlinit.config b/apps/os/config/hardware/rpi3/rootfs-additions/etc/erlinit.config new file mode 100644 index 00000000..9fde5670 --- /dev/null +++ b/apps/os/config/hardware/rpi3/rootfs-additions/etc/erlinit.config @@ -0,0 +1,40 @@ + +# Additional configuration for erlinit + +# Turn on the debug prints +#-v + +# Specify the UART port that the shell should use. +-c ttyS0 + +# If more than one tty are available, always warn if the user is looking at +# the wrong one. +--warn-unused-tty + +# Use dtach to capture the iex session so that it can be redirected +# to the app's GUI +#-s "/usr/bin/dtach -N /tmp/iex_prompt" + +# Specify the user and group IDs for the Erlang VM +#--uid 100 +#--gid 200 + +# Uncomment to hang the board rather than rebooting when Erlang exits +--hang-on-exit + +# Run a program if the Erlang VM exits +--run-on-exit "/bin/sh" +# Run a program before the Erlang VM starts +# --pre-run-exec "/bin/sh -e /usr/bin/pre_erl.sh" + +-m /dev/mmcblk0p3:/state:ext4:: + +# Enable UTF-8 filename handling in Erlang and custom inet configuration +-e LANG=en_US.UTF-8;LANGUAGE=en;ERL_INETRC=/etc/erl_inetrc + +# Erlang release search path +-r /srv/erlang + +# Assign a unique hostname based on the board id +-d "/usr/bin/boardid -b rpi -n 4" +-n nerves-%.4s diff --git a/config/prod.exs b/apps/os/config/prod.exs similarity index 71% rename from config/prod.exs rename to apps/os/config/prod.exs index e156d816..31a0f19b 100644 --- a/config/prod.exs +++ b/apps/os/config/prod.exs @@ -1,7 +1,7 @@ use Mix.Config config :nerves, :firmware, - rootfs_additions: "config/rootfs-additions-#{Mix.Project.config[:target]}", - hardware: "config/rootfs-additions-#{Mix.Project.config[:target]}" + rootfs_additions: "config/hardware/#{Mix.Project.config[:target]}/rootfs-additions" + # hardware: "config/rootfs-additions-#{Mix.Project.config[:target]}" config :configurator, port: 80 @@ -26,4 +26,4 @@ config :iex, :reset ] |> IO.ANSI.format |> IO.chardata_to_string # overwrite anything on if need be. -import_config "hardware_#{Mix.Project.config[:target]}.exs" +import_config "hardware/#{Mix.Project.config[:target]}/hardware.exs" diff --git a/config/test.exs b/apps/os/config/test.exs similarity index 100% rename from config/test.exs rename to apps/os/config/test.exs diff --git a/coveralls.json b/apps/os/coveralls.json similarity index 100% rename from coveralls.json rename to apps/os/coveralls.json diff --git a/lib/extras/.gitignore b/apps/os/lib/extras/.gitignore similarity index 100% rename from lib/extras/.gitignore rename to apps/os/lib/extras/.gitignore diff --git a/lib/extras/downloader.ex b/apps/os/lib/extras/downloader.ex similarity index 100% rename from lib/extras/downloader.ex rename to apps/os/lib/extras/downloader.ex diff --git a/lib/extras/easter_eggs.ex b/apps/os/lib/extras/easter_eggs.ex similarity index 100% rename from lib/extras/easter_eggs.ex rename to apps/os/lib/extras/easter_eggs.ex diff --git a/lib/extras/ssh.ex b/apps/os/lib/extras/ssh.ex similarity index 100% rename from lib/extras/ssh.ex rename to apps/os/lib/extras/ssh.ex diff --git a/lib/farmbot/bot_state/bot_state.ex b/apps/os/lib/farmbot/bot_state/bot_state.ex similarity index 100% rename from lib/farmbot/bot_state/bot_state.ex rename to apps/os/lib/farmbot/bot_state/bot_state.ex diff --git a/lib/farmbot/bot_state/monitor.ex b/apps/os/lib/farmbot/bot_state/monitor.ex similarity index 100% rename from lib/farmbot/bot_state/monitor.ex rename to apps/os/lib/farmbot/bot_state/monitor.ex diff --git a/lib/farmbot/bot_state/state_debugger.ex b/apps/os/lib/farmbot/bot_state/state_debugger.ex similarity index 100% rename from lib/farmbot/bot_state/state_debugger.ex rename to apps/os/lib/farmbot/bot_state/state_debugger.ex diff --git a/lib/farmbot/bot_state/supervisor.ex b/apps/os/lib/farmbot/bot_state/supervisor.ex similarity index 100% rename from lib/farmbot/bot_state/supervisor.ex rename to apps/os/lib/farmbot/bot_state/supervisor.ex diff --git a/lib/farmbot/bot_state/trackers/authorization_tracker.ex b/apps/os/lib/farmbot/bot_state/trackers/authorization_tracker.ex similarity index 100% rename from lib/farmbot/bot_state/trackers/authorization_tracker.ex rename to apps/os/lib/farmbot/bot_state/trackers/authorization_tracker.ex diff --git a/lib/farmbot/bot_state/trackers/configuration_tracker.ex b/apps/os/lib/farmbot/bot_state/trackers/configuration_tracker.ex similarity index 100% rename from lib/farmbot/bot_state/trackers/configuration_tracker.ex rename to apps/os/lib/farmbot/bot_state/trackers/configuration_tracker.ex diff --git a/lib/farmbot/bot_state/trackers/hardware_tracker.ex b/apps/os/lib/farmbot/bot_state/trackers/hardware_tracker.ex similarity index 100% rename from lib/farmbot/bot_state/trackers/hardware_tracker.ex rename to apps/os/lib/farmbot/bot_state/trackers/hardware_tracker.ex diff --git a/lib/farmbot/bot_state/trackers/network_tracker.ex b/apps/os/lib/farmbot/bot_state/trackers/network_tracker.ex similarity index 100% rename from lib/farmbot/bot_state/trackers/network_tracker.ex rename to apps/os/lib/farmbot/bot_state/trackers/network_tracker.ex diff --git a/lib/farmbot/bot_state/trackers/state_tracker.ex b/apps/os/lib/farmbot/bot_state/trackers/state_tracker.ex similarity index 100% rename from lib/farmbot/bot_state/trackers/state_tracker.ex rename to apps/os/lib/farmbot/bot_state/trackers/state_tracker.ex diff --git a/lib/farmbot/command/command.ex b/apps/os/lib/farmbot/command/command.ex similarity index 100% rename from lib/farmbot/command/command.ex rename to apps/os/lib/farmbot/command/command.ex diff --git a/lib/farmbot/database/database.ex b/apps/os/lib/farmbot/database/database.ex similarity index 100% rename from lib/farmbot/database/database.ex rename to apps/os/lib/farmbot/database/database.ex diff --git a/lib/farmbot/database/helpers.ex b/apps/os/lib/farmbot/database/helpers.ex similarity index 100% rename from lib/farmbot/database/helpers.ex rename to apps/os/lib/farmbot/database/helpers.ex diff --git a/lib/farmbot/database/sync_object.ex b/apps/os/lib/farmbot/database/sync_object.ex similarity index 100% rename from lib/farmbot/database/sync_object.ex rename to apps/os/lib/farmbot/database/sync_object.ex diff --git a/lib/farmbot/database/syncable.ex b/apps/os/lib/farmbot/database/syncable.ex similarity index 100% rename from lib/farmbot/database/syncable.ex rename to apps/os/lib/farmbot/database/syncable.ex diff --git a/lib/farmbot/farmbot.ex b/apps/os/lib/farmbot/farmbot.ex similarity index 100% rename from lib/farmbot/farmbot.ex rename to apps/os/lib/farmbot/farmbot.ex diff --git a/lib/farmbot/filesystem/config_storage.ex b/apps/os/lib/farmbot/filesystem/config_storage.ex similarity index 100% rename from lib/farmbot/filesystem/config_storage.ex rename to apps/os/lib/farmbot/filesystem/config_storage.ex diff --git a/lib/farmbot/filesystem/filesystem.ex b/apps/os/lib/farmbot/filesystem/filesystem.ex similarity index 100% rename from lib/farmbot/filesystem/filesystem.ex rename to apps/os/lib/farmbot/filesystem/filesystem.ex diff --git a/lib/farmbot/filesystem/supervisor.ex b/apps/os/lib/farmbot/filesystem/supervisor.ex similarity index 100% rename from lib/farmbot/filesystem/supervisor.ex rename to apps/os/lib/farmbot/filesystem/supervisor.ex diff --git a/lib/farmbot/filesystem/utils.ex b/apps/os/lib/farmbot/filesystem/utils.ex similarity index 100% rename from lib/farmbot/filesystem/utils.ex rename to apps/os/lib/farmbot/filesystem/utils.ex diff --git a/lib/farmbot/http/http.ex b/apps/os/lib/farmbot/http/http.ex similarity index 100% rename from lib/farmbot/http/http.ex rename to apps/os/lib/farmbot/http/http.ex diff --git a/lib/farmbot/jwt.ex b/apps/os/lib/farmbot/jwt.ex similarity index 100% rename from lib/farmbot/jwt.ex rename to apps/os/lib/farmbot/jwt.ex diff --git a/lib/farmbot/logger/logger.ex b/apps/os/lib/farmbot/logger/logger.ex similarity index 100% rename from lib/farmbot/logger/logger.ex rename to apps/os/lib/farmbot/logger/logger.ex diff --git a/lib/farmbot/network/handler_behaviour.ex b/apps/os/lib/farmbot/network/handler_behaviour.ex similarity index 100% rename from lib/farmbot/network/handler_behaviour.ex rename to apps/os/lib/farmbot/network/handler_behaviour.ex diff --git a/lib/farmbot/network/handler_development.ex b/apps/os/lib/farmbot/network/handler_development.ex similarity index 100% rename from lib/farmbot/network/handler_development.ex rename to apps/os/lib/farmbot/network/handler_development.ex diff --git a/lib/farmbot/network/handler_qemu.ex b/apps/os/lib/farmbot/network/handler_qemu.ex similarity index 100% rename from lib/farmbot/network/handler_qemu.ex rename to apps/os/lib/farmbot/network/handler_qemu.ex diff --git a/lib/farmbot/network/handler_rpi3.ex b/apps/os/lib/farmbot/network/handler_rpi3.ex similarity index 100% rename from lib/farmbot/network/handler_rpi3.ex rename to apps/os/lib/farmbot/network/handler_rpi3.ex diff --git a/lib/farmbot/network/hostapd.ex b/apps/os/lib/farmbot/network/hostapd.ex similarity index 100% rename from lib/farmbot/network/hostapd.ex rename to apps/os/lib/farmbot/network/hostapd.ex diff --git a/lib/farmbot/network/network.ex b/apps/os/lib/farmbot/network/network.ex similarity index 100% rename from lib/farmbot/network/network.ex rename to apps/os/lib/farmbot/network/network.ex diff --git a/lib/farmbot/rpc/handler.ex b/apps/os/lib/farmbot/rpc/handler.ex similarity index 100% rename from lib/farmbot/rpc/handler.ex rename to apps/os/lib/farmbot/rpc/handler.ex diff --git a/lib/farmbot/rpc/request.ex b/apps/os/lib/farmbot/rpc/request.ex similarity index 100% rename from lib/farmbot/rpc/request.ex rename to apps/os/lib/farmbot/rpc/request.ex diff --git a/lib/farmbot/rpc/state_serialized.ex b/apps/os/lib/farmbot/rpc/state_serialized.ex similarity index 100% rename from lib/farmbot/rpc/state_serialized.ex rename to apps/os/lib/farmbot/rpc/state_serialized.ex diff --git a/lib/farmbot/rpc/transport/gen_mqtt/gen_mqtt_client.ex b/apps/os/lib/farmbot/rpc/transport/gen_mqtt/gen_mqtt_client.ex similarity index 100% rename from lib/farmbot/rpc/transport/gen_mqtt/gen_mqtt_client.ex rename to apps/os/lib/farmbot/rpc/transport/gen_mqtt/gen_mqtt_client.ex diff --git a/lib/farmbot/rpc/transport/gen_mqtt/gen_mqtt_handler.ex b/apps/os/lib/farmbot/rpc/transport/gen_mqtt/gen_mqtt_handler.ex similarity index 100% rename from lib/farmbot/rpc/transport/gen_mqtt/gen_mqtt_handler.ex rename to apps/os/lib/farmbot/rpc/transport/gen_mqtt/gen_mqtt_handler.ex diff --git a/lib/farmbot/scheduler/regimen/regimen_vm.ex b/apps/os/lib/farmbot/scheduler/regimen/regimen_vm.ex similarity index 100% rename from lib/farmbot/scheduler/regimen/regimen_vm.ex rename to apps/os/lib/farmbot/scheduler/regimen/regimen_vm.ex diff --git a/lib/farmbot/scheduler/scheduler.ex b/apps/os/lib/farmbot/scheduler/scheduler.ex similarity index 100% rename from lib/farmbot/scheduler/scheduler.ex rename to apps/os/lib/farmbot/scheduler/scheduler.ex diff --git a/lib/farmbot/scheduler/sequence/ast_parser.ex b/apps/os/lib/farmbot/scheduler/sequence/ast_parser.ex similarity index 100% rename from lib/farmbot/scheduler/sequence/ast_parser.ex rename to apps/os/lib/farmbot/scheduler/sequence/ast_parser.ex diff --git a/lib/farmbot/scheduler/sequence/sequence_instruction_set_0.ex b/apps/os/lib/farmbot/scheduler/sequence/sequence_instruction_set_0.ex similarity index 100% rename from lib/farmbot/scheduler/sequence/sequence_instruction_set_0.ex rename to apps/os/lib/farmbot/scheduler/sequence/sequence_instruction_set_0.ex diff --git a/lib/farmbot/scheduler/sequence/sequence_manager.ex b/apps/os/lib/farmbot/scheduler/sequence/sequence_manager.ex similarity index 100% rename from lib/farmbot/scheduler/sequence/sequence_manager.ex rename to apps/os/lib/farmbot/scheduler/sequence/sequence_manager.ex diff --git a/lib/farmbot/scheduler/sequence/sequence_vm.ex b/apps/os/lib/farmbot/scheduler/sequence/sequence_vm.ex similarity index 100% rename from lib/farmbot/scheduler/sequence/sequence_vm.ex rename to apps/os/lib/farmbot/scheduler/sequence/sequence_vm.ex diff --git a/lib/farmbot/serial/gcode/handler.ex b/apps/os/lib/farmbot/serial/gcode/handler.ex similarity index 100% rename from lib/farmbot/serial/gcode/handler.ex rename to apps/os/lib/farmbot/serial/gcode/handler.ex diff --git a/lib/farmbot/serial/gcode/parser.ex b/apps/os/lib/farmbot/serial/gcode/parser.ex similarity index 100% rename from lib/farmbot/serial/gcode/parser.ex rename to apps/os/lib/farmbot/serial/gcode/parser.ex diff --git a/lib/farmbot/serial/handler.ex b/apps/os/lib/farmbot/serial/handler.ex similarity index 100% rename from lib/farmbot/serial/handler.ex rename to apps/os/lib/farmbot/serial/handler.ex diff --git a/lib/farmbot/serial/supervisor.ex b/apps/os/lib/farmbot/serial/supervisor.ex similarity index 100% rename from lib/farmbot/serial/supervisor.ex rename to apps/os/lib/farmbot/serial/supervisor.ex diff --git a/lib/farmbot/socket.ex b/apps/os/lib/farmbot/socket.ex similarity index 100% rename from lib/farmbot/socket.ex rename to apps/os/lib/farmbot/socket.ex diff --git a/lib/farmbot/supervisor.ex b/apps/os/lib/farmbot/supervisor.ex similarity index 100% rename from lib/farmbot/supervisor.ex rename to apps/os/lib/farmbot/supervisor.ex diff --git a/lib/farmbot/updates/update_handler.ex b/apps/os/lib/farmbot/updates/update_handler.ex similarity index 100% rename from lib/farmbot/updates/update_handler.ex rename to apps/os/lib/farmbot/updates/update_handler.ex diff --git a/lib/json_rpc/handler.ex b/apps/os/lib/json_rpc/handler.ex similarity index 100% rename from lib/json_rpc/handler.ex rename to apps/os/lib/json_rpc/handler.ex diff --git a/lib/json_rpc/manager.ex b/apps/os/lib/json_rpc/manager.ex similarity index 100% rename from lib/json_rpc/manager.ex rename to apps/os/lib/json_rpc/manager.ex diff --git a/lib/json_rpc/parser.ex b/apps/os/lib/json_rpc/parser.ex similarity index 100% rename from lib/json_rpc/parser.ex rename to apps/os/lib/json_rpc/parser.ex diff --git a/lib/json_rpc/spec.ex b/apps/os/lib/json_rpc/spec.ex similarity index 100% rename from lib/json_rpc/spec.ex rename to apps/os/lib/json_rpc/spec.ex diff --git a/lib/json_rpc/supervisor.ex b/apps/os/lib/json_rpc/supervisor.ex similarity index 100% rename from lib/json_rpc/supervisor.ex rename to apps/os/lib/json_rpc/supervisor.ex diff --git a/apps/os/mix.exs b/apps/os/mix.exs new file mode 100644 index 00000000..fc85259b --- /dev/null +++ b/apps/os/mix.exs @@ -0,0 +1,271 @@ +defmodule Farmbot.Mixfile do + use Mix.Project + + def target(:prod), do: System.get_env("NERVES_TARGET") || "rpi3" + def target(_), do: System.get_env("NERVES_TARGET") || "development" + + @version Path.join(__DIR__, "VERSION") |> File.read! |> String.strip + @compat_version Path.join(__DIR__, "COMPAT") |> File.read! |> String.strip |> String.to_integer + + def project do + [app: :farmbot, + test_coverage: [tool: ExCoveralls], + version: @version, + target: target(Mix.env), + archives: [nerves_bootstrap: "~> 0.2.0"], + # deps_path: "deps/#{target(Mix.env)}", + # build_path: "_build/#{target(Mix.env)}", + build_embedded: Mix.env == :prod, + start_permanent: Mix.env == :prod, + build_path: "../../_build/#{target(Mix.env)}", + deps_path: "../../deps/#{target(Mix.env)}", + config_path: "../../config/config.exs", + lockfile: "../../mix.lock", + aliases: aliases(Mix.env), + deps: deps(Mix.env) ] + end + + def application do + [mod: {Farmbot, [%{target: target(Mix.env), compat_version: @compat_version, + version: @version, env: Mix.env}]}, + applications: apps(Mix.env), + included_applications: [:gen_mqtt]] + end + + # common for test, prod, and dev + def apps do + [:logger, + :nerves_uart, + :nerves_interim_wifi, + :httpotion, + :poison, + :gen_stage, + :nerves_lib, + :rsa, + :runtime_tools, + :mustache, + :timex, + :farmbot_auth, + :farmbot_configurator, + :vmq_commons, + :amnesia, + :quantum] + end + + # on device + def apps(:prod) do + apps ++ platform_apps(target(:prod)) ++ [:nerves, :nerves_firmware_http] + end + + # dev + def apps(:dev), do: apps ++ [:fake_nerves] + + # test + def apps(:test) do + apps ++ [ + :plug, + :cors_plug, + :cowboy, + :faker + ] + end + + def deps do + [ + {:nerves_uart, "~> 0.1.0"}, + {:nerves_interim_wifi, "~> 0.1.0"}, + {:httpotion, "~> 3.0.0"}, + {:poison, "~> 3.0"}, + {:gen_stage, "~> 0.4"}, + {:nerves_lib, github: "nerves-project/nerves_lib"}, + {:gen_mqtt, "~> 0.3.1"}, + {:vmq_commons, "1.0.0", manager: :rebar3}, # This is for mqtt to work. + {:mustache, "~> 0.0.2"}, + {:timex, "~> 3.0"}, + {:amnesia, github: "meh/amnesia"}, + {:quantum, ">= 1.8.1"}, + {:farmbot_configurator, in_umbrella: true}, + {:farmbot_auth, in_umbrella: true} + # {:farmbot_auth, github: "Farmbot/farmbot_auth"}, + # {:farmbot_auth, path: "../farmbot_auth"}, + # {:farmbot_configurator, github: "Farmbot/farmbot_configurator"} + # {:farmbot_configurator, path: "../farmbot_configurator"} + ] + end + + def deps(:prod) do + deps ++ platform_deps(target(Mix.env)) ++ system(target(Mix.env)) ++ + [ + {:nerves, "~> 0.4.0"}, + {:nerves_firmware_http, github: "nerves-project/nerves_firmware_http"} + ] + end + + def deps(:test) do + deps ++ deps(:dev) ++ + [ {:plug, "~> 1.0"}, + {:cors_plug, "~> 1.1"}, + {:cowboy, "~> 1.0.0"}, + {:excoveralls, "~> 0.5"}, + {:faker, "~> 0.7"} ] + end + + def deps(:dev) do + deps ++ [ + {:fake_nerves, github: "ConnorRigby/fake_nerves"}, + # {:fake_nerves, path: "../fake_nerves", override: true}, + {:credo, "~> 0.4"}, + {:dialyxir, "~> 0.4"}] + end + + def platform_deps("rpi3") do + [ + {:nerves_leds, "~> 0.7.0"}, + {:elixir_ale, "~> 0.5.5"} + ] + end + + def platform_deps("qemu"), do: [] + + def platform_apps("rpi3") do + [ :nerves_leds, + :elixir_ale ] + end + + def platform_apps("qemu"), do: [:nerves_system_qemu_arm] + + def aliases(:prod) do + ["deps.precompile": ["nerves.precompile", "deps.precompile"], + "deps.loadpaths": ["deps.loadpaths", "nerves.loadpaths"]] + end + + def aliases(_), do: [] + + def system(sys), do: [{:"nerves_system_#{sys}", in_umbrella: true}] + + # def system("rpi3") do + # [{:"nerves_system_rpi3", path: "/home/connor/farmbot/os/nerves/nerves_system_rpi3"}] + # end + # def system("qemu"), do: [{:nerves_system_qemu_arm, github: "nerves-project/nerves_system_qemu_arm"}] +end + +defmodule Mix.Tasks.Farmbot.Build do + use Mix.Task + @shortdoc "Builds firmware." + + def run(args) do + System.cmd("rm", ["-rf","rel/farmbot"]) + Mix.Tasks.Deps.Get.run(args) + Mix.Tasks.Deps.Compile.run(args) + Mix.Tasks.Firmware.run(args) + end +end + +defmodule Mix.Tasks.Farmbot.Clean do + use Mix.Task + @shortdoc "Cleans environment" + + def run(_args) do + System.cmd("rm", ["-rf","rel/bootstrapper", "_images", "_build"]) + Mix.Tasks.Deps.Clean.run(["--all"]) + end +end + +defmodule Mix.Tasks.Farmbot.Release do + use Mix.Task + @shortdoc "Builds a release ready image." + def run(args) do + IO.puts "CLEANING ENVIRONMENT!" + Mix.Tasks.Farmbot.Clean.run(args) + IO.puts "BUILDING FARMBOT OS!" + Mix.Tasks.Farmbot.Build.run(args) + IO.puts "BUILDING IMAGE FILE!" + System.cmd("fwup", ["-a", + "-d", + "_images/rpi3/farmbot.img", + "-i", + "_images/rpi3/farmbot.img", + "-t", + "complete"]) + end +end + + +defmodule Mix.Tasks.Farmbot.Upload do + use Mix.Task + @shortdoc "Uploads a file to a url" + def run(args) do + ip_address = System.get_env("FARMBOT_IP") + || List.first(args) + || "192.168.29.186" # I get to do this because i own it. + curl_args = [ + "-T", "_images/rpi3/farmbot.fw", + "http://#{ip_address}:8988/firmware", + "-H", "Content-Type: application/x-firmware", + "-H", "X-Reboot: true"] + IO.puts("Starting upload...") + Mix.Tasks.Farmbot.Curl.run(curl_args) + end +end + +defmodule Mix.Tasks.Farmbot.Curl do + use Mix.Task + @shortdoc "Uploads an image to a development target" + def run(args) do + args = args ++ + [ "-#" ] # CURL OPTIONS + Port.open({:spawn_executable, "/usr/bin/curl"}, + [{:args, args}, + :stream, + :binary, + :exit_status, + :hide, + :use_stdio, + :stderr_to_stdout]) + handle_output + end + + def handle_output do + receive do + info -> handle_info(info) + end + end + + def handle_info({port, {:data, << <<35>>, _ :: size(568), " 100.0%">>}}) do # LAWLZ + IO.puts("\nDONE") + Port.close(port) + end + + def handle_info({port, {:data, << "\r", <<35>>, _ :: size(568), " 100.0%">>}}) do # LAWLZ + IO.puts("\nDONE") + Port.close(port) + end + + def handle_info({_port, {:data, << <<35>>, <<_ :: binary>> >>}}) do + IO.write("#") + handle_output + end + + def handle_info({_port, {:data, << "\n", <<35>>, <<_ :: binary>> >>}}) do + IO.write("#") + handle_output + end + + def handle_info({_port, {:data, << "\r", <<35>>, <<_ :: binary>> >>}}) do + IO.write("#") + handle_output + end + + def handle_info({_port, {:data, _data}}) do + # IO.puts(data) + handle_output + end + + def handle_info({_port, {:exit_status, 7}}) do + IO.puts("\nCOULD NOT CONNECT TO DEVICE!") + end + + def handle_info({_port, {:exit_status, _status}}) do + IO.puts("\nDONE") + end +end diff --git a/notes.md b/apps/os/notes.md similarity index 100% rename from notes.md rename to apps/os/notes.md diff --git a/priv/static/default_config_development.json b/apps/os/priv/static/default_config_development.json similarity index 100% rename from priv/static/default_config_development.json rename to apps/os/priv/static/default_config_development.json diff --git a/priv/static/default_config_rpi3.json b/apps/os/priv/static/default_config_rpi3.json similarity index 100% rename from priv/static/default_config_rpi3.json rename to apps/os/priv/static/default_config_rpi3.json diff --git a/priv/static/easter_eggs.json b/apps/os/priv/static/easter_eggs.json similarity index 100% rename from priv/static/easter_eggs.json rename to apps/os/priv/static/easter_eggs.json diff --git a/rel/.gitignore b/apps/os/rel/.gitignore similarity index 100% rename from rel/.gitignore rename to apps/os/rel/.gitignore diff --git a/rel/config.exs b/apps/os/rel/config.exs similarity index 100% rename from rel/config.exs rename to apps/os/rel/config.exs diff --git a/rel/vm.args b/apps/os/rel/vm.args similarity index 100% rename from rel/vm.args rename to apps/os/rel/vm.args diff --git a/test/extras/easter_eggs_test.exs b/apps/os/test/extras/easter_eggs_test.exs similarity index 100% rename from test/extras/easter_eggs_test.exs rename to apps/os/test/extras/easter_eggs_test.exs diff --git a/test/farmbot/bot_state/bot_state_test.exs b/apps/os/test/farmbot/bot_state/bot_state_test.exs similarity index 100% rename from test/farmbot/bot_state/bot_state_test.exs rename to apps/os/test/farmbot/bot_state/bot_state_test.exs diff --git a/test/farmbot/bot_state/monitor_test.exs b/apps/os/test/farmbot/bot_state/monitor_test.exs similarity index 100% rename from test/farmbot/bot_state/monitor_test.exs rename to apps/os/test/farmbot/bot_state/monitor_test.exs diff --git a/test/farmbot/bot_state/trackers/authorization_state_test.exs b/apps/os/test/farmbot/bot_state/trackers/authorization_state_test.exs similarity index 100% rename from test/farmbot/bot_state/trackers/authorization_state_test.exs rename to apps/os/test/farmbot/bot_state/trackers/authorization_state_test.exs diff --git a/test/farmbot/bot_state/trackers/configuration_state_test.exs b/apps/os/test/farmbot/bot_state/trackers/configuration_state_test.exs similarity index 100% rename from test/farmbot/bot_state/trackers/configuration_state_test.exs rename to apps/os/test/farmbot/bot_state/trackers/configuration_state_test.exs diff --git a/test/farmbot/database/database_test.exs b/apps/os/test/farmbot/database/database_test.exs similarity index 100% rename from test/farmbot/database/database_test.exs rename to apps/os/test/farmbot/database/database_test.exs diff --git a/test/farmbot/database/sync_object_test.exs b/apps/os/test/farmbot/database/sync_object_test.exs similarity index 100% rename from test/farmbot/database/sync_object_test.exs rename to apps/os/test/farmbot/database/sync_object_test.exs diff --git a/test/farmbot/database/syncable_test.exs b/apps/os/test/farmbot/database/syncable_test.exs similarity index 100% rename from test/farmbot/database/syncable_test.exs rename to apps/os/test/farmbot/database/syncable_test.exs diff --git a/test/farmbot/jwt_test.exs b/apps/os/test/farmbot/jwt_test.exs similarity index 100% rename from test/farmbot/jwt_test.exs rename to apps/os/test/farmbot/jwt_test.exs diff --git a/test/farmbot/logger/logger_test.exs b/apps/os/test/farmbot/logger/logger_test.exs similarity index 100% rename from test/farmbot/logger/logger_test.exs rename to apps/os/test/farmbot/logger/logger_test.exs diff --git a/test/farmbot/rpc/handler_test.exs b/apps/os/test/farmbot/rpc/handler_test.exs similarity index 100% rename from test/farmbot/rpc/handler_test.exs rename to apps/os/test/farmbot/rpc/handler_test.exs diff --git a/test/farmbot/rpc/request_test.exs b/apps/os/test/farmbot/rpc/request_test.exs similarity index 100% rename from test/farmbot/rpc/request_test.exs rename to apps/os/test/farmbot/rpc/request_test.exs diff --git a/test/farmbot/rpc/state_serialized_test.exs b/apps/os/test/farmbot/rpc/state_serialized_test.exs similarity index 100% rename from test/farmbot/rpc/state_serialized_test.exs rename to apps/os/test/farmbot/rpc/state_serialized_test.exs diff --git a/test/farmbot/scheduler/sequence/ast_parser_test.exs b/apps/os/test/farmbot/scheduler/sequence/ast_parser_test.exs similarity index 100% rename from test/farmbot/scheduler/sequence/ast_parser_test.exs rename to apps/os/test/farmbot/scheduler/sequence/ast_parser_test.exs diff --git a/test/farmbot/scheduler/sequence/sequence_instruction_set_0_test.exs b/apps/os/test/farmbot/scheduler/sequence/sequence_instruction_set_0_test.exs similarity index 100% rename from test/farmbot/scheduler/sequence/sequence_instruction_set_0_test.exs rename to apps/os/test/farmbot/scheduler/sequence/sequence_instruction_set_0_test.exs diff --git a/test/farmbot/serial/gcode_test.exs b/apps/os/test/farmbot/serial/gcode_test.exs similarity index 100% rename from test/farmbot/serial/gcode_test.exs rename to apps/os/test/farmbot/serial/gcode_test.exs diff --git a/test/farmbot/serial/handler_test.exs b/apps/os/test/farmbot/serial/handler_test.exs similarity index 100% rename from test/farmbot/serial/handler_test.exs rename to apps/os/test/farmbot/serial/handler_test.exs diff --git a/test/json_rpc/parser_test.exs b/apps/os/test/json_rpc/parser_test.exs similarity index 100% rename from test/json_rpc/parser_test.exs rename to apps/os/test/json_rpc/parser_test.exs diff --git a/test/json_rpc/spec_test.exs b/apps/os/test/json_rpc/spec_test.exs similarity index 100% rename from test/json_rpc/spec_test.exs rename to apps/os/test/json_rpc/spec_test.exs diff --git a/test/test_helper.exs b/apps/os/test/test_helper.exs similarity index 100% rename from test/test_helper.exs rename to apps/os/test/test_helper.exs diff --git a/utils/qemu/qemu-ifdown.sh b/apps/os/utils/qemu/qemu-ifdown.sh similarity index 100% rename from utils/qemu/qemu-ifdown.sh rename to apps/os/utils/qemu/qemu-ifdown.sh diff --git a/utils/qemu/qemu-ifup.sh b/apps/os/utils/qemu/qemu-ifup.sh similarity index 100% rename from utils/qemu/qemu-ifup.sh rename to apps/os/utils/qemu/qemu-ifup.sh diff --git a/utils/qemu/qemu.sh b/apps/os/utils/qemu/qemu.sh similarity index 100% rename from utils/qemu/qemu.sh rename to apps/os/utils/qemu/qemu.sh diff --git a/config/config.exs b/config/config.exs index aba88d4f..82029c25 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,21 +1,2 @@ use Mix.Config -import_config "#{Mix.env}.exs" - -config :farmbot_auth, - callbacks: [Farmbot.RPC.Transport.GenMqtt.Handler] - -config :json_rpc, - transport: Farmbot.RPC.Transport.GenMqtt.Handler, - handler: Farmbot.RPC.Handler - -config :uart, - baud: 115200 - -config :logger, - utc_logs: true - -config :quantum, cron: [ - "5 1 * * *": {Farmbot.Updates.Handler, :do_update_check} -] - -config :farmbot, config_file: "default_config_#{Mix.Project.config[:target]}.json" +import_config "../apps/*/config/config.exs" diff --git a/config/dev.exs b/config/dev.exs deleted file mode 100644 index 5bdd05a0..00000000 --- a/config/dev.exs +++ /dev/null @@ -1,3 +0,0 @@ -use Mix.Config -config :farmbot, state_path: "/tmp" -import_config "hardware_#{Mix.Project.config[:target]}.exs" diff --git a/mix.exs b/mix.exs index 0d545f8e..c0cef5c6 100644 --- a/mix.exs +++ b/mix.exs @@ -1,272 +1,18 @@ -defmodule Farmbot.Mixfile do +defmodule FarmbotOs.Mixfile do use Mix.Project - def target(:prod), do: System.get_env("NERVES_TARGET") || "rpi3" - def target(_), do: System.get_env("NERVES_TARGET") || "development" - - @version Path.join(__DIR__, "VERSION") |> File.read! |> String.strip - @compat_version Path.join(__DIR__, "COMPAT") |> File.read! |> String.strip |> String.to_integer - def project do - [app: :farmbot, - test_coverage: [tool: ExCoveralls], - version: @version, + [apps_path: "apps", target: target(Mix.env), - archives: [nerves_bootstrap: "~> 0.2.0"], - deps_path: "deps/#{target(Mix.env)}", - build_path: "_build/#{target(Mix.env)}", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, - config_path: "config/config.exs", - aliases: aliases(Mix.env), - deps: deps(Mix.env) ] + deps: deps] end - def application do - [mod: {Farmbot, [%{target: target(Mix.env), compat_version: @compat_version, - version: @version, env: Mix.env}]}, - applications: apps(Mix.env), - included_applications: [:gen_mqtt]] - end + # Dependencies listed here are available only for this project + # and cannot be accessed from applications inside the apps folder + defp deps, do: [] - # common for test, prod, and dev - def apps do - [:logger, - :nerves_uart, - :nerves_interim_wifi, - :httpotion, - :poison, - :gen_stage, - :nerves_lib, - :rsa, - :runtime_tools, - :mustache, - :timex, - :farmbot_auth, - :farmbot_configurator, - :vmq_commons, - :amnesia, - :quantum] - end - - # on device - def apps(:prod) do - apps ++ platform_apps(target(:prod)) ++ [:nerves, :nerves_firmware_http] - end - - # dev - def apps(:dev), do: apps ++ [:fake_nerves] - - # test - def apps(:test) do - apps ++ [ - :plug, - :cors_plug, - :cowboy, - :faker - ] - end - - def deps do - [ - {:nerves_uart, "~> 0.1.0"}, - {:nerves_interim_wifi, "~> 0.1.0"}, - {:httpotion, "~> 3.0.0"}, - {:poison, "~> 3.0", override: true}, - {:gen_stage, "~> 0.4"}, - {:nerves_lib, github: "nerves-project/nerves_lib"}, - {:gen_mqtt, "~> 0.3.1"}, - {:vmq_commons, "1.0.0", manager: :rebar3}, # This is for mqtt to work. - {:mustache, "~> 0.0.2"}, - {:timex, "~> 3.0"}, - {:socket, github: "meh/elixir-socket"}, - {:amnesia, github: "meh/amnesia"}, - {:quantum, ">= 1.8.1"}, - # {:farmbot_auth, github: "Farmbot/farmbot_auth"}, - {:farmbot_auth, path: "../farmbot_auth"}, - # {:farmbot_configurator, github: "Farmbot/farmbot_configurator"} - {:farmbot_configurator, path: "../farmbot_configurator"} - ] - end - - def deps(:prod) do - deps ++ platform_deps(target(Mix.env)) ++ system(target(Mix.env)) ++ - [ - {:nerves, github: "nerves-project/nerves", override: true}, - {:nerves_firmware_http, github: "nerves-project/nerves_firmware_http"} - ] - end - - def deps(:test) do - deps ++ deps(:dev) ++ - [ {:plug, "~> 1.0"}, - {:cors_plug, "~> 1.1"}, - {:cowboy, "~> 1.0.0"}, - {:excoveralls, "~> 0.5"}, - {:faker, "~> 0.7"} ] - end - - def deps(:dev) do - deps ++ [ - {:fake_nerves, github: "ConnorRigby/fake_nerves"}, - # {:fake_nerves, path: "../fake_nerves", override: true}, - {:credo, "~> 0.4"}, - {:dialyxir, "~> 0.4"}] - end - - def platform_deps("rpi3") do - [ - {:nerves_leds, "~> 0.7.0"}, - {:elixir_ale, "~> 0.5.5"} - ] - end - - def platform_deps("qemu"), do: [] - - def platform_apps("rpi3") do - [ :nerves_leds, - :elixir_ale ] - end - - def platform_apps("qemu"), do: [:nerves_system_qemu_arm] - - def aliases(:prod) do - ["deps.precompile": ["nerves.precompile", "deps.precompile"], - "deps.loadpaths": ["deps.loadpaths", "nerves.loadpaths"]] - end - - def aliases(_), do: [] - - # # FIXME - # def system("rpi3") do - # [{:"nerves_system_rpi3", - # git: "https://github.com/ConnorRigby/nerves_system_rpi3.git", - # tag: "v0.7.5" }] - # end - - def system("rpi3") do - [{:"nerves_system_rpi3", path: "/home/connor/farmbot/os/nerves/nerves_system_rpi3"}] - end - def system("qemu"), do: [{:nerves_system_qemu_arm, github: "nerves-project/nerves_system_qemu_arm"}] -end - -defmodule Mix.Tasks.Farmbot.Build do - use Mix.Task - @shortdoc "Builds firmware." - - def run(args) do - System.cmd("rm", ["-rf","rel/farmbot"]) - Mix.Tasks.Deps.Get.run(args) - Mix.Tasks.Deps.Compile.run(args) - Mix.Tasks.Firmware.run(args) - end -end - -defmodule Mix.Tasks.Farmbot.Clean do - use Mix.Task - @shortdoc "Cleans environment" - - def run(_args) do - System.cmd("rm", ["-rf","rel/bootstrapper", "_images", "_build"]) - Mix.Tasks.Deps.Clean.run(["--all"]) - end -end - -defmodule Mix.Tasks.Farmbot.Release do - use Mix.Task - @shortdoc "Builds a release ready image." - def run(args) do - IO.puts "CLEANING ENVIRONMENT!" - Mix.Tasks.Farmbot.Clean.run(args) - IO.puts "BUILDING FARMBOT OS!" - Mix.Tasks.Farmbot.Build.run(args) - IO.puts "BUILDING IMAGE FILE!" - System.cmd("fwup", ["-a", - "-d", - "_images/rpi3/farmbot.img", - "-i", - "_images/rpi3/farmbot.img", - "-t", - "complete"]) - end -end - - -defmodule Mix.Tasks.Farmbot.Upload do - use Mix.Task - @shortdoc "Uploads a file to a url" - def run(args) do - ip_address = System.get_env("FARMBOT_IP") - || List.first(args) - || "192.168.29.186" # I get to do this because i own it. - curl_args = [ - "-T", "_images/rpi3/farmbot.fw", - "http://#{ip_address}:8988/firmware", - "-H", "Content-Type: application/x-firmware", - "-H", "X-Reboot: true"] - IO.puts("Starting upload...") - Mix.Tasks.Farmbot.Curl.run(curl_args) - end -end - -defmodule Mix.Tasks.Farmbot.Curl do - use Mix.Task - @shortdoc "Uploads an image to a development target" - def run(args) do - args = args ++ - [ "-#" ] # CURL OPTIONS - Port.open({:spawn_executable, "/usr/bin/curl"}, - [{:args, args}, - :stream, - :binary, - :exit_status, - :hide, - :use_stdio, - :stderr_to_stdout]) - handle_output - end - - def handle_output do - receive do - info -> handle_info(info) - end - end - - def handle_info({port, {:data, << <<35>>, _ :: size(568), " 100.0%">>}}) do # LAWLZ - IO.puts("\nDONE") - Port.close(port) - end - - def handle_info({port, {:data, << "\r", <<35>>, _ :: size(568), " 100.0%">>}}) do # LAWLZ - IO.puts("\nDONE") - Port.close(port) - end - - def handle_info({_port, {:data, << <<35>>, <<_ :: binary>> >>}}) do - IO.write("#") - handle_output - end - - def handle_info({_port, {:data, << "\n", <<35>>, <<_ :: binary>> >>}}) do - IO.write("#") - handle_output - end - - def handle_info({_port, {:data, << "\r", <<35>>, <<_ :: binary>> >>}}) do - IO.write("#") - handle_output - end - - def handle_info({_port, {:data, _data}}) do - # IO.puts(data) - handle_output - end - - def handle_info({_port, {:exit_status, 7}}) do - IO.puts("\nCOULD NOT CONNECT TO DEVICE!") - end - - def handle_info({_port, {:exit_status, _status}}) do - IO.puts("\nDONE") - end + defp target(:prod), do: System.get_env("NERVES_TARGET") || "rpi3" + defp target(_), do: System.get_env("NERVES_TARGET") || "development" end diff --git a/mix.lock b/mix.lock index 4f972b1a..4559359f 100644 --- a/mix.lock +++ b/mix.lock @@ -1,72 +1,52 @@ %{"amnesia": {:git, "https://github.com/meh/amnesia.git", "211d98275c085a9e3049ccb8db8d29f76b3ffbfc", []}, - "bbmustache": {:hex, :bbmustache, "1.0.4", "7ba94f971c5afd7b6617918a4bb74705e36cab36eb84b19b6a1b7ee06427aa38", [:rebar], []}, "bunt": {:hex, :bunt, "0.1.6", "5d95a6882f73f3b9969fdfd1953798046664e6f77ec4e486e6fafc7caad97c6f", [:mix], []}, "calendar": {:hex, :calendar, "0.16.1", "782327ad8bae7c797b887840dc4ddb933f05ce6e333e5b04964d7a5d5f79bde3", [:mix], [{:tzdata, "~> 0.5.8 or ~> 0.1.201603", [hex: :tzdata, optional: false]}]}, "certifi": {:hex, :certifi, "0.7.0", "861a57f3808f7eb0c2d1802afeaae0fa5de813b0df0979153cbafcd853ababaf", [:rebar3], []}, - "cf": {:hex, :cf, "0.2.1", "69d0b1349fd4d7d4dc55b7f407d29d7a840bf9a1ef5af529f1ebe0ce153fc2ab", [:rebar3], []}, - "combine": {:hex, :combine, "0.9.2", "cd3c8721f378ebe032487d8a4fa2ced3181a456a3c21b16464da8c46904bb552", [:mix], []}, + "combine": {:hex, :combine, "0.9.3", "192e609b48b3f2210494e26f85db1712657be1a8f15795656710317ea43fc449", [:mix], []}, "cors_plug": {:hex, :cors_plug, "1.1.2", "3e7451286996f745c7b629c39d24a6493e59b0c8191f27e67f6ab097f96ffd23", [:mix], [{:cowboy, "~> 1.0.0", [hex: :cowboy, optional: false]}, {:plug, "> 0.8.0", [hex: :plug, optional: false]}]}, - "coverex": {:hex, :coverex, "1.4.10", "f6b68f95b3d51d04571a09dd2071c980e8398a38cf663db22b903ecad1083d51", [:mix], [{:httpoison, "~> 0.9", [hex: :httpoison, optional: false]}, {:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: false]}]}, "cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:make, :rebar], [{:cowlib, "~> 1.0.0", [hex: :cowlib, optional: false]}, {:ranch, "~> 1.0", [hex: :ranch, optional: false]}]}, "cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []}, - "credo": {:hex, :credo, "0.5.2", "92e8c9f86e0ffbf9f688595e9f4e936bc96a52e5606d2c19713e9e4d191d5c74", [:mix], [{:bunt, "~> 0.1.6", [hex: :bunt, optional: false]}]}, - "dialyxir": {:hex, :dialyxir, "0.4.0", "53ac3014bb4aef647728a697052b4db3a84c6742de7aab0e0a1c863ea274007b", [:mix], []}, + "credo": {:hex, :credo, "0.5.3", "0c405b36e7651245a8ed63c09e2d52c2e2b89b6d02b1570c4d611e0fcbecf4a2", [:mix], [{:bunt, "~> 0.1.6", [hex: :bunt, optional: false]}]}, + "dialyxir": {:hex, :dialyxir, "0.4.1", "236056d6acd25f740f336756c0f3b5dd6e2f0156074bc15f3b779aeee15390c8", [:mix], []}, "distillery": {:hex, :distillery, "1.0.0", "a866a72bf2a3a5f078f5a249017ed951acda88a760d200512f91f585d74db1ec", [:mix], []}, "elixir_ale": {:hex, :elixir_ale, "0.5.6", "a94c89a17ec39ad4c4a9a90d4f00bd9f33b2f2e98703317fbdf5efceab276b44", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}]}, "elixir_make": {:hex, :elixir_make, "0.4.0", "992f38fabe705bb45821a728f20914c554b276838433349d4f2341f7a687cddf", [:mix], []}, - "erlware_commons": {:hex, :erlware_commons, "0.21.0", "a04433071ad7d112edefc75ac77719dd3e6753e697ac09428fc83d7564b80b15", [:rebar3], [{:cf, "0.2.1", [hex: :cf, optional: false]}]}, "excoveralls": {:hex, :excoveralls, "0.5.7", "5d26e4a7cdf08294217594a1b0643636accc2ad30e984d62f1d166f70629ff50", [:mix], [{:exjsx, "~> 3.0", [hex: :exjsx, optional: false]}, {:hackney, ">= 0.12.0", [hex: :hackney, optional: false]}]}, "exjsx": {:hex, :exjsx, "3.2.1", "1bc5bf1e4fd249104178f0885030bcd75a4526f4d2a1e976f4b428d347614f0f", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, optional: false]}]}, "exquisite": {:hex, :exquisite, "0.1.7", "4106503e976f409246731b168cd76eb54262bd04f4facc5cba82c2f53982aaf0", [:mix], []}, - "exrm": {:hex, :exrm, "1.0.8", "5aa8990cdfe300282828b02cefdc339e235f7916388ce99f9a1f926a9271a45d", [:mix], [{:relx, "~> 3.5", [hex: :relx, optional: false]}]}, "fake_nerves": {:git, "https://github.com/ConnorRigby/fake_nerves.git", "fad032a71e624ebeb06ecb5089c61583f8e111e0", []}, "faker": {:hex, :faker, "0.7.0", "2c42deeac7be717173c78c77fb3edc749fb5d5e460e33d01fe592ae99acc2f0d", [:mix], []}, - "farmbot_auth": {:git, "https://github.com/Farmbot/farmbot_auth.git", "909ff852ff0d40122e3e02c4b8a35769598f151b", []}, - "farmbot_configurator": {:git, "https://github.com/Farmbot/farmbot_configurator.git", "e3b2ddb498123029ad14306e9d9e525200ab7c2f", []}, "gen_mqtt": {:hex, :gen_mqtt, "0.3.1", "6ce6af7c2bcb125d5b4125c67c5ab1f29bcec2638236509bcc6abf510a6661ed", [:mix], [{:vmq_commons, "1.0.0", [hex: :vmq_commons, optional: false]}]}, - "gen_stage": {:hex, :gen_stage, "0.8.0", "a76e3f0530f86fae8b8a1021c06527b1ec171cf4c0bdfecd8d5ad0376d1205af", [:mix], []}, - "getopt": {:hex, :getopt, "0.8.2", "b17556db683000ba50370b16c0619df1337e7af7ecbf7d64fbf8d1d6bce3109b", [:rebar], []}, - "gettext": {:hex, :gettext, "0.12.1", "c0624f52763469ef7a3674919ae28b8286d88195b90fa1516180f31bbbd26d14", [:mix], []}, + "gen_stage": {:hex, :gen_stage, "0.10.0", "ce1eb93a3f9708f2e215f70b3d3c7f55dea4a4ed7e9615195e28d543c9086656", [:mix], []}, + "gettext": {:hex, :gettext, "0.13.0", "daafbddc5cda12738bb93b01d84105fe75b916a302f1c50ab9fb066b95ec9db4", [:mix], []}, "hackney": {:hex, :hackney, "1.6.3", "d489d7ca2d4323e307bedc4bfe684323a7bf773ecfd77938f3ee8074e488e140", [:mix, :rebar3], [{:certifi, "0.7.0", [hex: :certifi, optional: false]}, {:idna, "1.2.0", [hex: :idna, optional: false]}, {:metrics, "1.0.1", [hex: :metrics, optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, optional: false]}]}, - "httpoison": {:hex, :httpoison, "0.10.0", "4727b3a5e57e9a4ff168a3c2883e20f1208103a41bccc4754f15a9366f49b676", [:mix], [{:hackney, "~> 1.6.3", [hex: :hackney, optional: false]}]}, "httpotion": {:hex, :httpotion, "3.0.2", "525b9bfeb592c914a61a8ee31fdde3871e1861dfe805f8ee5f711f9f11a93483", [:mix], [{:ibrowse, "~> 4.2", [hex: :ibrowse, optional: false]}]}, - "hulaaki": {:git, "https://github.com/ConnorRigby/hulaaki.git", "47b77e8673ce522f9475e0c2e29f97648ce8598c", []}, "ibrowse": {:hex, :ibrowse, "4.2.2", "b32b5bafcc77b7277eff030ed32e1acc3f610c64e9f6aea19822abcadf681b4b", [:rebar3], []}, "idna": {:hex, :idna, "1.2.0", "ac62ee99da068f43c50dc69acf700e03a62a348360126260e87f2b54eced86b2", [:rebar3], []}, - "jsx": {:hex, :jsx, "2.8.0", "749bec6d205c694ae1786d62cea6cc45a390437e24835fd16d12d74f07097727", [:mix, :rebar], []}, + "jsx": {:hex, :jsx, "2.8.1", "1453b4eb3615acb3e2cd0a105d27e6761e2ed2e501ac0b390f5bbec497669846", [:mix, :rebar3], []}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], []}, "mime": {:hex, :mime, "1.0.1", "05c393850524767d13a53627df71beeebb016205eb43bfbd92d14d24ec7a1b51", [:mix], []}, "mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], []}, "mustache": {:hex, :mustache, "0.0.2", "870fbef411c47d17df06a57b8b3f69e26eb110cba0177c34e273db5d94369d9b", [:mix], []}, - "nerves": {:git, "https://github.com/nerves-project/nerves.git", "d9fb027655d99e0fdc75c7402ab7a320c41ec0e5", []}, + "nerves": {:hex, :nerves, "0.4.2", "b3babf7351b8c2f8ec0be0ea8fd5598c9208c3477128fd9fafb3a49e75d91dc8", [:mix], [{:distillery, "~> 1.0.0", [hex: :distillery, optional: false]}]}, "nerves_firmware": {:git, "https://github.com/nerves-project/nerves_firmware.git", "241a12694bd3bc2b4df8cbb7e0f0beaeff075b1c", []}, "nerves_firmware_http": {:git, "https://github.com/nerves-project/nerves_firmware_http.git", "cc2cb110b0587a482d454175916dc597d62c4bfa", []}, "nerves_interim_wifi": {:hex, :nerves_interim_wifi, "0.1.0", "f572381722a06f1cbc118708baecd1b12ce00edb684d88258aa417112f32489a", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}, {:nerves_network_interface, "~> 0.3.1", [hex: :nerves_network_interface, optional: false]}, {:nerves_wpa_supplicant, "~> 0.2.2", [hex: :nerves_wpa_supplicant, optional: false]}]}, "nerves_leds": {:hex, :nerves_leds, "0.7.0", "1d0f6587a9ac27c3ad3767a4dd84098e21e48fa3dc5526d5e11ddde48212e186", [:mix], []}, "nerves_lib": {:git, "https://github.com/nerves-project/nerves_lib.git", "78b9e489af7df25c162d4a1130569e7cc301cb48", []}, "nerves_network_interface": {:hex, :nerves_network_interface, "0.3.2", "e7450f7eccd7387ceebee6096a0646bcdc0dd4aa77077e5fa81f6767da9b77af", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}]}, - "nerves_networking": {:git, "https://github.com/nerves-project/nerves_networking.git", "e4398e6be3b02f912f96dec6e13f0ec36d6d1a31", []}, - "nerves_system": {:hex, :nerves_system, "0.1.6", "d3cff2ae40d3764c75b187cbbdb09985ae169489c26178d765edc9b66bc4e355", [:mix], []}, "nerves_system_br": {:hex, :nerves_system_br, "0.8.1", "86889f97719eae6ec243ba0b8f445a25cabc0463d2e9606293cb4033f2c6b9e4", [:mix], []}, - "nerves_system_qemu_arm": {:git, "https://github.com/nerves-project/nerves_system_qemu_arm.git", "7734c534e3828e84ea9ac457bfefa641d4783a81", []}, - "nerves_system_rpi3": {:git, "https://github.com/ConnorRigby/nerves_system_rpi3.git", "16263b3f439adbb32cc79136611652dafefb6225", [tag: "v0.7.5"]}, - "nerves_toolchain": {:hex, :nerves_toolchain, "0.7.1", "164f5fcf07f717d5e8f918965ea043c860b75065768c93a726f763498a7d8792", [:mix], []}, "nerves_toolchain_arm_unknown_linux_gnueabihf": {:hex, :nerves_toolchain_arm_unknown_linux_gnueabihf, "0.8.0", "873f8d6f74413c14eda3462b397a88f043a6c3bd65f56ff57db4e2e1eaf48994", [:mix], [{:nerves, "~> 0.4.0", [hex: :nerves, optional: false]}, {:nerves_toolchain_ctng, "~> 0.8.0", [hex: :nerves_toolchain_ctng, optional: false]}]}, "nerves_toolchain_ctng": {:hex, :nerves_toolchain_ctng, "0.8.0", "6dff7ed51e1711c5f4da3d559bc528a8265e3dd950dda95f4d6832aed9dbe320", [:mix], []}, "nerves_uart": {:hex, :nerves_uart, "0.1.1", "32e6186b1a1b1d744631126df0b6c4049ddde5b04bc0303de29ab86a2edf60a2", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}]}, "nerves_wpa_supplicant": {:hex, :nerves_wpa_supplicant, "0.2.2", "da829baec94a8afa7da3a6beaaf1725b9ca7f5f58779ba50b73568b7d37d3d98", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}]}, - "plug": {:hex, :plug, "1.2.2", "cfbda521b54c92ab8ddffb173fbaabed8d8fc94bec07cd9bb58a84c1c501b0bd", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:mime, "~> 1.0", [hex: :mime, optional: false]}]}, + "plug": {:hex, :plug, "1.3.0", "6e2b01afc5db3fd011ca4a16efd9cb424528c157c30a44a0186bcc92c7b2e8f3", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1", [hex: :cowboy, optional: true]}, {:mime, "~> 1.0", [hex: :mime, optional: false]}]}, "poison": {:hex, :poison, "3.0.0", "625ebd64d33ae2e65201c2c14d6c85c27cc8b68f2d0dd37828fde9c6920dd131", [:mix], []}, - "porcelain": {:hex, :porcelain, "2.0.3", "2d77b17d1f21fed875b8c5ecba72a01533db2013bd2e5e62c6d286c029150fdc", [:mix], []}, - "providers": {:hex, :providers, "1.6.0", "db0e2f9043ae60c0155205fcd238d68516331d0e5146155e33d1e79dc452964a", [:rebar3], [{:getopt, "0.8.2", [hex: :getopt, optional: false]}]}, "quantum": {:hex, :quantum, "1.8.1", "37c9ad0307cf47bd578507ce1ddda98746199b281e8afe91cbe44c21d56af983", [:mix], [{:calendar, "~> 0.16", [hex: :calendar, optional: false]}]}, "ranch": {:hex, :ranch, "1.2.1", "a6fb992c10f2187b46ffd17ce398ddf8a54f691b81768f9ef5f461ea7e28c762", [:make], []}, - "relx": {:hex, :relx, "3.21.1", "f989dc520730efd9075e9f4debcb8ba1d7d1e86b018b0bcf45a2eb80270b4ad6", [:rebar3], [{:bbmustache, "1.0.4", [hex: :bbmustache, optional: false]}, {:cf, "0.2.1", [hex: :cf, optional: false]}, {:erlware_commons, "0.21.0", [hex: :erlware_commons, optional: false]}, {:getopt, "0.8.2", [hex: :getopt, optional: false]}, {:providers, "1.6.0", [hex: :providers, optional: false]}]}, "rsa": {:hex, :rsa, "0.0.1", "a63069f88ce342ffdf8448b7cdef4b39ba7dee3c1510644a39385c7e63ba246f", [:mix], []}, - "socket": {:git, "https://github.com/meh/elixir-socket.git", "10f8daa6cf90c18e3b2da8f8a37cc8275f86e630", []}, + "socket": {:git, "https://github.com/meh/elixir-socket.git", "cfcc976745687979551bc15fd6e5a63ef08a3c07", []}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], []}, - "timex": {:hex, :timex, "3.1.3", "3f9e7cd03190faf143098857bebd26c6d33e0709e7d3c42095da2393765fa225", [:mix], [{:combine, "~> 0.7", [hex: :combine, optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, optional: false]}]}, + "timex": {:hex, :timex, "3.1.5", "413d6d8d6f0162a5d47080cb8ca520d790184ac43e097c95191c7563bf25b428", [:mix], [{:combine, "~> 0.7", [hex: :combine, optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, optional: false]}]}, "tzdata": {:hex, :tzdata, "0.5.9", "575be217b039057a47e133b72838cbe104fb5329b19906ea4e66857001c37edb", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, optional: false]}]}, - "vmq_commons": {:hex, :vmq_commons, "1.0.0", "5f5005c12db33f92f40e818a3617fb148972d59adcf99298c9d3808ef3582e34", [:rebar3], []}, - "web_socket": {:git, "https://github.com/slogsdon/plug-web-socket.git", "eecf9d81864f9c20c62c822e0058f8bf75643ef1", []}, - "websocket": {:git, "https://github.com/slogsdon/plug-web-socket.git", "eecf9d81864f9c20c62c822e0058f8bf75643ef1", []}} + "vmq_commons": {:hex, :vmq_commons, "1.0.0", "5f5005c12db33f92f40e818a3617fb148972d59adcf99298c9d3808ef3582e34", [:rebar3], []}}