Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
33f2911
feat(plugins): kernel: fix pull_commands check
dilyn-corner Apr 22, 2026
77e7a98
feat(plugins): kernel: improve URL test check
dilyn-corner Apr 22, 2026
c691ff8
feat(plugins): kernel: use var name
dilyn-corner Apr 22, 2026
9609a7c
feat(plugins): initrd|kernel: s/kernel.img/vmlinuz
dilyn-corner Apr 22, 2026
81faed5
feat(plugins): kernel: default to decompressed kernel images for some…
dilyn-corner Apr 23, 2026
8e33042
feat(plugins): initrd: modify URL for Ubuntu base
dilyn-corner Apr 23, 2026
b01a79b
feat(plugins): initrd: properly gate builds
dilyn-corner Apr 24, 2026
d27669b
feat(plugins): initrd|kernel: set a special property
dilyn-corner Apr 24, 2026
12690ae
feat(plugins): initrd: correct umnt behavior
dilyn-corner Apr 24, 2026
33ec1cf
feat(plugins): initrd: kill greedy PIDs
dilyn-corner Apr 24, 2026
0b37bb7
feat(plugins): initrd: correct pid value in kill command
dilyn-corner May 15, 2026
0794313
feat(plugins): kernel: fix check_config behavior
dilyn-corner May 15, 2026
47a5a8c
feat(plugins): initrd: correct key/cert test cases
dilyn-corner May 15, 2026
6b1928f
feat(plugins): initrd: use PartsError instead of ValueError
dilyn-corner May 15, 2026
cb79f8b
feat(plugins): kernel: remove unhit code path
dilyn-corner May 15, 2026
a601916
feat(plugins): kernel: make OLDPWD explicit
dilyn-corner May 15, 2026
b5ba2ae
feat(plugins): kernel: add new debian-package option
dilyn-corner May 15, 2026
267b7f4
feat(plugins): initrd: handle trailing slashes for addons and firmware
dilyn-corner May 15, 2026
459cee8
feat(plugins): initrd: clarify docstring for initrd-firmware option
dilyn-corner May 15, 2026
e19b26f
feat(plugins): kernel: expand support for custom configs
dilyn-corner May 15, 2026
0b78a7a
feat(plugins): kernel: refactor run()
dilyn-corner May 16, 2026
a54b286
feat(plugins): kernel: update how arguments are passed
dilyn-corner May 17, 2026
29449e6
feat(plugins): kernel: improve kernel_tools handling
dilyn-corner May 17, 2026
4347ce8
feat(plugins): kernel: implement image, dkms, and tool target handling
dilyn-corner May 17, 2026
32da375
feat(plugins): kernel|initrd: improve pydantic messaging
dilyn-corner May 17, 2026
0615fed
feat(plugins): kernel|initrd: include some explanation
dilyn-corner May 17, 2026
bc11e26
feat(plugins): kernel|initrd: update tests
dilyn-corner May 17, 2026
a943911
feat(plugins): kernel: update plugin documentation
dilyn-corner May 17, 2026
1c554c6
feat(plugins): kernel: unconditionally remove any debs
dilyn-corner May 20, 2026
b39b142
feat(plugins): kernel: change some ordering, fix flags
dilyn-corner May 20, 2026
d90ecae
feat(plugins): kernel: properly organize and cleanup debs
dilyn-corner May 21, 2026
45136c1
feat(plugins): kernel: export all dpkg variables
dilyn-corner May 21, 2026
c801610
feat(plugins): kernel: reorder deb_pkg
dilyn-corner May 21, 2026
63982dd
feat(plugins): kernel: use import instead of update
dilyn-corner May 21, 2026
94fd59d
feat(plugins): kernel: build tools, fix dependencies
dilyn-corner May 21, 2026
4c28988
feat(plugins): kernel: add new spread test
dilyn-corner May 21, 2026
cbbf808
feat(plugins): kernel: extend tests
dilyn-corner May 22, 2026
64aac8d
feat(plugins): kernel: clarify some details in the docs
dilyn-corner May 22, 2026
934fcf2
feat(plugins): initrd: align firmware and addons behavior
dilyn-corner May 22, 2026
f107474
feat(plugins): kernel|initrd: add meta descriptions to docs
dilyn-corner May 22, 2026
3836022
feat(plugins): kernel|initrd: resolve lint failures
dilyn-corner May 22, 2026
c4e3fe6
feat(plugins): kernel: don't check for a defconfig file
dilyn-corner May 22, 2026
f409a58
feat(plugins): kernel: install the arch-specific deps for tools
dilyn-corner May 22, 2026
6925f84
feat(plugins): kernel: drop redundant install invocation
dilyn-corner May 22, 2026
0b970aa
feat(plugins): kernel|initrd: update spread tests
dilyn-corner May 22, 2026
84f3eff
feat(plugins): kernel: fix quotes around kernel-kconfigs
dilyn-corner May 22, 2026
509fdab
feat(plugins): initrd: add missing dependency in chroot
dilyn-corner May 22, 2026
97f1f43
fixup! feat(plugins): initrd: add missing dependency in chroot
dilyn-corner May 26, 2026
59d1bd1
feat(plugins): kernel: install dtbs with -j1
dilyn-corner May 26, 2026
f138e75
feat(plugins): kernel|initrd: changes from review
dilyn-corner May 27, 2026
9a93bbc
feat(plugins): kernel: fix test usage
dilyn-corner May 27, 2026
a0d33bf
feat(plugins): kernel|initrd: fix spread tests
dilyn-corner May 27, 2026
a7360bb
feat(plugins): kernel|initrd: add initrd spread tests
dilyn-corner May 27, 2026
52dd019
feat(plugins): kernel|initrd: build cross tests on core24
dilyn-corner May 29, 2026
4145224
feat(plugins): kernel|initrd: change snap name check
dilyn-corner May 29, 2026
6398984
fixup! feat(plugins): kernel|initrd: change snap name check
dilyn-corner May 29, 2026
02cbf14
feat(plugins): initrd: remove cross test
dilyn-corner May 29, 2026
504ff7a
feat(plugins): kernel: drop :file: usage
dilyn-corner May 29, 2026
9664ef8
feat(plugins): initrd: don't run removed test
dilyn-corner May 29, 2026
47ad3b9
Revert "fixup! feat(plugins): initrd: add missing dependency in chroot"
dilyn-corner Jun 1, 2026
65ad34f
feat(plugins): initrd: drop initrd source workaround
dilyn-corner Jun 1, 2026
1dbc267
feat(plugins): initrd: fix removal ordering
dilyn-corner Jun 1, 2026
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
28 changes: 27 additions & 1 deletion .github/workflows/spread-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,33 @@ jobs:
path: tests
- name: Kernel plugin test
run: |
spread google:ubuntu-22.04-64:tests/spread/plugins/craft-parts/kernel
spread google:ubuntu-22.04-64:tests/spread/plugins/craft-parts/kernel \
google:ubuntu-22.04-64:tests/spread/plugins/craft-parts/kernel-bin \
google:ubuntu-22.04-64:tests/spread/plugins/craft-parts/kernel-cross \
google:ubuntu-22.04-64:tests/spread/plugins/craft-parts/kernel-deb

initrd-plugins:
needs: [predicate, snap-build]
if: needs.predicate.outputs.should_run == 'true'
runs-on: [spread-installed]
steps:
- name: Cleanup job workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout snapcraft
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
- name: Download snap artifact
uses: actions/download-artifact@v5
with:
name: snap
path: tests
- name: Initrd plugin test
run: |
spread google:ubuntu-22.04-64:tests/spread/plugins/craft-parts/initrd

remote-build:
needs: [predicate, snap-build]
Expand Down
2 changes: 2 additions & 0 deletions docs/.custom_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jemalloc
JLink
json
KCalc
kconfig
kdefconfig
keyrings
landscape
lang
Expand Down
5 changes: 4 additions & 1 deletion docs/reference/plugins/initrd_plugin.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. meta::
:description: Understand the usage and meaning of the varies keys and environment variables used by the initrd plugin. See an example, test cases, and real world usage.

.. _reference-initrd-plugin:

Initrd plugin
Expand Down Expand Up @@ -84,7 +87,7 @@ initrd-build-efi-image
If true, a Unified Kernel Image (UKI) will be created using the initrd
compressed CPIO archive created by this plugin and a kernel image file. The
kernel image must be present in ``${CRAFT_STAGE}`` and must be named
``kernel.img``.
``vmlinuz``.


initrd-efi-image-key
Expand Down
112 changes: 100 additions & 12 deletions docs/reference/plugins/kernel_plugin.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. meta::
:description: Understand the usage and meaning of the varies keys and environment variables used by the kernel plugin. See an example, test cases, and real world usage.
.. _reference-kernel-plugin:

Kernel plugin
Expand Down Expand Up @@ -29,8 +31,16 @@ kernel-kdefconfig

**Default**: ``["defconfig"]``

The kernel configurations to use when generating a ``.config``, such as those
found in ``arch/${arch}/configs`` or ``kernel/configs``.
The kernel configurations to use when generating a ``.config``. Multiple items
in the list may be specified, but their order matters. Items later in the list
take precedent over earlier items.

If ``kernel-ubuntu-debian-package`` is ``true``, then the specified kdefconfig
files must be in the annotations format and located in ``${CRAFT_PROJECT_DIR}/annotations``.

If ``kernel-ubuntu-debian-package`` is ``false``, then the specified kdefconfig
files must be in the regular kconfig fragment style and located in either
Comment thread
bepri marked this conversation as resolved.
``${CRAFT_PART_SRC}/arch/${CRAFT_ARCH_BUILD_FOR}/configs`` or ``${CRAFT_PART_SRC}/kernel/configs``.


kernel-kconfigs
Expand All @@ -43,6 +53,10 @@ values in the base configurations established by the ``kernel-kdefconfig`` and
``kernel-ubuntu-kconfigflavour`` keys. The kernel build system is used to resolve any
configuration dependencies or invalid combinations.

If ``kernel-ubuntu-debian-package`` is ``true``, this option is unavailable.
Instead, a config fragment should be put into ``${CRAFT_PROJECT_DIR}/annotations/``
and specified in the ``kernel-kdefconfig`` key.


kernel-tools
~~~~~~~~~~~~
Expand All @@ -52,6 +66,9 @@ kernel-tools
A list of kernel tools to build. If set, the specified tools will be built and added to
the final snap package.

This option is incompatible with ``kernel-ubuntu-binary-package`` and instead,
the tools to include should be specified in ``stage-packages``.

Valid values are ``bpf``, ``cpupower``, and ``perf``.

.. admonition:: Warning
Expand Down Expand Up @@ -89,6 +106,19 @@ kernels available on Launchpad.
Valid values are Ubuntu release code names like ``jammy``, ``lunar``, or ``noble``.


kernel-ubuntu-abinumber
~~~~~~~~~~~~~~~~~~~~~~~

**Type**: string

A string which specifies a particular kernel version and, more importantly,
ABI number of the kernel package to build. This value is meaningful when
``kernel-ubuntu-release-name`` or ``kernel-ubuntu-binary-package`` are used. For the
former, this value will be used when cloning the git repository for the chosen release.
For the latter, this value will be used to specify the kernel version of the debian
package.


kernel-ubuntu-binary-package
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -109,17 +139,29 @@ repackaged into a snap. A particular ABI may be specified with ``kernel-ubuntu-a
for a viable workaround.


kernel-ubuntu-abinumber
~~~~~~~~~~~~~~~~~~~~~~~
kernel-ubuntu-debian-package
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Type**: string
**Type**: bool

A string which specifies a particular kernel version and, more importantly,
ABI number of the kernel package to build. This value is meaningful when
``kernel-ubuntu-release-name`` or ``kernel-ubuntu-binary-package`` are used. For the
former, this value will be used when cloning the git repository for the chosen release.
For the latter, this value will be used to specify the kernel version of the debian
package.
**Default**: ``false``

If enabled, the kernel will be built following how debian packages traditionally are.
This means that the build steps are handled by the ``debian/rules`` makefile, rather
than any direct ``make`` invocations as is done in other cases with this plugin.

This option is primarily intended to be used by the Canonical Kernel team. Its
usage requires the kernel source provides a valid ``debian/`` directory.


kernel-ubuntu-debian-dkms
~~~~~~~~~~~~~~~~~~~~~~~~~

**Type**: list of strings

A list of DKMS packages to include in the debian package build of the kernel.

This option is only meaningful when used with ``kernel-ubuntu-debian-package``.


Environment variables
Expand Down Expand Up @@ -208,6 +250,50 @@ specified.
How it works
------------

There are three primary patterns for this plugin depending on the selected keys.

1. ``kernel-ubuntu-binary-package: true``
#. ``kernel-ubuntu-debian-package: true``
#. Neither
Comment thread
bepri marked this conversation as resolved.


Binary package
~~~~~~~~~~~~~~

In the case where building from a binary package, most of the processes used by
this plugin are skipped. Instead, a prebuilt kernel image and its associated
modules are fetched from the archive and staged to the expected locations for a
kernel snap.

This option is the fastest route to producing a kernel snap when a kernel debian
package already exists, and no real changes need to be made to it.


Debian package
~~~~~~~~~~~~~~

This case performs a source-based build, following the standard Ubuntu kernel
build method as closely as possible. Ultimately, ``dpkg`` and its associated
tools are responsible for configuring and building a kernel and its modules,
with options to include DKMS packages from the archive or to build the supported
kernel tools.

By the end, several deb packages will be produced and then extracted and staged.
This option supplants the binary package option in cases where the kernel must
be customized in some way, but the standard debian tooling still needs to be
used to build the kernel.


Neither
~~~~~~~

This case performs a complete build of an arbitrary kernel source, whether it be
for a debian package or from some other maintainer.

This option is the most feature-rich path enabling end-to-end control over the
entire kernel, and is most useful for doing board development work when you have
a known-working kernel for the hardware and need to package it into a snap.

During the build step the plugin performs the following actions:

#. Pass a collection of flags built from the selected keys to a kernel build
Expand Down Expand Up @@ -245,7 +331,9 @@ key, and so a generic ``kernel-ubuntu-kconfigflavour`` is used (as this is the
default behavior, no key is specified). A specific tag (Ubuntu-5.15.0-176.186)
is named with the ``kernel-ubuntu-abinumber`` key, which means that tag of the
Jammy tree will be cloned. A kernel config value is specified to remove debug
information.
information. The kernel is then built following the standard ``make defconfig;
make; make install`` pattern rather than using tools like ``dpkg`` to produce
and unpack a deb.

The linux-firmware and wireless-regdb packages are staged with this part for
convenience but are not necessarily required.
Expand Down
Loading
Loading