[SRU][canonical-kernel-snaps][PATCH 0/1] nvidia_hooks: replace uname -r calls

Juerg Haefliger juerg.haefliger at canonical.com
Fri Jun 6 07:58:47 UTC 2025


On Thu,  5 Jun 2025 12:55:41 +1000
Aaron Jauregui <aaron.jauregui at canonical.com> wrote:

> BugLink: https://bugs.launchpad.net/bugs/2111937
> 
> [Impact]
> It was previously assumed that the currently running kernel corresponds to
> the parent kernel snap of the component being installed/refreshed. This
> does not necessarily hold true. Modules were found to be installed in the
> previous kernel snap's path in some cases, particularly after a refresh.
> This causes the modules to not be found by depmod and thus the drivers
> to not being installed.
> 
> [Fix]
> Replace uname -r to grab the parent kernel snap's kernel version string
> with getting it from the snap's filesystem with basename "$SNAP"/modules/*
> 
> [Test case]
> Built and booted pc-kernel with updated scripts, and tested the resolved
> path for nvidia-550-erd-ko and nouveau components on install and
> refresh.
> 
> [Where things could go wrong]
> The method for grabbing the kernel version string relies on having the
> kernel snap contain /modules/<kernel_version>. Removing this would break
> component install hooks. Having multiple entries in this directory would
> break the script as well. These scenarios are unlikely due to the
> pc-kernel only ever corresponding to a single kernel version.

This template needs to be added to the bug description. That's where the SRU
reviewers expect it.

...Juerg


> 
> Aaron Jauregui (1):
>   nvidia_hooks: replace uname -r calls
> 
>  hooks/module/install.module            | 7 +++++--
>  hooks/module/post-refresh.module       | 7 +++++--
>  hooks/module/remove.module             | 6 ++++--
>  hooks/nvidia-ko/install.nvidia-ko      | 9 ++++++---
>  hooks/nvidia-ko/post-refresh.nvidia-ko | 9 ++++++---
>  hooks/nvidia-ko/remove.nvidia-ko       | 5 ++++-
>  6 files changed, 30 insertions(+), 13 deletions(-)
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20250606/2d671e8c/attachment.sig>


More information about the kernel-team mailing list