← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~chad.smith/cloud-init:bug/1840080-ubuntu-drivers-emit-latelink-v2 into cloud-init:master

 


Diff comments:

> diff --git a/cloudinit/config/cc_ubuntu_drivers.py b/cloudinit/config/cc_ubuntu_drivers.py
> index 4da34ee..ff56775 100644
> --- a/cloudinit/config/cc_ubuntu_drivers.py
> +++ b/cloudinit/config/cc_ubuntu_drivers.py
> @@ -90,17 +118,28 @@ def install_drivers(cfg, pkg_install_func):
>      if version_cfg:
>          driver_arg += ':{}'.format(version_cfg)
>  
> -    LOG.debug("Installing NVIDIA drivers (%s=%s, version=%s)",
> +    LOG.debug("Installing and activating 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)
> +    # Register and set debconf selection linux/nvidia/latelink = true
> +    tdir = temp_utils.mkdtemp(needs_exe=True)
> +    debconf_file = os.path.join(tdir, 'nvidia.template')
> +    debconf_script = os.path.join(tdir, 'nvidia-debconf.sh')
> +    try:
> +            util.write_file(debconf_file, NVIDIA_DEBCONF_CONTENT)

This indentation looks off to me.

> +            util.write_file(
> +                debconf_script,
> +                util.encode_text(NVIDIA_DRIVER_LATELINK_DEBCONF_SCRIPT),
> +                mode=0o755)
> +            util.subp([debconf_script, debconf_file])
> +    except Exception as e:
> +            util.logexc(
> +                LOG,
> +                "Failed to register NVIDIA debconf template: %s", str(e))
> +            raise
> +    finally:
> +        if os.path.isdir(tdir):
> +            util.del_dir(tdir)
>  
>      try:
>          util.subp(['ubuntu-drivers', 'install', '--gpgpu', driver_arg])


-- 
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371546
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:bug/1840080-ubuntu-drivers-emit-latelink-v2 into cloud-init:master.


References