← Back to issue list

kernel: If 'kernel-with-firmware: false', don't assume /lib/firmware is present

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1733564
Type
issue
State
closed
Author
~p-pisati
Labels
—
Created
Updated
Closed

Current evaluation

Kernel plugin crashed with FileNotFoundError when kernel-with-firmware was false; fixed by snapcore/snapcraft PR #1750 (commit 2d16ac3c0) which made the plugin skip /lib/firmware handling when firmware is disabled.

Resolution: closed resolved

Reason: Maintainer ~kyrofa closed the report pointing to PR #1750 ('kernel plugin: don't assume /lib/firmware is present if !kernel-with-firmware'), which was merged as commit 2d16ac3c0 'kernel plugin: respect the kernel-with-firmware property'. The legacy kernel plugin was later dropped entirely with 'chore: remove snapcraft_legacy'.

Evaluated by: mr-cal-bot

No scores available.

Issue body

In case of 'kernel-with-firmware: false', don't assume /lib/firmware is present, and avoid referencing it later on. snapcraft.yaml: ... kernel-with-firmware: false Traceback (most recent call last): File "/usr/lib/python3.5/shutil.py", line 538, in move os.rename(src, real_dst) FileNotFoundError: [Errno 2] No such file or directory: '/home/flag/canonical/linux/snap/parts/kernel/install/lib/firmware' -> '/home/flag/canonical/lin ux/snap/parts/kernel/install/firmware' During handling of the above exception, another exception occurred: Traceback (most recent call last): [4/9271] File "/home/flag/canonical/snapcraft/bin/snapcraft", line 36, in <module> obj=dict(project=snapcraft.ProjectOptions())) File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1037, in invoke return Command.invoke(self, ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/flag/canonical/snapcraft/snapcraft/cli/__init__.py", line 124, in run ctx.forward(lifecyclecli.commands['snap']) File "/usr/lib/python3/dist-packages/click/core.py", line 552, in forward return self.invoke(cmd, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/home/flag/canonical/snapcraft/snapcraft/cli/lifecycle.py", line 140, in snap project_options, directory=directory, output=output) File "/home/flag/canonical/snapcraft/snapcraft/internal/lifecycle/_packer.py", line 45, in snap execute('prime', project_options) File "/home/flag/canonical/snapcraft/snapcraft/internal/lifecycle/_runner.py", line 80, in execute _Executor(config, project_options).run(step, part_names) File "/home/flag/canonical/snapcraft/snapcraft/internal/lifecycle/_runner.py", line 175, in run self._run_step(step, part, part_names) File "/home/flag/canonical/snapcraft/snapcraft/internal/lifecycle/_runner.py", line 212, in _run_step getattr(part, step)() File "/home/flag/canonical/snapcraft/snapcraft/internal/pluginhandler/__init__.py", line 330, in build self.plugin.build() File "/home/flag/canonical/snapcraft/snapcraft/plugins/kbuild.py", line 258, in build self.do_install() File "/home/flag/canonical/snapcraft/snapcraft/plugins/kernel.py", line 479, in do_install os.path.join(self.installdir, 'lib', 'firmware'), self.installdir) File "/usr/lib/python3.5/shutil.py", line 552, in move copy_function(src, real_dst) File "/usr/lib/python3.5/shutil.py", line 251, in copy2 copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.5/shutil.py", line 114, in copyfile with open(src, 'rb') as fsrc: FileNotFoundError: [Errno 2] No such file or directory: '/home/flag/canonical/linux/snap/parts/kernel/install/lib/firmware'

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Kernel plugin crashed with FileNotFoundError when kernel-with-firmware was false; fixed by snapcore/snapcraft PR #1750 (commit 2d16ac3c0) which made the plugin skip /lib/firmware handling when firmware is disabled.
stealth/space-bunny-alpha — closed resolved Kernel builds with kernel-with-firmware: false no longer access a missing /lib/firmware; fixed by merged PR canonical/snapcraft#1750 (commit 2d16ac3c0).
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/snapcraft#1750 (commit 2d16ac3c0), preventing kernel builds from accessing /lib/firmware when kernel-with-firmware is false.
qwen/qwen3.6-35b-a3b — — Resolved by updating the kernel plugin to skip firmware directory operations when kernel-with-firmware is disabled, preventing FileNotFoundError during builds.
qwen/qwen3.6-35b-a3b — — Fixed by updating the kernel plugin to skip /lib/firmware when kernel-with-firmware is false, resolving the FileNotFoundError during snap builds.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcore/snapcraft#1750 (confidence 97%)

    Merged PR fixing LP #1733564; commit 2d16ac3c0 guards /lib/firmware handling behind kernel-with-firmware.

  • Related To: canonical/snapcraft#5814 (confidence 45%)

    New v2 kernel plugin added much later; legacy plugin containing the fix was removed in ffb164b7a.

Related issues

Issue Project State Summary Similarity
#1748 kernel plugin: don't assume /lib/firmware is present if !kernel-with-firmware snapcraft closed PR #1748 (kernel plugin /lib/firmware hotfix, LP #1733564) was closed as superseded by canonical/snapcraft#1750, merged as commit 2d16ac3c0 to skip /lib/firmware handling when kernel-with-firmware is false.
86%
#1750 kernel plugin: don't assume /lib/firmware is present if !kernel-with-firmware snapcraft merged Merged PR #1750 (commit 2d16ac3c0), skipping /lib/firmware handling when kernel-with-firmware is false and fixing LP #1733564.
79%