Packages
nerves_system_rpi0
2.0.4
2.1.0
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
2.0.0-rc.3
2.0.0-rc.2
2.0.0-rc.1
retired
2.0.0-rc.0
retired
1.33.1
1.33.0
1.32.0
1.31.4
1.31.3
1.31.2
1.31.1
1.31.0
1.30.1
1.30.0
1.29.1
1.29.0
1.28.1
1.28.0
1.27.1
1.27.0
1.26.0
1.25.1
1.25.0
1.24.1
1.24.0
1.23.2
1.23.1
1.23.0
1.22.2
1.22.1
1.22.0
1.21.2
1.21.1
1.21.0
1.20.2
1.20.1
1.20.0
1.19.0
1.18.4
1.18.3
1.18.2
1.18.1
1.18.0
1.17.3
1.17.2
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.15.1
1.15.0
1.14.1
1.14.0
1.13.3
1.13.2
1.13.1
retired
1.13.0
1.12.2
1.12.1
1.12.0
1.11.2
1.11.1
1.11.0
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.2
1.7.1
1.7.0
1.6.3
1.6.2
1.6.1
1.6.0
1.5.1
1.5.0
1.4.0
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
1.0.0
1.0.0-rc.1
1.0.0-rc.0
0.21.0
0.19.2
0.19.1
0.19.0
retired
0.18.2
0.18.1
0.18.0
0.17.1
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
Nerves System - Raspberry Pi Zero and Zero W
Current section
Files
Jump to
Current section
Files
nerves_system_rpi0
mix.exs
mix.exs
defmodule NervesSystemRpi0.MixProject do
use Mix.Project
@github_organization "nerves-project"
@app :nerves_system_rpi0
@source_url "https://github.com/#{@github_organization}/#{@app}"
@version Path.join(__DIR__, "VERSION")
|> File.read!()
|> String.trim()
def project do
[
app: @app,
version: @version,
# Because we're using OTP 27, we need to enforce Elixir 1.17 or later.
elixir: "~> 1.17",
compilers: Mix.compilers() ++ [:nerves_package],
nerves_package: nerves_package(),
description: description(),
package: package(),
deps: deps(),
aliases: [
loadconfig: [&bootstrap/1],
generate_fwup_conf: &generate_fwup_conf/1
],
docs: docs()
]
end
def application do
[]
end
defp bootstrap(args) do
set_target()
Application.start(:nerves_bootstrap)
Mix.Task.run("loadconfig", args)
end
def cli do
[preferred_envs: %{docs: :docs, "hex.build": :docs, "hex.publish": :docs}]
end
defp nerves_package do
[
type: :system,
artifact_sites: [
{:github_releases, "#{@github_organization}/#{@app}"}
],
build_runner_opts: build_runner_opts(),
platform: Nerves.System.BR,
platform_config: [
defconfig: "nerves_defconfig"
],
# The :env key is an optional experimental feature for adding environment
# variables to the crosscompile environment. These are intended for
# llvm-based tooling that may need more precise processor information.
env: [
{"TARGET_ARCH", "arm"},
{"TARGET_CPU", "arm1176jzf_s"},
{"TARGET_OS", "linux"},
{"TARGET_ABI", "gnueabihf"},
{"TARGET_GCC_FLAGS",
"-mabi=aapcs-linux -mfpu=vfp -marm -fstack-protector-strong -mfloat-abi=hard -mcpu=arm1176jzf-s -fPIE -pie -Wl,-z,now -Wl,-z,relro"}
],
checksum: package_files()
]
end
defp deps do
[
{:nerves, "~> 1.11", runtime: false},
{:nerves_system_br, "1.33.9", runtime: false},
{:nerves_toolchain_armv6_nerves_linux_gnueabihf, "~> 13.2.0", runtime: false},
{:nerves_system_linter, "~> 0.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.22", only: :docs, runtime: false}
]
end
defp description do
"""
Nerves System - Raspberry Pi Zero and Zero W
"""
end
defp docs do
[
extras: ["README.md", "CHANGELOG.md"],
main: "readme",
assets: %{"assets" => "./assets"},
source_ref: "v#{@version}",
source_url: @source_url,
skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
]
end
defp package do
[
files: package_files(),
licenses: ["GPL-2.0-only", "GPL-2.0-or-later"],
links: %{
"GitHub" => @source_url,
"REUSE Compliance" =>
"https://api.reuse.software/info/github.com/nerves-project/nerves_system_rpi0"
}
]
end
defp package_files do
[
"fwup_include",
"rootfs_overlay",
"CHANGELOG.md",
"cmdline-a.txt",
"cmdline-b.txt",
"config.txt",
"fwup-ops.conf",
"fwup.conf.eex",
"fwup.conf",
"LICENSES/*",
"linux-6.12.defconfig",
"mix.exs",
"nerves_defconfig",
"post-build.sh",
"post-createfs.sh",
"ramoops-overlay.dts",
"README.md",
"REUSE.toml",
"VERSION"
]
end
defp build_runner_opts() do
# Download source files first to get download errors right away.
[make_args: primary_site() ++ ["source", "all", "legal-info"]]
end
defp primary_site() do
case System.get_env("BR2_PRIMARY_SITE") do
nil -> []
primary_site -> ["BR2_PRIMARY_SITE=#{primary_site}"]
end
end
defp set_target() do
if function_exported?(Mix, :target, 1) do
apply(Mix, :target, [:target])
else
System.put_env("MIX_TARGET", "target")
end
end
defp generate_fwup_conf(_args) do
template_path = Path.join(__DIR__, "fwup.conf.eex")
output_path = Path.join(__DIR__, "fwup.conf")
Mix.shell().info("Generating fwup.conf")
content = EEx.eval_file(template_path)
File.write!(output_path, content)
Mix.shell().info("Successfully generated #{output_path}")
end
end