Behaviour for all functionality in the Nerves firmware build process
Implementations should add use Nerves.BuildAction and only implement
the callbacks they use. Most actions will only implement one callback
Summary
Callbacks
Callback for creating the firmware image
Callback for processing the release right after assembly, but before rootfs creation
Callback for updating the build plan once artifacts are extracted
Callback for everything after firmware image creation
Callback for anything that should run before the Mix release gets assembled
Callback for updating the build plan before any downloads occur
Callback for everything after rootfs creation and before making the firmware image
Callback for creating the rootfs
Callbacks
@callback image_creation(build_plan :: Nerves.BuildPlan.t(), opts :: keyword()) :: :ok
Callback for creating the firmware image
@callback post_assemble_steps( build_plan :: Nerves.BuildPlan.t(), release :: Mix.Release.t(), opts :: keyword() ) :: Mix.Release.t()
Callback for processing the release right after assembly, but before rootfs creation
@callback post_extract(build_plan :: Nerves.BuildPlan.t(), opts :: keyword()) :: Nerves.BuildPlan.t()
Callback for updating the build plan once artifacts are extracted
This can be used to look through artifact contents to adjust to plan. Since actions can be added dynamically up to this callback, It's the only callback that can modify the build plan that's guaranteed to be called. However, as it is past the extraction phase, no new files can be downloaded.
@callback post_image_creation(build_plan :: Nerves.BuildPlan.t(), opts :: keyword()) :: :ok
Callback for everything after firmware image creation
@callback pre_assemble_steps( build_plan :: Nerves.BuildPlan.t(), release :: Mix.Release.t(), opts :: keyword() ) :: Mix.Release.t()
Callback for anything that should run before the Mix release gets assembled
@callback pre_download(build_plan :: Nerves.BuildPlan.t(), opts :: keyword()) :: Nerves.BuildPlan.t()
Callback for updating the build plan before any downloads occur
It's possible to add files to be downloaded to the plan in this callback.
This is the only callback that may not be called. If an action is registered in another
action's post_extract/2 callback, then that's after the download phase and therefore
after pre_download/2 functions are called.
@callback pre_image_creation(build_plan :: Nerves.BuildPlan.t(), opts :: keyword()) :: :ok
Callback for everything after rootfs creation and before making the firmware image
@callback rootfs_creation_steps( build_plan :: Nerves.BuildPlan.t(), release :: Mix.Release.t(), opts :: keyword() ) :: Mix.Release.t()
Callback for creating the rootfs