[SRU][canonical-kernel-snaps/main][PATCH 0/2] pc-kernel configure hook
Aaron Jauregui
aaron.jauregui at canonical.com
Sun Mar 30 22:27:02 UTC 2025
[Impact]
Add a configure hook to the pc-kernel snap to be able to switch between
installed graphics drivers on a system. This gives the system the
ability to switch between multiple installed graphics components without
having to reinstall (and re-pull from store) the selected driver if it's
already present. Drivers can be selected manually with snap set
nvidia-stream=<driver> and selection is intended to be done by
ubuntu-drivers once components are available on hybrid.
[Fix]
Configure hook installs components based off the nvidia-stream snap
variable by pulling nvidia-<nvidia-stream>-ko and
nvidia-<nvidia-stream>-server. Setting nvidia-stream to nouveau triggers
a special case where only the nouveau-ko component is installed. If
components are already on the system they are "loaded" into the graphics
directory by rerunning their install hook.
Currently supported values for nvidia-stream are "nouveau" and
"550-erd". If a non-supported value is provided the script will fail and
no changes will be made to the system or the previous value of
nvidia-stream.
Also changed generic module install hook to follow symlinks when
installing graphics drivers to support rerunning install hook.
[Test case]
Built, booted, verified installing nouveau and 550-erd components and
switching between them once installed.
[Where things could go wrong]
The pc-kernel configure hook runs on every install by default, analogous
to an install hook. Note that if nvidia-stream is set to an invalid
value and the pc-kernel is refreshed the configure hook will fail and
cause the entire pc-kernel refresh to fail.
The configure hook is entirely optional on ubuntu core and will do
nothing if nvidia-stream is not set.
Aaron Jauregui (2):
nvidia-hooks: add pc-kernel configure hook
nvidia-hooks: follow symlinks in module hooks
hooks/module/install.module | 4 ++--
hooks/module/post-refresh.module | 4 ++--
hooks/pc-kernel/configure.pc-kernel | 29 +++++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 4 deletions(-)
create mode 100755 hooks/pc-kernel/configure.pc-kernel
--
2.43.0
More information about the kernel-team
mailing list