def disable(self): '''Prevent the OS from using it even if the hardware is available. ''' OSLib.inst.queue_packages_for_removal( { 'nvidia-xconfig', 'nvidia-settings' } ) KernelModuleHandler.disable(self) return False
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'vmxnet', name=_('VMWare Client Tools'), description=_('Install VMWare client drivers and tools'), rationale=_('Install the VMWare client drivers' 'for your VMWare based {0} installation.\n\n' 'This should help you use {0} in your VM.').format(OSLib.inst.os_vendor))
def enabled(self): # See if nvidia (e.g. nvidia-current) is the current alternative target_alternative = self._alternatives.get_alternative_by_name(self.package) current_alternative = self._alternatives.get_current_alternative() other_target_alternative = self._other_alternatives.get_alternative_by_name(self.package) other_current_alternative = self._other_alternatives.get_current_alternative() logging.debug('NVidia(%s).enabled(): target_alt %s current_alt %s other target alt %s other current alt %s', self.module, target_alternative, current_alternative, other_target_alternative, other_current_alternative) if current_alternative is None: return False if current_alternative != target_alternative or \ other_current_alternative != other_target_alternative: logging.debug('%s is not the alternative in use', self.module) return False #if self.xorg_conf has NoneType, AttributeError will be raised if not self.xorg_conf: logging.debug('%s: xkit object does not exist!', self.module) return False # Make sure that neither the alias nor the actual module are blacklisted if OSLib.inst.module_blacklisted(self._module_alias) or OSLib.inst.module_blacklisted(self.module): logging.debug('%s is blacklisted, so not treating as enabled', self.module) return False kmh_enabled = KernelModuleHandler.enabled(self) logging.debug('KMH enabled: %s', str(kmh_enabled)) return KernelModuleHandler.enabled(self)
def used(self): '''Return if the handler is currently in use.''' return KernelModuleHandler.used(self) and self.enabled() and \ not (KernelModuleHandler.module_loaded('b43') or KernelModuleHandler.module_loaded('b43legacy') or KernelModuleHandler.module_loaded('bcm43xx'))
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'wl', name=_('Broadcom 802.11 STA driver'), description=_('Broadcom 802.11 Linux STA Driver for WiFi cards.'), rationale=_('Broadcom 802.11 Linux STA Driver for WiFi, a linux' ' device driver for use with Broadcom\'s BCM4311-, BCM4312-,' ' BCM4321-, and BCM4322-based hardware.\n\n'))
def disable(self): '''Prevent the OS from using it even if the hardware is available. ''' OSLib.inst.queue_packages_for_removal( {'nvidia-xconfig', 'nvidia-settings'}) KernelModuleHandler.disable(self) return False
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'fglrx', name=_('AMD proprietary Catalyst graphics driver'), description=_('3D-accelerated proprietary graphics driver for ' 'AMD (ATI) cards.'), rationale=_('This driver is required to fully utilise the 3D ' 'potential of some AMD (ATI) graphics cards, as well as provide ' '2D acceleration of newer cards.'))
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'dvb_usb', name=_('Firmware for DVB cards')) self.package = 'firmware-linux-nonfree' self._free = False self._do_rebind = False # does not work, don't bother
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'clearpad_tm1217', name=_('Staging kernel modules'), description=_('WARNING: Experimental drivers.'), rationale=_('Staging can provide this module: clearpad_tm1217\n\n' 'You probably only want to enable this if ' 'your hardware does not work at all.\n\n' 'These are drivers which are not yet in the ' 'stable kernel tree, but due to be merged soon.'))
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'wl', name=_('Broadcom 802.11 STA driver'), description=_('Proprietary drivers for Broadcom 802.11 WiFi cards.'), rationale=_('Broadcom 802.11 Linux STA Driver for WiFi, a linux' ' device driver for use with Broadcom\'s BCM4311-, BCM4312-,' ' BCM4321-, and BCM4322-based hardware.\n\n' 'You probably only want to enable this if ' 'your wifi does not work well (or at all).'))
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'vmxnet', name=_('VMWare Client Tools'), description=_('Install VMWare client drivers and tools'), rationale=_('Install the VMWare client drivers and tools' 'for your VMWare based Ubuntu installation.\n\n' 'This should help you use Ubuntu in your VM.')) self.package = 'open-vm-dkms' self._free = True
def __init__(self, ui): self._free = False KernelModuleHandler.__init__(self, ui, 'wl', name=_('Broadcom STA wireless driver')) self.package = 'bcmwl-kernel-source' self._auto_install = True self.needs_kernel_headers = True
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'easycap', name=_('Staging kernel modules'), description=_('WARNING: Experimental drivers.'), rationale=_('Staging can provide this module: easycap\n\n' 'You probably only want to enable this if ' 'your hardware does not work at all.\n\n' 'These are drivers which are not yet in the ' 'stable kernel tree, but due to be merged soon.'))
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'nvidia', name=_('NVIDIA accelerated graphics driver'), description=_('3D-accelerated proprietary graphics driver for ' 'NVIDIA cards.'), rationale=_('This driver is required to fully utilise ' 'the 3D potential of NVIDIA based graphics cards.\n\n' 'If the default open source Nouveau driver is not be able ' 'to power some 3D games, you can try this driver instead.')) self._recommended = None
def __init__(self, ui): KernelModuleHandler.__init__( self, ui, 'wl', name=_('Broadcom 802.11 STA driver'), description=_('Broadcom 802.11 Linux STA Driver for WiFi cards.'), rationale=_( 'Broadcom 802.11 Linux STA Driver for WiFi, a linux' ' device driver for use with Broadcom\'s BCM4311-, BCM4312-,' ' BCM4321-, and BCM4322-based hardware.\n\n'))
def __init__(self, ui): KernelModuleHandler.__init__( self, ui, 'vmxnet', name=_('VMWare Client Tools'), description=_('Install VMWare client drivers and tools'), rationale=_('Install the VMWare client drivers' 'for your VMWare based {0} installation.\n\n' 'This should help you use {0} in your VM.').format( OSLib.inst.os_vendor))
def enable(self): KernelModuleHandler.enable(self) # rebinding does not work, we have to unload/reload mods = [] proc_modules = open(OSLib.inst.proc_modules) for line in open(OSLib.inst.proc_modules): if 'dvb_usb' in line: mods.append(line.split()[0]) logging.debug('reloading modules: %s' % ' '.join(mods)) subprocess.call([OSLib.inst.modprobe_path, '-r'] + mods) subprocess.call([OSLib.inst.modprobe_path, '-a'] + mods)
def __init__(self, ui): KernelModuleHandler.__init__( self, ui, 'vmxnet', name=_('VMWare Client Tools'), description=_('Install VMWare client drivers and tools'), rationale=_('Install the VMWare client drivers and tools' ' for your VMWare based Ubuntu installation.\n\n' 'This should help you use Ubuntu in your VM.')) self.package = 'open-vm-dkms' self._free = True
def used(self): """Return if the handler is currently in use.""" return ( KernelModuleHandler.used(self) and self.enabled() and not ( KernelModuleHandler.module_loaded("b43") or KernelModuleHandler.module_loaded("b43legacy") or KernelModuleHandler.module_loaded("bcm43xx") ) )
def __init__(self, ui): KernelModuleHandler.__init__( self, ui, 'fglrx', name=_('AMD proprietary Catalyst graphics driver'), description=_('3D-accelerated proprietary graphics driver for ' 'AMD (ATI) cards.'), rationale=_( 'This driver is required to fully utilise the 3D ' 'potential of some AMD (ATI) graphics cards, as well as provide ' '2D acceleration of newer cards.'))
def __init__(self, ui): KernelModuleHandler.__init__( self, ui, 'nvidia', name=_('NVIDIA accelerated graphics driver'), description=_('3D-accelerated proprietary graphics driver for ' 'NVIDIA cards.'), rationale=_( 'This driver is required to fully utilise ' 'the 3D potential of NVIDIA based graphics cards.\n\n' 'If the default open source Nouveau driver is not be able ' 'to power some 3D games, you can try this driver instead.')) self._recommended = None
def enabled(self): km = KernelModuleHandler.enabled(self) bcm = OSLib.inst.module_blacklisted('bcm43xx') b43 = OSLib.inst.module_blacklisted('b43') b43_legacy = OSLib.inst.module_blacklisted('b43legacy') b43_loaded = KernelModuleHandler.module_loaded('bcm43xx') or \ KernelModuleHandler.module_loaded('b43') or \ KernelModuleHandler.module_loaded('b43legacy') logging.debug( 'BroadcomWLHandler enabled(): kmod %s, bcm43xx: %s, b43: %s, b43legacy: %s' % (km and 'enabled' or 'disabled', bcm and 'blacklisted' or 'enabled', b43 and 'blacklisted' or 'enabled', b43_legacy and 'blacklisted' or 'enabled')) return (km and not b43_loaded) or (km and bcm and b43 and b43_legacy)
def __init__(self, ui): KernelModuleHandler.__init__( self, ui, "STAGING_MODULE", name=_("Staging kernel modules"), description=_("WARNING: Experimental drivers."), rationale=_( "Staging can provide this module: STAGING_MODULE\n\n" "You probably only want to enable this if " "your hardware does not work at all.\n\n" "These are drivers which are not yet in the " "stable kernel tree, but due to be merged soon." ), )
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'ath_pci', name=_('Alternate Atheros "madwifi" driver'), description=_('Alternate "madwifi" driver for Atheros wireless LAN cards.'), rationale=_('Only activate this driver if you have problems ' 'with your wireless LAN connection.\n\n' 'The free "ath5k" driver should work with most ' 'Atheros cards nowadays, but on some computers this ' 'alternate (but proprietary) driver still works better, ' 'or at all.')) self._free = False # do not announce this if ath5k works self.announce = not self.module_loaded('ath5k') self.blacklist_file = os.path.join(os.path.dirname( OSLib.inst.module_blacklist_file), 'blacklist-ath_pci.conf')
def used(self): '''Return if the handler is currently in use.''' if self.changed() and self.enabled(): return False # See if "nvidia" is loaded and if the alias corresponds to nvidia_$flavour return KernelModuleHandler.module_loaded(self._module_alias) and \ self._alternatives.resolve_module_alias(self._module_alias) == self.module and \ (self.package is None or OSLib.inst.package_installed(self.package))
def enables_composite(self): '''Return whether this driver supports the composite extension.''' # When using an upstream installation, or -new/-legacy etc., we already # have composite if KernelModuleHandler.module_loaded('nvidia'): logging.debug('enables_composite(): already using nvidia driver from nondefault package') return False # neither vesa nor nv support composite, so safe to say yes here return True
def __init__(self, ui): KernelModuleHandler.__init__( self, ui, "ath_pci", name=_('Alternate Atheros "madwifi" driver'), description=_('Alternate "madwifi" driver for Atheros wireless LAN cards.'), rationale=_( "Only activate this driver if you have problems " "with your wireless LAN connection.\n\n" 'The free "ath5k" driver should work with most ' "Atheros cards nowadays, but on some computers this " "alternate (but proprietary) driver still works better, " "or at all." ), ) self._free = False # do not announce this if ath5k works self.announce = not self.module_loaded("ath5k") self.blacklist_file = os.path.join(os.path.dirname(OSLib.inst.module_blacklist_file), "blacklist-ath_pci.conf")
def enabled(self): km = KernelModuleHandler.enabled(self) bcm = OSLib.inst.module_blacklisted("bcm43xx") b43 = OSLib.inst.module_blacklisted("b43") b43_legacy = OSLib.inst.module_blacklisted("b43legacy") b43_loaded = ( KernelModuleHandler.module_loaded("bcm43xx") or KernelModuleHandler.module_loaded("b43") or KernelModuleHandler.module_loaded("b43legacy") ) logging.debug( "BroadcomWLHandler enabled(): kmod %s, bcm43xx: %s, b43: %s, b43legacy: %s" % ( km and "enabled" or "disabled", bcm and "blacklisted" or "enabled", b43 and "blacklisted" or "enabled", b43_legacy and "blacklisted" or "enabled", ) ) return (km and not b43_loaded) or (km and bcm and b43 and b43_legacy)
def enabled(self): #if self.xorg_conf has NoneType, AttributeError will be raised try: devices = self.xorg_conf.globaldict['Device'] try: driver = self.xorg_conf.getDriver('Device', 0) except (XKit.xorgparser.OptionException, XKit.xorgparser.SectionException): driver = None if len(devices) == 0 or driver != 'nvidia': return False except AttributeError: return False return KernelModuleHandler.enabled(self)
def enables_composite(self): '''Return whether this driver supports the composite extension.''' # When using an upstream installation, or -new/-legacy etc., we already # have composite if KernelModuleHandler.module_loaded('nvidia'): logging.debug( 'enables_composite(): already using nvidia driver from nondefault package' ) return False # neither vesa nor nv support composite, so safe to say yes here return True
def enabled(self): # See if nvidia (e.g. nvidia-current) is the current alternative target_alternative = self._alternatives.get_alternative_by_name( self.package) current_alternative = self._alternatives.get_current_alternative() other_target_alternative = self._other_alternatives.get_alternative_by_name( self.package) other_current_alternative = self._other_alternatives.get_current_alternative( ) logging.debug( 'NVidia(%s).enabled(): target_alt %s current_alt %s other target alt %s other current alt %s', self.module, target_alternative, current_alternative, other_target_alternative, other_current_alternative) if current_alternative is None: return False if current_alternative != target_alternative or \ other_current_alternative != other_target_alternative: logging.debug('%s is not the alternative in use', self.module) return False #if self.xorg_conf has NoneType, AttributeError will be raised if not self.xorg_conf: logging.debug('%s: xkit object does not exist!', self.module) return False # Make sure that neither the alias nor the actual module are blacklisted if OSLib.inst.module_blacklisted( self._module_alias) or OSLib.inst.module_blacklisted( self.module): logging.debug('%s is blacklisted, so not treating as enabled', self.module) return False kmh_enabled = KernelModuleHandler.enabled(self) logging.debug('KMH enabled: %s', str(kmh_enabled)) return KernelModuleHandler.enabled(self)
def enabled(self): return KernelModuleHandler.enabled(self)
def __init__(self, ui): KernelModuleHandler.__init__(self, ui, 'dvb_usb', name=_('Firmware for DVB cards')) self.package = 'linux-firmware-nonfree' self._free = False self._do_rebind = False # does not work, don't bother
def available(self): r = KernelModuleHandler.available(self) if r is not None: return r return self.module_loaded(self.module)
def __init__(self, ui): self._free = False KernelModuleHandler.__init__(self, ui, "wl", name=_("Broadcom STA wireless driver")) self.package = "bcmwl-kernel-source" self._auto_install = True self.needs_kernel_headers = True
def enable(self): subprocess.call(["/sbin/rmmod", "b43"]) subprocess.call(["/sbin/rmmod", "b43legacy"]) subprocess.call(["/sbin/rmmod", "bcm43xx"]) subprocess.call(["/sbin/rmmod", "ssb"]) KernelModuleHandler.enable(self)
def enable(self): subprocess.call(['/sbin/rmmod', 'b43']) subprocess.call(['/sbin/rmmod', 'b43legacy']) subprocess.call(['/sbin/rmmod', 'bcm43xx']) subprocess.call(['/sbin/rmmod', 'ssb']) KernelModuleHandler.enable(self)