Date: Thursday, April 14, 2016 @ 22:48:54 Author: svenstaro Revision: 171087
upgpkg: bumblebee 3.2.1-11 Fix FS#47140 Added: bumblebee/trunk/0001-bb_nvidia_modeset-detection_bug699_01.patch bumblebee/trunk/0002-bb_nvidia_modeset-detection_bug699_02.patch bumblebee/trunk/0003-bb_nvidia_umv_detection_bug699.patch bumblebee/trunk/0004-bb_nvidia_drm_detection_bug699_01.patch bumblebee/trunk/0005-bb_nvidia_drm_detection_bug699_02.patch bumblebee/trunk/0006-bb_hexadicimal_bug573.patch bumblebee/trunk/0007-bb_mutebblogger.patch bumblebee/trunk/bumblebee.conf Modified: bumblebee/trunk/PKGBUILD --------------------------------------------------+ 0001-bb_nvidia_modeset-detection_bug699_01.patch | 24 ++++ 0002-bb_nvidia_modeset-detection_bug699_02.patch | 56 ++++++++++ 0003-bb_nvidia_umv_detection_bug699.patch | 76 ++++++++++++++ 0004-bb_nvidia_drm_detection_bug699_01.patch | 44 ++++++++ 0005-bb_nvidia_drm_detection_bug699_02.patch | 109 +++++++++++++++++++++ 0006-bb_hexadicimal_bug573.patch | 23 ++++ 0007-bb_mutebblogger.patch | 15 ++ PKGBUILD | 48 +++++---- bumblebee.conf | 6 + 9 files changed, 383 insertions(+), 18 deletions(-) Added: 0001-bb_nvidia_modeset-detection_bug699_01.patch =================================================================== --- 0001-bb_nvidia_modeset-detection_bug699_01.patch (rev 0) +++ 0001-bb_nvidia_modeset-detection_bug699_01.patch 2016-04-14 20:48:54 UTC (rev 171087) @@ -0,0 +1,24 @@ +From 5636b24fa86a005a5d2e30bd794516db13ccba56 Mon Sep 17 00:00:00 2001 +From: Abuzer Rafey <abu...@rafey.ch> +Date: Tue, 8 Dec 2015 07:00:32 -0500 +Subject: [PATCH] Dirty fix for issue #699 + +--- + src/module.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/module.c b/src/module.c +index f7b99fa..6b6cb09 100644 +--- a/src/module.c ++++ b/src/module.c +@@ -96,7 +96,9 @@ int module_unload(char *driver) { + int retries = 30; + bb_log(LOG_INFO, "Unloading %s driver\n", driver); + char *mod_argv[] = { +- "rmmod", ++ "modprobe", ++ "-r", ++ "nvidia_modeset", + driver, + NULL + }; Added: 0002-bb_nvidia_modeset-detection_bug699_02.patch =================================================================== --- 0002-bb_nvidia_modeset-detection_bug699_02.patch (rev 0) +++ 0002-bb_nvidia_modeset-detection_bug699_02.patch 2016-04-14 20:48:54 UTC (rev 171087) @@ -0,0 +1,56 @@ +From 09d537e8e5313cd0f2c7bf6620ca70454de8a04a Mon Sep 17 00:00:00 2001 +From: Abuzer Rafey <abu...@rafey.ch> +Date: Tue, 8 Dec 2015 12:01:05 -0500 +Subject: [PATCH] Added nvidia_modeset detection for issue #699 + +--- + src/module.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +diff --git a/src/module.c b/src/module.c +index 6b6cb09..eea0139 100644 +--- a/src/module.c ++++ b/src/module.c +@@ -92,13 +92,15 @@ int module_load(char *module_name, char *driver) { + * @return 1 if the driver is succesfully unloaded, 0 otherwise + */ + int module_unload(char *driver) { +- if (module_is_loaded(driver) == 1) { ++ ++ if (module_is_loaded(driver) == 1 && ++ module_is_loaded("nvidia_modeset") == 1) { + int retries = 30; + bb_log(LOG_INFO, "Unloading %s driver\n", driver); + char *mod_argv[] = { + "modprobe", + "-r", +- "nvidia_modeset", ++ "nvidia-modeset", + driver, + NULL + }; +@@ -111,6 +113,24 @@ int module_unload(char *driver) { + return 0; + } + } ++ else if (module_is_loaded(driver) == 1) { ++ int retries = 30; ++ bb_log(LOG_INFO, "Unloading %s driver\n", driver); ++ char *mod_argv[] = { ++ "modprobe", ++ "-r", ++ driver, ++ NULL ++ }; ++ bb_run_fork_wait(mod_argv, 10); ++ while (retries-- > 0 && module_is_loaded(driver) == 1) { ++ usleep(100000); ++ } ++ if (module_is_loaded(driver) == 1) { ++ bb_log(LOG_ERR, "Unloading %s driver timed out.\n", driver); ++ return 0; ++ } ++ } + return 1; + } + Added: 0003-bb_nvidia_umv_detection_bug699.patch =================================================================== --- 0003-bb_nvidia_umv_detection_bug699.patch (rev 0) +++ 0003-bb_nvidia_umv_detection_bug699.patch 2016-04-14 20:48:54 UTC (rev 171087) @@ -0,0 +1,76 @@ +From dbbf20a38aa2bffb10c4e8af583b34dff6bfe721 Mon Sep 17 00:00:00 2001 +From: Abuzer Rafey <abu...@rafey.ch> +Date: Wed, 9 Dec 2015 21:26:29 -0500 +Subject: [PATCH] Fix nvidia_uvm just like nvidia_modeset + +--- + src/module.c | 35 +++++++++++++++++++++++++++-------- + 1 file changed, 27 insertions(+), 8 deletions(-) + +diff --git a/src/module.c b/src/module.c +index eea0139..b5a4d79 100644 +--- a/src/module.c ++++ b/src/module.c +@@ -93,19 +93,18 @@ int module_load(char *module_name, char *driver) { + */ + int module_unload(char *driver) { + +- if (module_is_loaded(driver) == 1 && +- module_is_loaded("nvidia_modeset") == 1) { ++ if (module_is_loaded("nvidia_uvm") == 1) { + int retries = 30; +- bb_log(LOG_INFO, "Unloading %s driver\n", driver); ++ bb_log(LOG_INFO, "Unloading nvidia_uvm driver\n"); + char *mod_argv[] = { + "modprobe", + "-r", +- "nvidia-modeset", +- driver, ++ "nvidia_uvm", ++ "nvidia_modeset", + NULL + }; + bb_run_fork_wait(mod_argv, 10); +- while (retries-- > 0 && module_is_loaded(driver) == 1) { ++ while (retries-- > 0 && module_is_loaded("nvidia_uvm") == 1) { + usleep(100000); + } + if (module_is_loaded(driver) == 1) { +@@ -113,7 +112,27 @@ int module_unload(char *driver) { + return 0; + } + } +- else if (module_is_loaded(driver) == 1) { ++ ++ else if (module_is_loaded("nvidia_modeset") == 1) { ++ int retries = 30; ++ bb_log(LOG_INFO, "Unloading nvidia_modeset driver\n"); ++ char *mod_argv[] = { ++ "modprobe", ++ "-r", ++ "nvidia_modeset", ++ NULL ++ }; ++ bb_run_fork_wait(mod_argv, 10); ++ while (retries-- > 0 && module_is_loaded("nvidia_modeset") == 1) { ++ usleep(100000); ++ } ++ if (module_is_loaded(driver) == 1) { ++ bb_log(LOG_ERR, "Unloading %s driver timed out.\n", driver); ++ return 0; ++ } ++ } ++ ++ else if (module_is_loaded(driver) == 1) { + int retries = 30; + bb_log(LOG_INFO, "Unloading %s driver\n", driver); + char *mod_argv[] = { +@@ -130,7 +149,7 @@ int module_unload(char *driver) { + bb_log(LOG_ERR, "Unloading %s driver timed out.\n", driver); + return 0; + } +- } ++ } + return 1; + } + Added: 0004-bb_nvidia_drm_detection_bug699_01.patch =================================================================== --- 0004-bb_nvidia_drm_detection_bug699_01.patch (rev 0) +++ 0004-bb_nvidia_drm_detection_bug699_01.patch 2016-04-14 20:48:54 UTC (rev 171087) @@ -0,0 +1,44 @@ +From bcfe4dd16dd6194f1edbdc53b874a4f408343c5c Mon Sep 17 00:00:00 2001 +From: Abuzer Rafey <abu...@rafey.xyz> +Date: Wed, 13 Apr 2016 01:11:09 -0400 +Subject: [PATCH] Workaround for nvidia_drm in newer drivers + +--- + src/module.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/src/module.c b/src/module.c +index b5a4d79..db9736a 100644 +--- a/src/module.c ++++ b/src/module.c +@@ -113,6 +113,25 @@ int module_unload(char *driver) { + } + } + ++ else if (module_is_loaded("nvidia_drm") == 1) { ++ int retries = 30; ++ bb_log(LOG_INFO, "Unloading nvidia_drm driver\n"); ++ char *mod_argv[] = { ++ "modprobe", ++ "-r", ++ "nvidia_drm", ++ NULL ++ }; ++ bb_run_fork_wait(mod_argv, 10); ++ while (retries-- > 0 && module_is_loaded("nvidia_drm") == 1) { ++ usleep(100000); ++ } ++ if (module_is_loaded(driver) == 1) { ++ bb_log(LOG_ERR, "Unloading %s driver timed out.\n", driver); ++ return 0; ++ } ++ } ++ + else if (module_is_loaded("nvidia_modeset") == 1) { + int retries = 30; + bb_log(LOG_INFO, "Unloading nvidia_modeset driver\n"); +@@ -175,3 +194,4 @@ int module_is_available(char *module_name) { + }; + return bb_run_fork(mod_argv, 1) == EXIT_SUCCESS; + } ++ Added: 0005-bb_nvidia_drm_detection_bug699_02.patch =================================================================== --- 0005-bb_nvidia_drm_detection_bug699_02.patch (rev 0) +++ 0005-bb_nvidia_drm_detection_bug699_02.patch 2016-04-14 20:48:54 UTC (rev 171087) @@ -0,0 +1,109 @@ +From fcfe596eb13f62ca9dd7de272a5a87ae843b2a00 Mon Sep 17 00:00:00 2001 +From: Abuzer Rafey <abu...@rafey.xyz> +Date: Wed, 13 Apr 2016 03:09:12 -0400 +Subject: [PATCH] Simplify module_unload + +--- + src/module.c | 72 ++++++++++-------------------------------------------------- + 1 file changed, 12 insertions(+), 60 deletions(-) + +diff --git a/src/module.c b/src/module.c +index db9736a..38e2daa 100644 +--- a/src/module.c ++++ b/src/module.c +@@ -93,56 +93,27 @@ int module_load(char *module_name, char *driver) { + */ + int module_unload(char *driver) { + +- if (module_is_loaded("nvidia_uvm") == 1) { +- int retries = 30; +- bb_log(LOG_INFO, "Unloading nvidia_uvm driver\n"); +- char *mod_argv[] = { +- "modprobe", +- "-r", +- "nvidia_uvm", +- "nvidia_modeset", +- NULL +- }; +- bb_run_fork_wait(mod_argv, 10); +- while (retries-- > 0 && module_is_loaded("nvidia_uvm") == 1) { +- usleep(100000); +- } +- if (module_is_loaded(driver) == 1) { +- bb_log(LOG_ERR, "Unloading %s driver timed out.\n", driver); +- return 0; +- } +- } ++ char uvm[] = "nvidia_uvm"; ++ char drm[] = "nvidia_drm"; ++ char modeset[] = "nvidia_modeset"; ++ int uvm_is_loaded = module_is_loaded(uvm); ++ int drm_is_loaded = module_is_loaded(drm); ++ int modeset_is_loaded = module_is_loaded(modeset); + +- else if (module_is_loaded("nvidia_drm") == 1) { ++ if (uvm_is_loaded || drm_is_loaded || modeset_is_loaded || *driver == 1) { + int retries = 30; +- bb_log(LOG_INFO, "Unloading nvidia_drm driver\n"); ++ bb_log(LOG_INFO, "Unloading UVM/DRM/MODESET driver\n"); + char *mod_argv[] = { + "modprobe", + "-r", ++ "nvidia_uvm", + "nvidia_drm", +- NULL +- }; +- bb_run_fork_wait(mod_argv, 10); +- while (retries-- > 0 && module_is_loaded("nvidia_drm") == 1) { +- usleep(100000); +- } +- if (module_is_loaded(driver) == 1) { +- bb_log(LOG_ERR, "Unloading %s driver timed out.\n", driver); +- return 0; +- } +- } +- +- else if (module_is_loaded("nvidia_modeset") == 1) { +- int retries = 30; +- bb_log(LOG_INFO, "Unloading nvidia_modeset driver\n"); +- char *mod_argv[] = { +- "modprobe", +- "-r", + "nvidia_modeset", ++ driver, + NULL + }; + bb_run_fork_wait(mod_argv, 10); +- while (retries-- > 0 && module_is_loaded("nvidia_modeset") == 1) { ++ while (retries-- > 0 && module_is_loaded(driver) == 1) { + usleep(100000); + } + if (module_is_loaded(driver) == 1) { +@@ -150,26 +121,7 @@ int module_unload(char *driver) { + return 0; + } + } +- +- else if (module_is_loaded(driver) == 1) { +- int retries = 30; +- bb_log(LOG_INFO, "Unloading %s driver\n", driver); +- char *mod_argv[] = { +- "modprobe", +- "-r", +- driver, +- NULL +- }; +- bb_run_fork_wait(mod_argv, 10); +- while (retries-- > 0 && module_is_loaded(driver) == 1) { +- usleep(100000); +- } +- if (module_is_loaded(driver) == 1) { +- bb_log(LOG_ERR, "Unloading %s driver timed out.\n", driver); +- return 0; +- } +- } +- return 1; ++ return 1; + } + + /** Added: 0006-bb_hexadicimal_bug573.patch =================================================================== --- 0006-bb_hexadicimal_bug573.patch (rev 0) +++ 0006-bb_hexadicimal_bug573.patch 2016-04-14 20:48:54 UTC (rev 171087) @@ -0,0 +1,23 @@ +From 2073f8537412aa47755eb6f3f22a114403e5285b Mon Sep 17 00:00:00 2001 +From: Peter Wu <pe...@lekensteyn.nl> +Date: Wed, 16 Apr 2014 18:19:01 +0200 +Subject: [PATCH] Fix devices with a bus larger than 9 (GH-573) + +The `-isolateDevice` option accepts a PCI ID in decimal format, not hex. +--- + src/bbsecondary.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bbsecondary.c b/src/bbsecondary.c +index 71a6b73..6b635ee 100644 +--- a/src/bbsecondary.c ++++ b/src/bbsecondary.c +@@ -138,7 +138,7 @@ bool start_secondary(bool need_secondary) { + if (!bb_is_running(bb_status.x_pid)) { + char pci_id[12]; + static char *x_conf_file; +- snprintf(pci_id, 12, "PCI:%02x:%02x:%o", pci_bus_id_discrete->bus, ++ snprintf(pci_id, 12, "PCI:%02d:%02d:%o", pci_bus_id_discrete->bus, + pci_bus_id_discrete->slot, pci_bus_id_discrete->func); + if (!x_conf_file) { + x_conf_file = xorg_path_w_driver(bb_config.x_conf_file, bb_config.driver); Added: 0007-bb_mutebblogger.patch =================================================================== --- 0007-bb_mutebblogger.patch (rev 0) +++ 0007-bb_mutebblogger.patch 2016-04-14 20:48:54 UTC (rev 171087) @@ -0,0 +1,15 @@ +--- a/src/bblogger.c ++++ b/src/bblogger.c +@@ -144,7 +144,11 @@ + /* Error lines are errors. */ + if (strncmp(string, "(EE)", 4) == 0){ + if (strstr(string, "Failed to load module \"kbd\"") || +- strstr(string, "No input driver matching")) { ++ strstr(string, "Failed to load module \"mouse\"") || ++ strstr(string, "failed to set DRM interface version 1.4:") || ++ strstr(string, "No input driver matching") || ++ strstr(string, "systemd-logind: failed to get session:") || ++ strstr(string, "Server terminated successfully")) { + /* non-fatal errors */ + prio = LOG_DEBUG; + } else { Modified: PKGBUILD =================================================================== --- PKGBUILD 2016-04-14 20:46:50 UTC (rev 171086) +++ PKGBUILD 2016-04-14 20:48:54 UTC (rev 171087) @@ -1,9 +1,8 @@ -# $Id$ # Maintainer: Sven-Hendrik Haase <s...@lutzhaase.com> pkgname=bumblebee pkgver=3.2.1 -pkgrel=10 +pkgrel=11 pkgdesc="NVIDIA Optimus support for Linux through VirtualGL" arch=('i686' 'x86_64') depends=('virtualgl' 'glib2' 'mesa-libgl') @@ -26,15 +25,30 @@ 'etc/bumblebee/xorg.conf.nouveau' 'etc/bumblebee/xorg.conf.nvidia') source=("http://www.bumblebee-project.org/${pkgname}-${pkgver}.tar.gz" - "bumblebee-hexadecimal.patch::https://github.com/Bumblebee-Project/Bumblebee/commit/2073f8537412aa47755eb6f3f22a114403e5285b.patch") -md5sums=('30974e677bb13e8a3825fd6f3e7d3b24' - 'd0a7d504a717e34b05fb4bc9ee68f881') + "0001-bb_nvidia_modeset-detection_bug699_01.patch::https://github.com/arafey/Bumblebee/commit/5636b24fa86a005a5d2e30bd794516db13ccba56.patch" + "0002-bb_nvidia_modeset-detection_bug699_02.patch::https://github.com/arafey/Bumblebee/commit/09d537e8e5313cd0f2c7bf6620ca70454de8a04a.patch" + "0003-bb_nvidia_umv_detection_bug699.patch::https://github.com/arafey/Bumblebee/commit/dbbf20a38aa2bffb10c4e8af583b34dff6bfe721.patch" + "0004-bb_nvidia_drm_detection_bug699_01.patch::https://github.com/arafey/Bumblebee/commit/bcfe4dd16dd6194f1edbdc53b874a4f408343c5c.patch" + "0005-bb_nvidia_drm_detection_bug699_02.patch::https://github.com/arafey/Bumblebee/commit/fcfe596eb13f62ca9dd7de272a5a87ae843b2a00.patch" + "0006-bb_hexadicimal_bug573.patch::https://github.com/Bumblebee-Project/Bumblebee/commit/2073f8537412aa47755eb6f3f22a114403e5285b.patch" + "0007-bb_mutebblogger.patch" + "bumblebee.conf") +sha256sums=('1018703b07e2f607a4641249d69478ce076ae5a1e9dd6cff5694d394fa7ee30e' + 'aff3528d17a77ff19b4e0a7a10682b8351456f11795f71ef62b315e774fb408a' + '70ad9b3d8e0d70a504110651c6f5f3a1b1d3c4c44eeb0fd49a4463e99124a47b' + '16fd522f412125b3c9b5709d78584744c70cb627e8baf8cd6025a71d278f79a6' + '4676606012319ce7a9e3890d6e83445ae674f5ff2994925d59ec2229fbae5a14' + '206f71c022b29a77227a3c7ba1f5cf68e219b957b5d807be9a30b6a6a7cafddc' + '0b7c1f4bb2e27d131c6c21fd7006d075584917ac4259bd9899e6eca99efc0ece' + 'cbe3e1717bc80146b87d8f2ab1158ee9e094ea5bb2ca9a4a8c09c24b086a7792' + '1c3d4f5d40245a23a5f1cb1f2f6bd4274ff3c5b3749f76a09255191328ae3193') build() { cd "${srcdir}/${pkgname}-${pkgver}" - - patch -Np1 < ${srcdir}/bumblebee-hexadecimal.patch - + for p in ${srcdir}/*.patch; do + patch -Np1 -i "$p" + done + ./configure \ CONF_DRIVER_MODULE_NVIDIA=nvidia \ CONF_LDPATH_NVIDIA=/usr/lib/nvidia:/usr/lib32/nvidia \ @@ -44,25 +58,23 @@ --with-udev-rules=/usr/lib/udev/rules.d/ \ --sysconfdir=/etc \ --without-pidfile - make } package() { cd "${srcdir}/${pkgname}-${pkgver}" - + + # Install main app make install DESTDIR="$pkgdir" - - # Stop nvidia from loading on boot - mkdir -p "${pkgdir}/usr/lib/modprobe.d/" - echo "blacklist nvidia" > "${pkgdir}/usr/lib/modprobe.d/bumblebee.conf" - + + # Blacklist nvidia and nouveau modules + # Reference: https://github.com/Bumblebee-Project/Bumblebee/issues/719 + install -Dm644 "${srcdir}/bumblebee.conf" "${pkgdir}/usr/lib/modprobe.d/bumblebee.conf" + # Install systemd unit - install -D -m644 "scripts/systemd/bumblebeed.service" "${pkgdir}/usr/lib/systemd/system/bumblebeed.service" + install -Dm644 "scripts/systemd/bumblebeed.service" "${pkgdir}/usr/lib/systemd/system/bumblebeed.service" sed -i "s/sbin/bin/" "${pkgdir}/usr/lib/systemd/system/bumblebeed.service" # Make bash_completion work mv -v "${pkgdir}/etc/bash_completion.d/bumblebee" "${pkgdir}/etc/bash_completion.d/optirun" - - echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/bumblebee.conf" } Added: bumblebee.conf =================================================================== --- bumblebee.conf (rev 0) +++ bumblebee.conf 2016-04-14 20:48:54 UTC (rev 171087) @@ -0,0 +1,6 @@ +blacklist nvidia +blacklist nvidia-drm +blacklist nvidia-modeset +blacklist nvidia-uvm +blacklist nouveau +