kernel plugin initrd packaging fails when kernel modules have common dependencies
Metadata
Current evaluation
Fixed by snapcore/snapcraft PR #837, which allowed initrd packaging to handle common kernel-module dependencies without duplicate-copy failures.
Resolution: closed resolved
Reason: The reporter linked PR #837 after successfully building caracalla-kernel_4.4.0_amd64.snap, and maintainers confirmed the required modules were collected. Forced driver loading was explicitly discussed as a separate bug or feature.
Evaluated by: mr-cal-bot
No scores available.
Issue body
When it comes to handling common dependencies for different kernel modules the snapcraft build always fails.
e.g. the hid-generic.ko and usbhid.ko modules both depend on hid.ko. In this case, the snapcraft build fails with this error:
[Errno 17] File exists: '/home/u/0_work/kernel-snap/parts/kernel/install/lib/modules/4.4.16-xenial_generic+/kernel/drivers/hid/hid.ko' -> '/home/u/0_work/kernel-snap/parts/kernel/build/initrd-staging/lib/modules/4.4.16-xenial_generic+/kernel/drivers/hid/hid.ko'
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by snapcore/snapcraft PR #837, which allowed initrd packaging to handle common kernel-module dependencies without duplicate-copy failures. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged Snapcraft PR #837 (commit 2e9e4b667), deduplicating shared kernel-module dependencies so hid.ko was not copied twice into initrd. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR canonical/snapcraft#837, commit 2e9e4b667, which deduplicated shared kernel-module dependencies during initrd packaging. | |
| qwen/qwen3.6-35b-a3b | — | — | Snapcraft kernel plugin initrd packaging failed when shared module dependencies triggered a file exists error. The report was closed without comments or resolution, indicating it was abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The snapcraft kernel plugin initrd packaging fails with a FileExistsError when modules share dependencies, indicating the bug was abandoned. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#837
(confidence 99%)
Directly linked in the successful-build confirmation for the common module dependency failure.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1572118 kernel plugin _make_initrd fails to add given modules | snapcraft (launchpad) | closed | Kernel initrd module collection was fixed by running modprobe separately for each configured module in snapcraft PR #476 (commit 53941d2b0), resolving LP #1572118. | |
| #1567564 kernel plugin should use initrd from /boot in the os snap, not from /usr/lib | snapcraft (launchpad) | closed | Kernel plugin initrd lookup was fixed by switching to /boot/initrd.img-core in snapcraft PR #1839, merged as commit aaf5e68b1. | |
| #1606903 kernel plugin: can't snap a kernel using launchpad | snapcraft (launchpad) | closed | Fixed by merged PR canonical/snapcraft#903 (commit 603948e1d), allowing Store part downloads without snapcraft login and resolving Launchpad kernel builds. | |
| #1558970 Support downloading snaps | snapcraft (launchpad) | closed | Snap downloading support was merged in canonical/snapcraft#379 via commit 0c31143f3, enabling the kernel plugin to assemble a full initrd image. | |
| #1569337 snapcraft kernel plugin needs to check compression method of the initrd before trying to unpack it | snapcraft (launchpad) | closed | Kernel plugin gained initrd compression detection and LZMA/XZ support instead of assuming gzip; fixed by merged PR canonical/snapcraft#463 (commit ac25418f5). | |
| #1674965 Don't duplicate initrd and kernel files | snapcraft (launchpad) | closed | Closed as stale after snapcore/snapcraft#1207 was abandoned unmerged because symlinks broke the Snapdragon snap; the kernel plugin has since changed substantially. | |
| #6418 core26: kernel plugin fails to run | snapcraft | closed | Fixed by merged PR canonical/snapcraft#6425 (commit be405aad6), updating the kernel plugin to handle modules packaged under usr/lib on usrmerged core26 systems. | |
| #1115 kernel plugin: fix kernel snap layout | snapcraft | merged | Merged via commit 86017cdef: kernel plugin now places modules/ and firmware/ at the top level of prime/ for kernel snaps, plus corrected required build packages; unit and manual tests updated per review. | |
| #837 kernel plugin: allow collecting the same mod deps | snapcraft | merged | Merged PR #837 in commit 2e9e4b667, deduplicating kernel-module dependencies with a set so shared dependencies are not copied twice into the initrd. | |
| #1207 kernel plugin: stop duplicating initrd and image file, use symlinks f… | snapcraft | closed | Closed unmerged: PR #1207's symlink change broke the snapdragon snap; the author had no time to debug it and deferred the work. |