diff -Nru ubuntu-drivers-common-0.4.17/debian/changelog ubuntu-drivers-common-0.4.17.7/debian/changelog --- ubuntu-drivers-common-0.4.17/debian/changelog 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/debian/changelog 2018-01-30 13:58:58.000000000 +0000 @@ -1,3 +1,107 @@ +ubuntu-drivers-common (1:0.4.17.7) xenial-security; urgency=medium + + * Drop the cpu-microcode.py detection plugin, as exposing microcode + packages will not be necessary once kernel metapackages have a hard + dependency on them + - remove detect-plugins/cpu-microcode.py + - update UbuntuDrivers/detect.py + + -- Chris Coulson Tue, 30 Jan 2018 13:58:58 +0000 + +ubuntu-drivers-common (1:0.4.17.6) xenial-proposed; urgency=medium + + * tests/ubuntu_drivers.py: + - Skip test_system_modaliases_system on s390x. + Fixes FTBFS (LP: #1728547). + + -- Alberto Milone Mon, 22 Jan 2018 12:48:54 +0100 + +ubuntu-drivers-common (1:0.4.17.5) xenial-proposed; urgency=medium + + [ Alberto Milone ] + * gpu-manager.{c|py}: + - Drop the amdgpu-pro code introduced in the previous upload, + as it will be dealt with in a different upload. + + [ Alex Tu ] + * gpu-manager.c: + - Skip bbswitch, and make sure to unload the nvidia driver when + the force-dgpu-on option is enabled (LP: #1728547). + + -- Alberto Milone Wed, 03 Jan 2018 12:33:56 +0100 + +ubuntu-drivers-common (1:0.4.17.4) xenial-proposed; urgency=medium + + [ Alberto Milone ] + * gpu-manager.{c|py}: + - Add support for forcing the dGPU on on hybrid systems. + Creating an empty file named "force-dgpu-on" + in the /usr/share/gpu-manager.d directory will force the dGPU + on in power saving mode (LP: #1728547). + - Sync amdgpu-pro support from 17.10. + + [ Kai-Heng Feng ] + * debian/control: + - Add build dependency on libkmod-dev. + * gpu-manager.c: + - Detect and handle switchable graphics with the amdgpu-pro driver. + AMDGPU-Pro has its own script to switch between powersaving and + performance mode (LP: #1731873). + Some machines allow enabling switchable graphics, or disabling + the iGPU completely, thus leaving only the dGPU on. This new code + simply detects the different profiles supported by AMD, and + enables powersaving mode when possible. + + -- Alberto Milone Mon, 30 Oct 2017 15:48:27 +0100 + +ubuntu-drivers-common (1:0.4.17.3) xenial-proposed; urgency=medium + + * gpu-manager.{c|py}: + - Add support for using custom xorg.confs with the nvidia + driver (LP: #1667198). + Custom xorg files can be named "non-hybrid" (for non hybrid + systems), "hybrid-performance", and "hybrid-power-saving", + and will have to placed in the /usr/share/gpu-manager.d + directory. + The directory can be overridden by passing another directory + along with the "--custom-xorg-conf-path" parameter. + - Add tests for the custom xorg.confs code and for amdgpu-pro + hybrid support. + + -- Alberto Milone Mon, 19 Jun 2017 17:27:33 +0200 + +ubuntu-drivers-common (1:0.4.17.2) xenial-proposed; urgency=medium + + [ Alberto Milone ] + * gpu-manager.c: + - Fix memory leak in get_alternatives(). Make sure to always free + alternatives->current_core and alternatives->current_egl. + - Partially drop the drm code, and get information about connectors + from sysf. This fixes a long standing performance issue (LP: #1586933). + - Disable persistence mode before powering down the dGPU. + If persistence mode is not disabled, gpu-manager will not be able to + unload the nvidia module (LP: #1619306). + - Make sure to load and unload nvidia-drm. This fixes a problem that + prevents the dGPU from being powered off in hybrid systems with + recent nvidia drivers (LP: #1619306). + + [ Ying-Chun Liu (PaulLiu) ] + * Quirks/quirkinfo.py: + - Catch and ignore UnicodeDecodeErrors in dmi info, as some machines + may report board_name as ffffffffffff0a to mean empty, and this + causes an error in python 3 (LP: #1320868). + + -- Alberto Milone Mon, 06 Jun 2016 12:49:19 +0200 + +ubuntu-drivers-common (1:0.4.17.1) xenial-proposed; urgency=medium + + * gpu-manager.c: + - Pass the arguments in the correct order when getting + the list of alternatives (LP: #1575960). + Thanks to Rafał Cieślak for the fix. + + -- Alberto Milone Fri, 29 Apr 2016 12:29:03 +0200 + ubuntu-drivers-common (1:0.4.17) xenial; urgency=medium * tests/ubuntu_drivers.py: Allow test_system_driver_packages_performance() diff -Nru ubuntu-drivers-common-0.4.17/debian/control ubuntu-drivers-common-0.4.17.7/debian/control --- ubuntu-drivers-common-0.4.17/debian/control 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/debian/control 2018-01-03 11:53:50.000000000 +0000 @@ -27,7 +27,8 @@ udev, pciutils, libdrm-dev, - python3-dbus + python3-dbus, + libkmod-dev Standards-Version: 3.9.6 Vcs-Git: git://github.com/tseliot/ubuntu-drivers-common.git Vcs-Browser: https://github.com/tseliot/ubuntu-drivers-common diff -Nru ubuntu-drivers-common-0.4.17/detect-plugins/cpu-microcode.py ubuntu-drivers-common-0.4.17.7/detect-plugins/cpu-microcode.py --- ubuntu-drivers-common-0.4.17/detect-plugins/cpu-microcode.py 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/detect-plugins/cpu-microcode.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -# ubuntu-drivers-common custom detect plugin for x86 CPU microcodes -# -# Author: Dimitri John Ledkov -# -# This plugin detects CPU microcode packages based on pattern matching -# against the "vendor_id" line in /proc/cpuinfo. -# -# To add a new microcode family, simply insert a line into the db -# variable with the following format: -# -# '': '', -# - -import logging - -db = { - 'GenuineIntel': 'intel-microcode', - 'AuthenticAMD': 'amd64-microcode', - } - -def detect(apt_cache): - try: - with open('/proc/cpuinfo') as file: - for line in file: - if line.startswith('vendor_id'): - cpu = line.split(':')[1].strip() - if cpu in db: - return [db.get(cpu)] - except IOError as err: - logging.debug('could not open /proc/cpuinfo: %s', err) Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/Quirks/__pycache__/__init__.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/Quirks/__pycache__/__init__.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/Quirks/__pycache__/quirkapplier.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/Quirks/__pycache__/quirkapplier.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/Quirks/__pycache__/quirkinfo.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/Quirks/__pycache__/quirkinfo.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/Quirks/__pycache__/quirkreader.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/Quirks/__pycache__/quirkreader.cpython-35.pyc differ diff -Nru ubuntu-drivers-common-0.4.17/Quirks/quirkinfo.py ubuntu-drivers-common-0.4.17.7/Quirks/quirkinfo.py --- ubuntu-drivers-common-0.4.17/Quirks/quirkinfo.py 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/Quirks/quirkinfo.py 2017-03-10 11:24:57.000000000 +0000 @@ -44,7 +44,7 @@ try: value = open(os.path.join(self.sys_dir, 'class', 'dmi', 'id', item)).read().strip() - except (OSError, IOError): + except (OSError, IOError, UnicodeDecodeError): value = '' self._quirk_info[item] = value diff -Nru ubuntu-drivers-common-0.4.17/share/hybrid/gpu-manager.c ubuntu-drivers-common-0.4.17.7/share/hybrid/gpu-manager.c --- ubuntu-drivers-common-0.4.17/share/hybrid/gpu-manager.c 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/share/hybrid/gpu-manager.c 2018-01-03 11:53:51.000000000 +0000 @@ -58,6 +58,7 @@ #include #include #include +#include #include "xf86drm.h" #include "xf86drmMode.h" @@ -112,6 +113,7 @@ static char *dmi_product_version_path = NULL; static char *nvidia_driver_version_path = NULL; static char *modprobe_d_path = NULL; +static char *custom_hook_path = NULL; static char *main_arch_path = NULL; static char *other_arch_path = NULL; static prime_intel_drv prime_intel_driver = SNA; @@ -635,7 +637,7 @@ else { snprintf(command, sizeof(command), "update-alternatives --list %s_%s_conf", - alternative_pattern, arch_path); + arch_path, alternative_pattern); /* Make sure we don't catch prime by mistake when * looking for nvidia @@ -1191,6 +1193,155 @@ } +static bool copy_file(const char *src_path, const char *dst_path) +{ + _cleanup_fclose_ FILE *src = NULL; + _cleanup_fclose_ FILE *dst = NULL; + int src_fd, dst_fd; + int n = 0; + char buf[BUFSIZ]; + + src = fopen(src_path, "r"); + if (src == NULL) { + fprintf(log_handle, "error: can't open %s for reading\n", src_path); + return false; + } + + dst = fopen(dst_path, "w"); + if (dst == NULL) { + fprintf(log_handle, "error: can't open %s for writing.\n", + dst_path); + return false; + } + + src_fd = fileno(src); + dst_fd = fileno(dst); + + fprintf(log_handle, "copying %s to %s...\n", src_path, dst_path); + + while ((n = read(src_fd, buf, BUFSIZ)) > 0) + if (write(dst_fd, buf, n) != n) { + fprintf(log_handle, "write error on file %s\n", dst_path); + return false; + } + + fprintf(log_handle, "%s was copied successfully to %s\n", src_path, dst_path); + return true; +} + + +static bool get_custom_hook_name(const char *pattern, char **path) +{ + /* Let's accept non exact names only for testing purposes */ + if (dry_run) { + DIR *dir; + struct dirent* dir_entry; + + if (NULL == (dir = opendir(custom_hook_path))) { + fprintf(log_handle, "Error : Failed to open %s\n", custom_hook_path); + return false; + } + + /* Keep looking until we find the custom hook with the same + * name pattern + */ + while ((dir_entry = readdir(dir))) { + if (!starts_with(dir_entry->d_name, pattern)) + continue; + + *path = malloc(strlen(custom_hook_path) + strlen(dir_entry->d_name) + 2); + if (!*path) + return false; + fprintf(log_handle, "dir entry: %s\n", dir_entry->d_name); + snprintf(*path, sizeof(char) * (strlen(custom_hook_path) + strlen(dir_entry->d_name) + 2), "%s/%s", custom_hook_path, dir_entry->d_name); + break; + } + closedir(dir); + if (!*path) + return false; + } + else { + *path = malloc(strlen(custom_hook_path) + strlen(pattern) + 2); + if (!*path) + return false; + + snprintf(*path, sizeof(char) * (strlen(custom_hook_path) + strlen(pattern) + 2), "%s/%s", + custom_hook_path, pattern); + } + + return true; +} + +static bool has_custom_hook(const char *filename) +{ + _cleanup_free_ char *path = NULL; + + bool status = get_custom_hook_name(filename, &path); + + return (status ? exists_not_empty(path) : false); +} + + +static bool has_non_hybrid_conf_file(void) +{ + return has_custom_hook("non-hybrid"); +} + + +static bool has_hybrid_performance_conf_file(void) +{ + return has_custom_hook("hybrid-performance"); +} + + +static bool has_hybrid_power_saving_conf_file(void) +{ + return has_custom_hook("hybrid-power-saving"); +} + + +static bool has_force_dgpu_on_file(void) +{ + _cleanup_free_ char *path = NULL; + bool result = false; + if (get_custom_hook_name("force-dgpu-on", &path)) { + result = is_file(path); + if (result) + fprintf(log_handle, "force-dgpu-on: %s\n", path); + } + + return result; +} + + +static bool copy_custom_xorg_conf(const char *filename) +{ + _cleanup_free_ char *path = NULL; + + get_custom_hook_name(filename, &path); + + return copy_file(path, xorg_conf_file); +} + + +static bool set_non_hybrid_xorg_conf(void) +{ + return copy_custom_xorg_conf("non-hybrid"); +} + + +static bool set_hybrid_performance_xorg_conf(void) +{ + return copy_custom_xorg_conf("hybrid-performance"); +} + + +static bool set_hybrid_power_saving_xorg_conf(void) +{ + return copy_custom_xorg_conf("hybrid-power-saving"); +} + + /* Write the xorg.conf for a multiamd system * using fglrx */ @@ -1970,7 +2121,6 @@ static bool prime_set_discrete(int mode) { _cleanup_fclose_ FILE *file = NULL; - file = fopen(bbswitch_path, "w"); if (!file) return false; @@ -1985,42 +2135,63 @@ static bool prime_enable_discrete() { bool status = false; - /* Set bbswitch */ - status = prime_set_discrete(1); + /* See if there is a custom hook to disable power saving */ + bool force_dgpu_on = has_force_dgpu_on_file(); + + /* No need to set bbswitch if we want to keep + * the dGPU on + */ + if (!force_dgpu_on) + /* Set bbswitch */ + status = prime_set_discrete(1); + else + status = true; /* Load the module */ if (status) { /* This may not be available */ load_module("nvidia-modeset"); + /* drm depends on modeset */ + load_module("nvidia-drm"); + status = load_module("nvidia"); } return status; } - /* Power off the NVIDIA discrete card */ -static bool prime_disable_discrete() { +static bool prime_disable_discrete(const int nvidia_version) { bool status = false; + char command[100]; - /* Tell nvidia-persistenced the nvidia card is about - * to be switched off - */ - if (!dry_run) - system("/sbin/initctl emit nvidia-off"); + /* See if there is a custom hook to disable power saving */ + bool force_dgpu_on = has_force_dgpu_on_file(); + + /* Disable persistence mode (just in case) */ + sprintf(command, "LD_LIBRARY_PATH=\"/usr/lib/nvidia-%d\" /usr/bin/nvidia-smi -pm 0", + nvidia_version); + fprintf(log_handle, "Disabling persistence mode\n"); + system(command); /* Unload nvidia-uvm or nvidia won't be unloaded */ unload_module("nvidia-uvm"); + /* Unload nvidia-drm or nvidia won't be unloaded */ + unload_module("nvidia-drm"); + /* Unload nvidia-modeset or nvidia won't be unloaded */ unload_module("nvidia-modeset"); /* Unload the module */ status = unload_module("nvidia"); - /* Set bbswitch */ - if (status) - status = prime_set_discrete(0); + /* Set bbswitch, but No need for any further action if we want to keep + * the dGPU on + */ + if (status && !force_dgpu_on) { + status = prime_set_discrete(0); + } return status; } @@ -2443,89 +2614,61 @@ } -/* Count the number of outputs connected to the card */ -int count_connected_outputs(int fd, drmModeResPtr res) { - int i; - int connected_outputs = 0; - drmModeConnectorPtr connector; +/* Check the drm connector status */ +static bool is_connector_connected(const char *connector) { + bool status = false; + char line[50]; + _cleanup_fclose_ FILE *file = NULL; - for (i = 0; i < res->count_connectors; i++) { - connector = drmModeGetConnector(fd, res->connectors[i]); + file = fopen(connector, "r"); - if (connector) { - switch (connector->connection) { - case DRM_MODE_CONNECTED: - fprintf(log_handle, "output %d:\n", connected_outputs); - connected_outputs += 1; + if (!file) + return false; - switch (connector->connector_type) { - case DRM_MODE_CONNECTOR_Unknown: - fprintf(log_handle, "\tunknown connector\n"); - break; - case DRM_MODE_CONNECTOR_VGA: - fprintf(log_handle, "\tVGA connector\n"); - break; - case DRM_MODE_CONNECTOR_DVII: - fprintf(log_handle, "\tDVII connector\n"); - break; - case DRM_MODE_CONNECTOR_DVID: - fprintf(log_handle, "\tDVID connector\n"); - break; - case DRM_MODE_CONNECTOR_DVIA: - fprintf(log_handle, "\tDVIA connector\n"); - break; - case DRM_MODE_CONNECTOR_Composite: - fprintf(log_handle, "\tComposite connector\n"); - break; - case DRM_MODE_CONNECTOR_SVIDEO: - fprintf(log_handle, "\tSVIDEO connector\n"); - break; - case DRM_MODE_CONNECTOR_LVDS: - fprintf(log_handle, "\tLVDS connector\n"); - break; - case DRM_MODE_CONNECTOR_Component: - fprintf(log_handle, "\tComponent connector\n"); - break; - case DRM_MODE_CONNECTOR_9PinDIN: - fprintf(log_handle, "\t9PinDIN connector\n"); - break; - case DRM_MODE_CONNECTOR_DisplayPort: - fprintf(log_handle, "\tDisplayPort connector\n"); - break; - case DRM_MODE_CONNECTOR_HDMIA: - fprintf(log_handle, "\tHDMIA connector\n"); - break; - case DRM_MODE_CONNECTOR_HDMIB: - fprintf(log_handle, "\tHDMIB connector\n"); - break; - case DRM_MODE_CONNECTOR_TV: - fprintf(log_handle, "\tTV connector\n"); - break; - case DRM_MODE_CONNECTOR_eDP: - fprintf(log_handle, "\teDP connector\n"); - break; -#if 0 - case DRM_MODE_CONNECTOR_VIRTUAL: - fprintf(log_handle, "VIRTUAL connector\n"); - break; - case DRM_MODE_CONNECTOR_DSI: - fprintf(log_handle, "DSI connector\n"); - break; -#endif - default: - break; - } + while (fgets(line, sizeof(line), file)) { + char *tok; + tok = strtok(line, " \t"); + if (starts_with(tok, "connected")) { + status = true; + break; + } + } + return status; +} - break; - case DRM_MODE_DISCONNECTED: - break; - default: - break; + +/* Count the number of outputs connected to the card */ +int count_connected_outputs(const char *device_name) { + char name[50]; + struct dirent *dp; + DIR *dfd; + int connected_outputs = 0; + char drm_dir[] = "/sys/class/drm"; + + if ((dfd = opendir(drm_dir)) == NULL) { + fprintf(stderr, "Warning: can't open %s\n", drm_dir); + return connected_outputs; + } + + while ((dp = readdir(dfd)) != NULL) { + if (!starts_with(dp->d_name, device_name)) + continue; + if (strlen(drm_dir)+strlen(dp->d_name)+2 > sizeof(name)) + fprintf(stderr, "Warning: name %s/%s too long\n", + drm_dir, dp->d_name); + else { + /* Open the file for the connector */ + sprintf(name, "%s/%s/status", drm_dir, dp->d_name); + if (is_connector_connected(name)) { + fprintf(log_handle, "output %d:\n", connected_outputs); + fprintf(log_handle, "\t%s\n", dp->d_name); + connected_outputs++; } - drmModeFreeConnector(connector); } } + closedir(dfd); + return connected_outputs; } @@ -2538,11 +2681,11 @@ struct dirent* dir_entry; char path[20]; int fd = 1; - drmModeResPtr res; drmVersionPtr version; int connected_outputs = 0; int driver_match = 0; char dri_dir[] = "/dev/dri"; + _cleanup_free_ char *device_path= NULL; if (NULL == (dir = opendir(dri_dir))) { fprintf(log_handle, "Error : Failed to open %s\n", dri_dir); @@ -2565,6 +2708,9 @@ fprintf(log_handle, "Found \"%s\", driven by \"%s\"\n", path, version->name); driver_match = 1; + device_path = malloc(strlen(dir_entry->d_name)+1); + if (device_path) + strcpy(device_path, dir_entry->d_name); drmFreeVersion(version); break; } @@ -2584,25 +2730,18 @@ closedir(dir); + close(fd); + if (!driver_match) return -1; - res = drmModeGetResources(fd); - if (!res) { - fprintf(log_handle, "Error: can't get drm resources.\n"); - drmClose(fd); + if (!device_path) return -1; - } - - connected_outputs = count_connected_outputs(fd, res); + connected_outputs = count_connected_outputs(device_path); fprintf(log_handle, "Number of connected outputs for %s: %d\n", path, connected_outputs); - drmModeFreeResources(res); - - close(fd); - return (connected_outputs > 0); } @@ -2832,10 +2971,17 @@ /* Remove xorg.conf */ remove_xorg_conf(); - /* Only useful if more than one card is available */ - if (cards_n > 1) { - /* Write xorg.conf */ - write_to_xorg_conf(devices, cards_n, vendor_id, NULL); + /* Use custom xorg.conf for non hybrid systems */ + if (has_non_hybrid_conf_file()) { + fprintf(log_handle, "Custom non-hybrid xorg.conf detected\n"); + set_non_hybrid_xorg_conf(); + } + else { + /* Only useful if more than one card is available */ + if (cards_n > 1) { + /* Write xorg.conf */ + write_to_xorg_conf(devices, cards_n, vendor_id, NULL); + } } } else { @@ -2904,17 +3050,73 @@ } +static char* get_module_version(const char *module_name) { + struct kmod_ctx *ctx = NULL; + struct kmod_module *mod = NULL; + struct kmod_list *l, *list = NULL; + int err; + char *version = NULL; + + ctx = kmod_new(NULL, NULL); + err = kmod_module_new_from_name(ctx, module_name, &mod); + if (err < 0) { + fprintf(log_handle, "can't acquire module via kmod"); + goto get_module_version_clean; + } + + err = kmod_module_get_info(mod, &list); + if (err < 0) { + fprintf(log_handle, "can't get module info via kmod"); + goto get_module_version_clean; + } + + kmod_list_foreach(l, list) { + const char *key = kmod_module_info_get_key(l); + + if (strcmp(key, "version") == 0) { + version = strdup(kmod_module_info_get_value(l)); + break; + } + } + +get_module_version_clean: + if (list) + kmod_module_info_free_list(list); + if (mod) + kmod_module_unref(mod); + if (ctx) + kmod_unref(ctx); + + return version; +} + + +static bool has_module_versioned(const char *module_name) { + _cleanup_free_ const char *version = NULL; + + version = get_module_version(module_name); + + return version ? true : false; +} + + static bool enable_prime(const char *prime_settings, bool bbswitch_loaded, unsigned int vendor_id, struct alternatives *alternative, struct device **devices, int cards_n) { - int major, minor; + int major = 0, minor = 0; bool bbswitch_status = true, has_version = false; bool prime_discrete_on = false; bool prime_action_on = false; + /* See if there is a custom hook to disable power saving */ + bool force_dgpu_on = has_force_dgpu_on_file(); + + fprintf(log_handle, "force-dgpu-on hook %s\n", + (force_dgpu_on ? "on" : "off")); + /* We only support Lightdm and GDM at this time */ if (!(is_lightdm_default() || is_gdm_default() || is_sddm_default())) { fprintf(log_handle, "Neither Lightdm nor GDM is the default display " @@ -2966,7 +3168,11 @@ /* Get the current status from bbswitch */ prime_discrete_on = !bbswitch_status ? true : prime_is_discrete_nvidia_on(); - /* Get the current settings for discrete */ + + /* Get the current settings for discrete + * Note: the force-dgpu-on hook overrides this, and always + * forces the dGPU to be on + */ prime_action_on = prime_is_action_on(); if (prime_action_on) { @@ -2975,16 +3181,23 @@ enable_nvidia(alternative, vendor_id, devices, cards_n); } - if (!check_prime_xorg_conf(devices, cards_n)) { - fprintf(log_handle, "Check failed\n"); - - /* Remove xorg.conf */ - remove_xorg_conf(); - /* Write xorg.conf */ - write_prime_xorg_conf(devices, cards_n); + /* Use custom xorg.conf for performance mode on hybrid systems */ + if (has_hybrid_performance_conf_file()) { + fprintf(log_handle, "Custom hybrid performance xorg.conf detected\n"); + set_hybrid_performance_xorg_conf(); } else { - fprintf(log_handle, "No need to modify xorg.conf. Path: %s\n", xorg_conf_file); + if (!check_prime_xorg_conf(devices, cards_n)) { + fprintf(log_handle, "Check failed\n"); + + /* Remove xorg.conf */ + remove_xorg_conf(); + /* Write xorg.conf */ + write_prime_xorg_conf(devices, cards_n); + } + else { + fprintf(log_handle, "No need to modify xorg.conf. Path: %s\n", xorg_conf_file); + } } } else { @@ -2996,8 +3209,15 @@ /* Remove xorg.conf */ remove_xorg_conf(); + + /* Use custom xorg.conf for power saving mode on hybrid systems */ + if (has_hybrid_power_saving_conf_file()) { + fprintf(log_handle, "Custom hybrid power saving xorg.conf detected\n"); + set_hybrid_power_saving_xorg_conf(); + } } + /* This means we need to call bbswitch * to take action */ @@ -3014,10 +3234,11 @@ } else { fprintf(log_handle, "Powering off the discrete card\n"); - prime_disable_discrete(); + prime_disable_discrete(major); } } +end: return true; } @@ -3219,12 +3440,13 @@ {"dmi-product-name-path", required_argument, 0, 'i'}, {"nvidia-driver-version-path", required_argument, 0, 'j'}, {"modprobe-d-path", required_argument, 0, 'k'}, + {"custom-hook-path", required_argument, 0, 't'}, {0, 0, 0, 0} }; /* getopt_long stores the option index here. */ int option_index = 0; - opt = getopt_long (argc, argv, "a:b:c:d:f:g:h:i:j:k:l:m:n:o:p:q:r:s:x:y:z:", + opt = getopt_long (argc, argv, "a:b:c:d:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:x:y:z:", long_options, &option_index); /* Detect the end of the options. */ @@ -3403,6 +3625,11 @@ if (!modprobe_d_path) abort(); break; + case 't': + custom_hook_path = strdup(optarg); + if (!custom_hook_path) + abort(); + break; case '?': /* getopt_long already printed an error message. */ exit(1); @@ -3562,6 +3789,16 @@ } } + if (custom_hook_path) + fprintf(log_handle, "custom_hook_path: %s\n", custom_hook_path); + else { + custom_hook_path = strdup("/usr/share/gpu-manager.d"); + if (!custom_hook_path) { + fprintf(log_handle, "Couldn't allocate custom_hook_path\n"); + goto end; + } + } + if (fake_modules_path) fprintf(log_handle, "fake_modules_path file: %s\n", fake_modules_path); @@ -4248,6 +4485,10 @@ if (alternative) { if (alternative->current) free(alternative->current); + if (alternative->current_core) + free(alternative->current_core); + if (alternative->current_egl) + free(alternative->current_egl); free(alternative); } @@ -4287,6 +4528,9 @@ if (modprobe_d_path) free(modprobe_d_path); + if (custom_hook_path) + free(custom_hook_path); + /* Free the devices structs */ for(i = 0; i < cards_n; i++) { free(current_devices[i]); diff -Nru ubuntu-drivers-common-0.4.17/share/hybrid/Makefile ubuntu-drivers-common-0.4.17.7/share/hybrid/Makefile --- ubuntu-drivers-common-0.4.17/share/hybrid/Makefile 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/share/hybrid/Makefile 2017-10-30 14:45:01.000000000 +0000 @@ -3,7 +3,7 @@ PROGRAM = gpu-manager PROGRAM_FILES = gpu-manager.c CC = gcc -CFLAGS =-g -Wall $(shell pkg-config --cflags --libs pciaccess libdrm) +CFLAGS =-g -Wall $(shell pkg-config --cflags --libs pciaccess libdrm libkmod) all: build diff -Nru ubuntu-drivers-common-0.4.17/tests/gpu-manager.py ubuntu-drivers-common-0.4.17.7/tests/gpu-manager.py --- ubuntu-drivers-common-0.4.17/tests/gpu-manager.py 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/tests/gpu-manager.py 2018-01-03 11:53:51.000000000 +0000 @@ -8,6 +8,7 @@ # (at your option) any later version. import os +import glob import time import unittest import subprocess @@ -66,7 +67,12 @@ has_added_gpu_from_file=False, proprietary_installer=False, matched_quirk=False, - loaded_with_args=False): + loaded_with_args=False, + has_custom_xorg_non_hybrid=False, + has_custom_xorg_hybrid_performance=False, + has_custom_xorg_hybrid_power_saving=False, + copied_custom_xorg=False, + has_force_dgpu_on_hook=False): self.has_single_card = has_single_card self.requires_offloading = requires_offloading self.has_intel = has_intel @@ -104,6 +110,11 @@ self.proprietary_installer = proprietary_installer self.matched_quirk = matched_quirk self.loaded_with_args = loaded_with_args + self.has_custom_xorg_non_hybrid = has_custom_xorg_non_hybrid + self.has_custom_xorg_hybrid_performance = has_custom_xorg_hybrid_performance + self.has_custom_xorg_hybrid_power_saving = has_custom_xorg_hybrid_power_saving + self.copied_custom_xorg = copied_custom_xorg + self.has_force_dgpu_on_hook = has_force_dgpu_on_hook class GpuManagerTest(unittest.TestCase): @@ -116,6 +127,15 @@ klass.new_boot_file.close() klass.xorg_file = tempfile.NamedTemporaryFile(mode='w', prefix='xorg_file_', dir=tests_path, delete=False) klass.xorg_file.close() + + klass.xorg_non_hybrid_file = tempfile.NamedTemporaryFile(mode='w', prefix='non-hybrid_', dir=tests_path, delete=False) + klass.xorg_non_hybrid_file.close() + klass.xorg_hybrid_performance_file = tempfile.NamedTemporaryFile(mode='w', prefix='hybrid-performance_', dir=tests_path, delete=False) + klass.xorg_hybrid_performance_file.close() + klass.xorg_hybrid_power_saving_file = tempfile.NamedTemporaryFile(mode='w', prefix='hybrid-power-saving_', dir=tests_path, delete=False) + klass.xorg_hybrid_power_saving_file.close() + klass.custom_hook_path = tests_path or "/tmp" + klass.amd_pcsdb_file = tempfile.NamedTemporaryFile(mode='w', prefix='amd_pcsdb_file_', dir=tests_path, delete=False) klass.amd_pcsdb_file.close() klass.fake_lspci = tempfile.NamedTemporaryFile(mode='w', prefix='fake_lspci_', dir=tests_path, delete=False) @@ -175,6 +195,9 @@ klass.matched_quirk_pt = re.compile('Found matching quirk.*') klass.loaded_with_args_pt = re.compile('Loading (.+) with \"(.+)\" parameters.*') klass.has_added_gpu_from_file = re.compile('Adding GPU from file: (.+)') + klass.copied_custom_xorg_pt = re.compile('(.+) was copied successfully to.*') + klass.has_custom_xorg_pt = re.compile('Custom (.+) xorg.conf detected.*') + klass.has_force_dgpu_on_hook_pt = re.compile('force-dgpu-on hook (.+).*') klass.vendors = {'amd': 0x1002, 'nvidia': 0x10de, 'intel': 0x8086, 'unknown': 0x1016} @@ -193,12 +216,14 @@ ''' self.remove_xorg_conf() self.remove_modprobe_d_path() + self.remove_force_dgpu_on_hook() #self.remove_amd_pcsdb_file() def tearDown(self): print('%s over\n' % self.this_function_name) # Remove all the logs self.handle_logs(delete=True) + self.remove_force_dgpu_on_hook() def cp_to_target_dir(self, filename): try: @@ -218,6 +243,11 @@ except: pass + def remove_force_dgpu_on_hook(self): + for filename in glob.glob(os.path.join((tests_path or '/tmp'), "force-dgpu-on*")): + print('Removing hook: %s' % filename) + os.unlink(filename) + def remove_amd_pcsdb_file(self): try: os.unlink(self.amd_pcsdb_file.name) @@ -275,6 +305,9 @@ self.modprobe_d_path, self.log, self.xorg_file, + self.xorg_non_hybrid_file, + self.xorg_hybrid_performance_file, + self.xorg_hybrid_power_saving_file, self.amd_pcsdb_file, self.valgrind_log): try: @@ -321,6 +354,8 @@ self.fake_lspci.name, '--xorg-conf-file', self.xorg_file.name, + '--custom-hook-path', + self.custom_hook_path, '--amd-pcsdb-file', self.amd_pcsdb_file.name, '--fake-alternative', @@ -424,6 +459,9 @@ has_skipped_hybrid = self.has_skipped_hybrid_pt.match(line) proprietary_installer = self.proprietary_installer_pt.match(line) has_added_gpu_from_file = self.has_added_gpu_from_file.match(line) + copied_custom_xorg = self.copied_custom_xorg_pt.match(line) + has_custom_xorg = self.has_custom_xorg_pt.match(line) + has_force_dgpu_on_hook = self.has_force_dgpu_on_hook_pt.match(line) # Detect the vendor if has_changed: @@ -526,6 +564,17 @@ if (loaded_with_args.group(1) == 'bbswitch' and loaded_with_args.group(2) != 'no'): gpu_test.loaded_with_args = True + elif copied_custom_xorg: + gpu_test.copied_custom_xorg = True + elif has_custom_xorg: + if has_custom_xorg.group(1) == 'hybrid performance': + gpu_test.has_custom_xorg_hybrid_performance = True + elif has_custom_xorg.group(1) == 'hybrid power saving': + gpu_test.has_custom_xorg_hybrid_power_saving = True + elif has_custom_xorg.group(1) == 'non-hybrid': + gpu_test.has_custom_xorg_non_hybrid = True + elif has_force_dgpu_on_hook: + gpu_test.has_force_dgpu_on_hook = (has_force_dgpu_on_hook.group(1) == 'on') # Close the log log.close() @@ -558,6 +607,9 @@ # Remove the modprobe.d path self.remove_modprobe_d_path() + # Remove the force-dgpu-on hook + self.remove_force_dgpu_on_hook() + return gpu_test def _add_pci_ids(self, ids): @@ -12712,6 +12764,127 @@ # No further action is required self.assertTrue(gpu_test.has_not_acted) + def test_desktop_one_nvidia_binary_preserve_custom_xorg_conf(self): + self.this_function_name = sys._getframe().f_code.co_name + + # Make sure the custom xorg.conf is not removed on first boot + # i.e. the first time (ever) gpu-manager runs + # + # Note the system won't detect the non-hybrid xorg.conf in this case + custom_xorg_file_path = os.path.join(self.custom_hook_path, 'non-hybrid') + custom_xorg_file = open(self.xorg_non_hybrid_file.name, 'w') + custom_xorg_file.write(''' +Section "Device" + Identifier "Default Card 1" + BusID "PCI:1@0:0:0" +EndSection +'''); + custom_xorg_file.close() + + gpu_test = self.run_manager_and_get_data(['nvidia'], + ['nvidia'], + ['nvidia'], + ['mesa', 'nvidia'], + 'nvidia', + first_boot=True) + + + # Check if laptop + self.assertFalse(gpu_test.requires_offloading) + + self.assertTrue(gpu_test.has_single_card) + + # Intel + self.assertFalse(gpu_test.has_intel) + self.assertFalse(gpu_test.intel_loaded) + + # Mesa is not enabled + self.assertFalse(gpu_test.mesa_enabled) + # AMD + self.assertFalse(gpu_test.has_amd) + self.assertFalse(gpu_test.radeon_loaded) + self.assertFalse(gpu_test.amdgpu_loaded) + self.assertFalse(gpu_test.fglrx_loaded) + self.assertFalse(gpu_test.fglrx_enabled) + self.assertFalse(gpu_test.pxpress_enabled) + # NVIDIA + self.assertTrue(gpu_test.has_nvidia) + self.assertFalse(gpu_test.nouveau_loaded) + self.assertTrue(gpu_test.nvidia_loaded) + self.assertTrue(gpu_test.nvidia_enabled) + # Has changed + self.assertTrue(gpu_test.has_changed) + self.assertFalse(gpu_test.has_removed_xorg) + self.assertFalse(gpu_test.has_regenerated_xorg) + self.assertFalse(gpu_test.has_custom_xorg_hybrid_power_saving) + self.assertFalse(gpu_test.has_custom_xorg_hybrid_performance) + # The system won't check the xorg.conf + #self.assertTrue(gpu_test.has_custom_xorg_non_hybrid) + self.assertFalse(gpu_test.copied_custom_xorg) + self.assertFalse(gpu_test.has_selected_driver) + # No further action is required + self.assertTrue(gpu_test.has_not_acted) + + + # A configuration change is needed, as the system was using mesa + # instead of nvidia. + # + # Check that the custom xorg.conf is actually copied. + custom_xorg_file_path = os.path.join(self.custom_hook_path, 'non-hybrid') + custom_xorg_file = open(self.xorg_non_hybrid_file.name, 'w') + custom_xorg_file.write(''' +Section "Device" + Identifier "Default Card 1" + BusID "PCI:1@0:0:0" + Option "ConstrainCursor" "off" +EndSection +'''); + custom_xorg_file.close() + + gpu_test = self.run_manager_and_get_data(['nvidia'], + ['nvidia'], + ['nvidia'], + ['mesa', 'nvidia'], + 'mesa', + first_boot=True) + + + # Check if laptop + self.assertFalse(gpu_test.requires_offloading) + + self.assertTrue(gpu_test.has_single_card) + + # Intel + self.assertFalse(gpu_test.has_intel) + self.assertFalse(gpu_test.intel_loaded) + + # Mesa is enabled + self.assertTrue(gpu_test.mesa_enabled) + # AMD + self.assertFalse(gpu_test.has_amd) + self.assertFalse(gpu_test.radeon_loaded) + self.assertFalse(gpu_test.amdgpu_loaded) + self.assertFalse(gpu_test.fglrx_loaded) + self.assertFalse(gpu_test.fglrx_enabled) + self.assertFalse(gpu_test.pxpress_enabled) + # NVIDIA + self.assertTrue(gpu_test.has_nvidia) + self.assertFalse(gpu_test.nouveau_loaded) + self.assertTrue(gpu_test.nvidia_loaded) + self.assertFalse(gpu_test.nvidia_enabled) + # Has changed + self.assertTrue(gpu_test.has_changed) + self.assertTrue(gpu_test.has_removed_xorg) + self.assertFalse(gpu_test.has_regenerated_xorg) + self.assertFalse(gpu_test.has_custom_xorg_hybrid_power_saving) + self.assertFalse(gpu_test.has_custom_xorg_hybrid_performance) + self.assertTrue(gpu_test.has_custom_xorg_non_hybrid) + self.assertTrue(gpu_test.copied_custom_xorg) + self.assertTrue(gpu_test.has_selected_driver) + # No further action is required + self.assertFalse(gpu_test.has_not_acted) + + def test_disabled_gpu_detection(self): self.this_function_name = sys._getframe().f_code.co_name @@ -12770,6 +12943,189 @@ self.assertTrue(gpu_test.has_added_gpu_from_file) + def test_laptop_one_intel_one_nvidia_binary_custom_xorg_conf(self): + '''laptop: intel + nvidia''' + self.this_function_name = sys._getframe().f_code.co_name + + # Case 1a: the discrete card is now available (BIOS) + # the driver is enabled and the module is loaded + # HYBRID PERFORMANCE MODE + + # Set dmi product version + self.set_dmi_product_version('ThinkPad T410s') + + # Set default quirks + self.set_bbswitch_quirks() + + custom_xorg_file = open(self.xorg_hybrid_performance_file.name, 'w') + + custom_xorg_file.write(''' +Section "ServerLayout" + Identifier "layout" + Screen 0 "nvidia" + Inactive "intel" +EndSection + +Section "Device" + Identifier "intel" + Driver "modesetting" + BusID "PCI:0@0:2:0" + Option "AccelMethod" "None" +EndSection + +Section "Screen" + Identifier "intel" + Device "intel" +EndSection + +Section "Device" + Identifier "nvidia" + Driver "nvidia" + BusID "PCI:1@0:0:0" + Option "ConstrainCursor" "off" +EndSection + +Section "Screen" + Identifier "nvidia" + Device "nvidia" + Option "AllowEmptyInitialConfiguration" "on" + Option "IgnoreDisplayDevices" "CRT" +EndSection + ''') + custom_xorg_file.close() + + + # Set default bbswitch status + self.set_prime_discrete_default_status_on(True) + + # Request action from bbswitch + self.request_prime_discrete_on(True) + + gpu_test = self.run_manager_and_get_data(['intel'], + ['intel', 'nvidia'], + ['i915', 'nvidia'], + ['mesa', 'nvidia'], + 'nvidia', + requires_offloading=True) + + # Check the variables + + # Check quirks + self.assertTrue(gpu_test.matched_quirk) + self.assertTrue(gpu_test.loaded_with_args) + + # Check if laptop + self.assertTrue(gpu_test.requires_offloading) + + self.assertFalse(gpu_test.has_single_card) + + # Intel + self.assertTrue(gpu_test.has_intel) + self.assertTrue(gpu_test.intel_loaded) + + # Mesa is not enabled + self.assertFalse(gpu_test.mesa_enabled) + # No AMD + self.assertFalse(gpu_test.has_amd) + self.assertFalse(gpu_test.radeon_loaded) + self.assertFalse(gpu_test.amdgpu_loaded) + self.assertFalse(gpu_test.fglrx_loaded) + self.assertFalse(gpu_test.fglrx_enabled) + self.assertFalse(gpu_test.pxpress_enabled) + # NVIDIA + self.assertTrue(gpu_test.has_nvidia) + self.assertFalse(gpu_test.nouveau_loaded) + self.assertTrue(gpu_test.nvidia_loaded) + self.assertTrue(gpu_test.nvidia_enabled) + # Has changed + self.assertTrue(gpu_test.has_changed) + self.assertFalse(gpu_test.has_removed_xorg) + self.assertFalse(gpu_test.has_regenerated_xorg) + self.assertFalse(gpu_test.has_custom_xorg_hybrid_power_saving) + self.assertTrue(gpu_test.has_custom_xorg_hybrid_performance) + self.assertFalse(gpu_test.has_custom_xorg_non_hybrid) + self.assertFalse(gpu_test.has_selected_driver) + + # No further action is required + self.assertTrue(gpu_test.has_not_acted) + + + # Case 1b: the discrete card was already available (BIOS) + # prime is enabled and the module is loaded + # HYBRID POWER SAVING MODE + + custom_xorg_file_path = os.path.join(self.custom_hook_path, 'hybrid-power-saving') + custom_xorg_file = open(self.xorg_hybrid_power_saving_file.name, 'w') + + custom_xorg_file.write(''' +Section "Device" + Identifier "intel" + Driver "modesetting" + BusID "PCI:0@0:2:0" + Option "AccelMethod" "UXA" +EndSection + ''') + custom_xorg_file.close() + + + # Set default bbswitch status + self.set_prime_discrete_default_status_on(True) + + # Request action from bbswitch + self.request_prime_discrete_on(False) + + gpu_test = self.run_manager_and_get_data(['intel', 'nvidia'], + ['intel', 'nvidia'], + ['i915', 'nvidia'], + ['mesa', 'nvidia'], + 'prime', + requires_offloading=True, + enabled_egl_driver='prime', + egl_alternatives=True) + + # Check the variables + + # Check if laptop + self.assertTrue(gpu_test.requires_offloading) + + self.assertFalse(gpu_test.has_single_card) + + # Intel + self.assertTrue(gpu_test.has_intel) + self.assertTrue(gpu_test.intel_loaded) + + # Mesa is not enabled + self.assertFalse(gpu_test.mesa_enabled) + self.assertFalse(gpu_test.mesa_egl_enabled) + # No AMD + self.assertFalse(gpu_test.has_amd) + self.assertFalse(gpu_test.radeon_loaded) + self.assertFalse(gpu_test.amdgpu_loaded) + self.assertFalse(gpu_test.fglrx_loaded) + self.assertFalse(gpu_test.fglrx_enabled) + self.assertFalse(gpu_test.pxpress_enabled) + # NVIDIA + self.assertTrue(gpu_test.has_nvidia) + self.assertFalse(gpu_test.nouveau_loaded) + self.assertTrue(gpu_test.nvidia_loaded) + self.assertFalse(gpu_test.nvidia_enabled) + self.assertFalse(gpu_test.nvidia_egl_enabled) + self.assertTrue(gpu_test.prime_enabled) + self.assertTrue(gpu_test.prime_egl_enabled) + # Has changed + self.assertFalse(gpu_test.has_changed) + self.assertTrue(gpu_test.has_removed_xorg) + self.assertFalse(gpu_test.has_regenerated_xorg) + self.assertFalse(gpu_test.has_selected_driver) + self.assertTrue(gpu_test.has_custom_xorg_hybrid_power_saving) + self.assertFalse(gpu_test.has_custom_xorg_hybrid_performance) + self.assertFalse(gpu_test.has_custom_xorg_non_hybrid) + self.assertTrue(gpu_test.copied_custom_xorg) + + # No further action is required + self.assertFalse(gpu_test.has_not_acted) + + if __name__ == '__main__': if not '86' in os.uname()[4]: exit(0) Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/tests/__pycache__/0-test.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/tests/__pycache__/0-test.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/tests/__pycache__/gpu-manager.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/tests/__pycache__/gpu-manager.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/tests/__pycache__/quirkreader-test.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/tests/__pycache__/quirkreader-test.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/tests/__pycache__/settings.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/tests/__pycache__/settings.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/tests/__pycache__/testarchive.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/tests/__pycache__/testarchive.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/tests/__pycache__/ubuntu_drivers.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/tests/__pycache__/ubuntu_drivers.cpython-35.pyc differ diff -Nru ubuntu-drivers-common-0.4.17/tests/ubuntu_drivers.py ubuntu-drivers-common-0.4.17.7/tests/ubuntu_drivers.py --- ubuntu-drivers-common-0.4.17/tests/ubuntu_drivers.py 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/tests/ubuntu_drivers.py 2018-01-22 11:46:47.000000000 +0000 @@ -321,10 +321,14 @@ def test_system_modaliases_system(self): '''system_modaliases() for current system''' - del self.umockdev - res = UbuntuDrivers.detect.system_modaliases() - self.assertGreater(len(res), 3) - self.assertTrue(':' in list(res)[0]) + # Let's skip the test on s390x + if 's390x' in os.uname().machine: + self.assertTrue(True) + else: + del self.umockdev + res = UbuntuDrivers.detect.system_modaliases() + self.assertGreater(len(res), 3) + self.assertTrue(':' in list(res)[0]) def test_system_modalises_fake(self): '''system_modaliases() for fake sysfs''' diff -Nru ubuntu-drivers-common-0.4.17/UbuntuDrivers/detect.py ubuntu-drivers-common-0.4.17.7/UbuntuDrivers/detect.py --- ubuntu-drivers-common-0.4.17/UbuntuDrivers/detect.py 2016-04-12 09:03:47.000000000 +0000 +++ ubuntu-drivers-common-0.4.17.7/UbuntuDrivers/detect.py 2018-01-30 13:58:58.000000000 +0000 @@ -426,7 +426,7 @@ KMS). ''' # any package which matches any of those globs will be accepted - whitelist = ['bcmwl*', 'pvr-omap*', 'virtualbox-guest*', 'nvidia-*', '*-microcode'] + whitelist = ['bcmwl*', 'pvr-omap*', 'virtualbox-guest*', 'nvidia-*'] allow = [] for pattern in whitelist: allow.extend(fnmatch.filter(packages, pattern)) Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/UbuntuDrivers/__pycache__/detect.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/UbuntuDrivers/__pycache__/detect.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/UbuntuDrivers/__pycache__/__init__.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/UbuntuDrivers/__pycache__/__init__.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/UbuntuDrivers/__pycache__/kerneldetection.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/UbuntuDrivers/__pycache__/kerneldetection.cpython-35.pyc differ Binary files /tmp/tmp9brvor/hoxRaoEpSB/ubuntu-drivers-common-0.4.17/UbuntuDrivers/__pycache__/PackageKit.cpython-35.pyc and /tmp/tmp9brvor/8lJapdG3Lq/ubuntu-drivers-common-0.4.17.7/UbuntuDrivers/__pycache__/PackageKit.cpython-35.pyc differ