Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update component documentation #5174

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/howto/code/components/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ confinement: strict

components:
translations:
type: test
type: standard
summary: Translations modules
description: Translations modules
version: "1.0"
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/bases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ channel.
Snaps with a ``devel`` build base must have a ``grade`` of ``devel`` and cannot
be promoted to ``stable`` or ``candidate`` channels.

.. _kernel-snap-reference:

Kernel snaps
^^^^^^^^^^^^

Expand Down
46 changes: 42 additions & 4 deletions docs/reference/components.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,48 @@
Components
**********
==========

.. include:: /reuse/components-intro.rst

Components employ a `Craft Parts`_ feature called ``partitions``. See
:ref:`component and partitions<components-and-partitions>` for an explanation
on how they are related.
Like snaps, components are packaged a squashfs file. When installed, the
component is mounted at the path ``$SNAP/../components/$SNAP_REVISION/`` so
the host snap can access it.

Types
-----

A component must declare a ``type`` in the project's ``snapcraft.yaml`` file.
For some types, Snapcraft may place requirements on the files of a component
and snapd may have special handling for the component.

Standard
~~~~~~~~

The ``standard`` type is the general use type for components. It should be used
when no specific type applies. Snapcraft has no requirements or special
handling for this type.

Kernel-modules
~~~~~~~~~~~~~~

The ``kernel-modules`` type should only be used for
:ref:`kernel snaps<kernel-snap-reference>`. These components are for kernel
modules and firmware that are made available to the system after installation.
This type allows the kernel to find firmware and for users to load kernel
modules with ``modprobe``.

Static modules should be organized under ``modules/<kernel-version>/`` in the
component, where ``<kernel-version>`` is the version reported by ``uname -r``.

Firmware should be organized under ``firmware/`` in the component.

Modules and firmware may be dynamically generated by the component's
``install`` or ``refresh`` hooks:
mr-cal marked this conversation as resolved.
Show resolved Hide resolved

- Modules generated by a hook should be placed in
``$SNAP_DATA/modules/<kernel-version>/``.
- Firmware generated by a hook should be placed in ``$SNAP_DATA/firmware/``.

To allow loading of dynamically generated modules and firmware, the snap's
``meta/kernel.yaml`` file must declare ``dynamic-modules: $SNAP_DATA``.

.. include:: /common/craft-parts/reference/partition_specific_output_directory_variables.rst
Loading