summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_ubuntu_drivers.py
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2019-08-19 21:37:29 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-08-19 21:37:29 +0000
commit85878703e80f536168bcf86cc6444f7aba44cdc3 (patch)
tree9358683804949cd5d48a569aaa986e3b3f20107b /cloudinit/config/cc_ubuntu_drivers.py
parent2c52e6e88b19f5db8d55eb7280ee27703e05d75f (diff)
downloadvyos-cloud-init-85878703e80f536168bcf86cc6444f7aba44cdc3.tar.gz
vyos-cloud-init-85878703e80f536168bcf86cc6444f7aba44cdc3.zip
ubuntu-drivers: emit latelink=true debconf to accept nvidia eula
To accept NVIDIA EULA, cloud-init needs to emit latelink=true debconf setting to the linux-restricted-modules package to allow NVIDIA drivers to properly link to the running kernel. LP: #1840080
Diffstat (limited to 'cloudinit/config/cc_ubuntu_drivers.py')
-rw-r--r--cloudinit/config/cc_ubuntu_drivers.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/cloudinit/config/cc_ubuntu_drivers.py b/cloudinit/config/cc_ubuntu_drivers.py
index 91feb603..4da34ee0 100644
--- a/cloudinit/config/cc_ubuntu_drivers.py
+++ b/cloudinit/config/cc_ubuntu_drivers.py
@@ -4,6 +4,7 @@
from textwrap import dedent
+from cloudinit.config import cc_apt_configure
from cloudinit.config.schema import (
get_schema_doc, validate_cloudconfig_schema)
from cloudinit import log as logging
@@ -92,6 +93,15 @@ def install_drivers(cfg, pkg_install_func):
LOG.debug("Installing NVIDIA drivers (%s=%s, version=%s)",
cfgpath, nv_acc, version_cfg if version_cfg else 'latest')
+ # Setting NVIDIA latelink confirms acceptance of EULA for the package
+ # linux-restricted-modules
+ # Reference code defining debconf variable is here
+ # https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/
+ # linux-restricted-modules/+git/eoan/tree/debian/templates/
+ # nvidia.templates.in
+ selections = b'linux-restricted-modules linux/nvidia/latelink boolean true'
+ cc_apt_configure.debconf_set_selections(selections)
+
try:
util.subp(['ubuntu-drivers', 'install', '--gpgpu', driver_arg])
except util.ProcessExecutionError as exc: