Generates a per-build Buildroot defconfig that layers nbpr-specific settings on top of the active Nerves system's defconfig.
Layered on top in order:
- The system's defconfig verbatim (e.g.
nerves_system_rpi4/nerves_defconfig). BR2_PER_PACKAGE_DIRECTORIES=yso per-package builds don't contend.BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=yso packages overlapping busybox applets (e.g. kmod's tools) aren't dropped as unmet dependencies.BR2_PRIMARY_SITEpointing at Buildroot's source archive — see below.BR2_PACKAGE_<UPPER_BR_NAME>=yto enable the target package.- One line per resolved
build_optwhose schema declared a:br_flagextension, formatted as<br_flag>=<value>with BR-style boolean, string, and integer encoding.
The result is a defconfig file ready to be loaded with make defconfig
— but typically we'd write it to O=<dir>/.config directly and follow
with make olddefconfig to resolve any dependencies.
Why the primary site is set
BR2_BACKUP_SITE defaults to Buildroot's own source archive, which mirrors
every tarball mainline Buildroot references. Nerves systems override it to
https://dl.nerves-project.org, which only carries what a Nerves system
itself builds — reasonable for them, useless here, because nbpr's whole
purpose is building packages Nerves systems don't include.
Left alone, an nbpr build's only real source is the package's own upstream
site, and some of those are unreliable: gpsd's is a Savannah mirror over
plain HTTP, which times out often enough from CI runners to fail roughly half
a nine-target matrix, with dl.nerves-project.org then returning 403.
Setting BR2_PRIMARY_SITE to the archive fixes that without touching the
system's backup choice. Buildroot tries the primary site first and falls
back to the package's own site, so downloads get faster and more reliable at
the same time, and upstreams see less traffic — which is what Buildroot
recommends the option for.
Summary
Functions
Returns the defconfig text for the given inputs as a binary.
Functions
@spec render!(NBPR.Package.t(), Path.t(), keyword()) :: String.t()
Returns the defconfig text for the given inputs as a binary.
package is an NBPR.Package.t(). build_opts is the resolved keyword
list (defaults applied) — typically the validated output of
NimbleOptions.validate!/2 on the package's build_opts schema.