← Back to issue list

kernel plugin _make_initrd fails to add given modules

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1572118
Type
issue
State
closed
Author
~gunther-laure-e
Labels
—
Created
Updated
Closed

Current evaluation

Kernel initrd module collection was fixed by running modprobe separately for each configured module in snapcraft PR #476 (commit 53941d2b0), resolving LP #1572118.

Resolution: closed resolved

Reason: Merged PR canonical/snapcraft#476 changed the kernel plugin to iterate over configured modules and was committed as 53941d2b0.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The kernel plugin does not add given modules to the initrd. In the given snapcraft.yaml "ahci" is not added to initrd. This happens because all kernel-initrd-modules are added the the commandline: modprobe -n --show-depends -d /test/parts/kernel/install -S 4.4.5-test+ squashfs ahci instead of running modprobe extra for each module: modprobe -n --show-depends -d /test/parts/kernel/install -S 4.4.5-test+ squashfs modprobe -n --show-depends -d /test/parts/kernel/install -S 4.4.5-test+ ahci name: test-kernel version: 4.4.0 summary: ubuntu xenial kernel description: A standard kernel type: kernel parts: kernel: plugin: kernel source: git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git source-type: git source-branch: Ubuntu-4.4.0-14.30 kdefconfig: [defconfig] kconfigs: - CONFIG_LOCALVERSION="-test" - CONFIG_DEBUG_INFO=n - CONFIG_SQUASHFS=m - CONFIG_SQUASHFS_XZ=y - CONFIG_USB_XHCI_HCD=y - CONFIG_R8169=m - CONFIG_SECURITY_APPARMOR=y - CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 - CONFIG_SECURITY_APPARMOR_UNCONFINED_INIT=y - CONFIG_SECURITY_APPARMOR_HASH=y - CONFIG_SECURITY_APPARMOR_HASH_DEFAULT=y - CONFIG_DEFAULT_SECURITY_APPARMOR=y - CONFIG_DEFAULT_SECURITY="apparmor" - CONFIG_ATA=y - CONFIG_SATA_AHCI=m - CONFIG_SATA_AHCI_PLATFORM=m kernel-initrd-modules: - squashfs - ahci Example resolution would be FROM: def _make_initrd(self): logger.info('Generating driver initrd for kernel release: {}'.format( self.kernel_release)) initrd_unpacked_path = self._unpack_generic_initrd() if self.options.kernel_initrd_modules: modprobe_out = self.run_output([ 'modprobe', '-n', '--show-depends', '-d', self.installdir, '-S', self.kernel_release] + self.options.kernel_initrd_modules) modprobe_outs = modprobe_out.split(os.linesep) else: modprobe_outs = [] TO: def _make_initrd(self): logger.info('Generating driver initrd for kernel release: {}'.format( self.kernel_release)) initrd_unpacked_path = self._unpack_generic_initrd() modprobe_outs = [] for initrd_module in self.options.kernel_initrd_modules: modprobe_out = self.run_output([ 'modprobe', '-n', '--show-depends', '-d', self.installdir, '-S', self.kernel_release] + [initrd_module]) modprobe_outs.append(modprobe_out)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Kernel initrd module collection was fixed by running modprobe separately for each configured module in snapcraft PR #476 (commit 53941d2b0), resolving LP #1572118.
stealth/space-bunny-alpha — closed resolved Fixed by merged snapcraft#476 (commit 53941d2b0), making the kernel plugin run modprobe separately for each requested initrd module.
stealth/space-bunny-alpha — closed resolved Fixed in snapcraft#476 (commit 53941d2b0): the kernel plugin now runs modprobe separately for each kernel-initrd-module, ensuring requested modules such as ahci are included.
qwen/qwen3.6-35b-a3b — — Closed. Fixed by updating the kernel plugin to call modprobe individually for each kernel-initrd-module rather than passing them all at once, ensuring all specified drivers are correctly included in the initrd.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The kernel plugin incorrectly passed all kernel-initrd-modules to a single modprobe command. A proposed fix to iterate through modules individually was provided but never merged.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#476 (confidence 100%)

    Merged fix for per-module modprobe processing; its record explicitly identifies LP #1572118 as resolved.

Related issues

Issue Project State Summary Similarity
#1627923 kernel plugin initrd packaging fails when kernel modules have common dependencies snapcraft (launchpad) closed Fixed by snapcore/snapcraft PR #837, which allowed initrd packaging to handle common kernel-module dependencies without duplicate-copy failures.
78%
#476 kernel plugin: iterate over modules to add to initrd snapcraft merged Kernel plugin now iterates over required modules when assembling the initrd; PR #476 was merged as commit 53941d2b0, resolving LP #1572118.
75%
#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.
71%