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 1 commit
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
41 changes: 37 additions & 4 deletions docs/reference/components.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
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 under ``$SNAP/../components/$SNAP_REVISION/`` so
mr-cal marked this conversation as resolved.
Show resolved Hide resolved
the host snap can access it.

Types
-----

A component can have a type for certain purposes. For some component types,
Snapcraft may place requirements on the contents of a component and snapd
medubelko marked this conversation as resolved.
Show resolved Hide resolved
may have special handling for the component.
medubelko marked this conversation as resolved.
Show resolved Hide resolved

Standard
~~~~~~~~

This 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
~~~~~~~~~~~~~~

This type may only be used for :ref:`kernel snaps<kernel-snap-reference>`.
medubelko marked this conversation as resolved.
Show resolved Hide resolved
These components are for kernel modules and firmware that are made available to
the system after installation. This allows the kernel to find firmware and for
medubelko marked this conversation as resolved.
Show resolved Hide resolved
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. These modules and firmware should be placed
in ``$SNAP_DATA/modules/<kernel-version>/`` and ``$SNAP_DATA/firmware/``
respectively. Additionally, the snap's ``meta/kernel.yaml`` file must specify
``dynamic-modules: $SNAP_DATA``.
medubelko marked this conversation as resolved.
Show resolved Hide resolved

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