__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

�F�g
�����SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J
r
 SSKJr Sq0q
Sr"SS\5rS	rS9S
jrSrSrS
rSrS9SjrSrSrSrSrSrSrSrSrSr Sr!Sr"Sr#S:Sjr$Sr%Sr&Sr'S;S jr(S<S!jr)S=S"jr*S>S#jr+S$r,S%r-"S&S'\5r.S(r/S?S)jr0S@S*jr1S9S+jr2S,r3S-r4S.r5S/r6S0r7S1r8S2r9S3r:S4r;S5r<S6r=S7r>S8r?g)AzGHardware and driver package detection functionality for Ubuntu systems.�N)�kerneldetection)�
cmp_to_key�z/etc/custom_supported_gpus.jsonc�B�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rg)�NvidiaPkgNameInfo�z%Class to process NVIDIA package namesc��XlSUlSUlSUlSUlSUlSUlURUR5 g)NF���r)�	_pkg_name�_obsolete_name_scheme�_server�_open�
_major_ver�_flavour�is_valid�
_process_name)�self�pkg_names  �6/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py�__init__�NvidiaPkgNameInfo.__init__sD��!��%*��"������
������
���
����4�>�>�*�c��SU;a[R"SU5 g[R"S5nUR	U5nU(a?SUl[
URS55UlURUl	SUl
g[R"S5nUR	U5nU(a�URS5RS5S	:gUlURS5RS
5S	:gUl
URS5<UR(aSOS<UR(aS
OS<3Ul	[
URS55UlSUl
[R"S5nUR	U5nU(a�URS5RS5S	:gUlURS5RS
5S	:gUl
URS
5<UR(aSOS<UR(aS
OS<3Ul	URS
5UlSUl
gg)N�nvidiaz8NvidiaPkgNameInfo: %s is not an NVIDIA package. Skippingznvidia-([0-9]+)T�znvidia-driver-([0-9]+)(.*)rz-serverr
z-openrz nvidia-headless(.*)-([0-9]+)(.*)�)�logging�debug�re�compile�matchr�int�grouprrr�findr
r)r�name�patternr!s    rr�NvidiaPkgNameInfo._process_name)s����4���M�M�T�VZ�[���*�*�.�/���
�
�d�#���)-�D�&�!�%�+�+�a�.�1�D�O� �O�O�D�M� �D�M���*�*�9�:���
�
�d�#��� �;�;�q�>�.�.�y�9�R�?�D�L����Q��,�,�W�5��;�D�J�(-���A��59�\�\�	�r�(I�37�:�:��2�(E�G�D�M�"�%�+�+�a�.�1�D�O� �D�M��*�*�?�@���
�
�d�#��� �;�;�q�>�.�.�y�9�R�?�D�L����Q��,�,�W�5��;�D�J�(-���A��59�\�\�	�r�(I�37�:�:��2�(E�G�D�M�$�k�k�!�n�D�O� �D�M�rc��UR$�N)r�rs r�has_obsolete_name_scheme�*NvidiaPkgNameInfo.has_obsolete_name_schemeSs���)�)�)rc��UR$r))r
r*s r�	is_server�NvidiaPkgNameInfo.is_serverVs���|�|�rc��UR$r))rr*s r�is_open�NvidiaPkgNameInfo.is_openYs���z�z�rc��UR$r))rr*s r�get_major_version�#NvidiaPkgNameInfo.get_major_version\s�����rc��UR$r))rr*s r�get_flavour�NvidiaPkgNameInfo.get_flavour_s���}�}�r)rrrrrr
rN)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__rrr+r.r1r4r7�__static_attributes__�rrrrs)��/�+�(!�T*����rrc�T�[(d[R"5Sq[$)zCache system architecturer)�system_architecture�apt_pkg�get_architecturesr?rr�get_apt_archrDcs$����%�7�7�9�!�<���rc��0nU=(a SU-=(d Sn[R"U5GH{up4nSnSU;aR[[RR	US55nUR5R
5nSSS5 O�SU;a|SU;av[[RR	US55n	U	H>n
U
RS5(dMU
RS	S
5S
R
5n O SSS5 U(dM�[RR	US5n[RR	US5n[RRU5(a'[RRU5(dGMwX1U'GM~ U$!,(df   N�=f![a#n[R"SX85 SnAGM�SnAff=f!,(df   N�=f)
u�Get modaliases present in the system.

This ignores devices whose drivers are statically built into the kernel, as
you cannot replace them with other driver packages anyway.

Return a modalias → sysfs path map.
z
%s/devicesz/sys/devicesN�modaliasz0system_modaliases(): Cannot read %s/modalias: %s�ssb�ueventz	MODALIAS=�=r�driver�module)
�os�walk�open�path�join�read�strip�IOErrorrr�
startswith�split�islink)
�sys_path�aliases�devicesrO�dirs�filesrF�f�e�fd�line�
driverlink�modlinks
             r�system_modaliasesrbks����G��4�<�8�4�F��G��W�W�W�-���E������
��"�'�'�,�,�t�Z�8�9�Q� �v�v�x�~�~�/�H�:�9��d�]�x�5�0��b�g�g�l�l�4��2�3�r��D����{�3�3�#'�:�:�c�1�#5�a�#8�#>�#>�#@����4����W�W�\�\�$��1�
��'�'�,�,�z�8�4��
�7�7�>�>�*�%�%�b�g�g�n�n�W�.E�.E�� ���A.�D�N�9:�9���
��
�
�P�"�'���
��4�3�sH�)G�)F2�G�G3�$'G3�2
G	�<G�G�
G0�
G+�+G0�3
H	c��SnURRS5(a!URRSS5nXn[R"U5nURU5nSnURRS5H*nUH!up�n
URS5(dMSn M( M, U(d$[R
"S	UR-5 gUS
nURU5nURH up�nURS5(dMUnM" U(a�XnURH)nURRUR:XdM) g [R
"SURU5 [R
"U<S
URVs/sHnURPM sn<35 gg![a [R
"SU-5 gf=f![[4a [R
"SU-5 SnGNsf=f![a [R
"S5 gf=fs snf)Nznvidia-driver-zxserver-xorg-video-nvidia-z5Cannot find %s package in the cache. Cannot check ABITF�Dependszxorg-video-abi-z@The %s package seems to have no dependencies. Skipping ABI checkz;Skipping check for %s since it does not depend on video abizxserver-xorg-corez1xserver-xorg-core not available, cannot check ABIzBDriver package %s is incompatible with current X.org server ABI %sz is not in )r%rT�replace�KeyErrorrrrB�DepCache�get_candidate_ver�depends_list_str�get�	TypeError�
provides_list�rev_depends_list�
parent_pkg)�	apt_cache�package�xorg_video_abi�xorg_driver_name�depcache�	candidate�needs_video_abi�dep_list�dep_name�dep_ver�dep_op�	xorg_core�
provides_name�provides_ver�	p_version�abi_pkg�dep�xs                  r�_check_video_abi_compatr��s ���N��|�|���/�0�0�"�<�<�/�/�0@�B^�_��	��1�G�
���	�*�H��*�*�7�3�I��O� �!�2�2�6�6�y�A�H�-5�)��6��&�&�'8�9�9�&*�O��.6�B���
�
�S�V]�Vb�Vb�b�c����1�2�	�
�*�*�9�5�I�2;�2I�2I�.�
�Y��#�#�$5�6�6�*�N�3J���+���+�+�C��~�~�"�"�g�l�l�2��,�	�
�
�Z��l�l�N�	4��
�
�7�7�Kc�Kc�4d�Kc�a�Q�\�\�Kc�4d�e�f����]�	��M�M�Q�Ue�f�g��	��
�i� � ��
�
�X�\c�d�e��� �����
�
�I�J����$5esB�G�.:G<�,G<�#H.�1I�#G9�8G9�<+H+�*H+�. I�Ic��[R"U5n[R"U5n0nURGH7nUR	U5nURURS5 USnU(dMBURS[54;aM_[X5(dMqURS5H�nURS5nU(dMURS5up�U	RS5Hkn
U
R5n
U
RSS	5SnURU05RU
[!55R#UR$5 Mm M� GM: 0nUR-5Hqup�[.R0"SR3U
R55Vs/sHn[6R8"U5PM sn5[.R:5nX�4X�'Ms U$![[[4a GM�f=f![&a- [(R*"S
UR$<SU<35 GMf=fs snf)
a5Build a modalias map from an apt_pkg.Cache object.

This filters out uninstallable video drivers (i. e. which depend on a video
ABI that xserver-xorg-core does not provide).

Return a map bus -> modalias -> [package, ...], where "bus" is the prefix of
the modalias up to the first ':' (e. g. "pci" or "usb").
r�
Modaliases�all�)�, �(�,�:rzPackage z has invalid modalias header: �|)rBrg�PackageRecords�packagesrh�lookup�	file_listrf�AttributeError�UnicodeDecodeError�architecturerDr�rUrR�
setdefault�set�addr%�
ValueErrorr�error�itemsrr rP�keys�fnmatch�	translate�
IGNORECASE)rors�records�resultrprt�m�partrK�lst�alias�bus�result2�	alias_map�pats               r�apt_cache_modalias_mapr��s������	�*�H��$�$�Y�/�G�
�F��%�%��	� �2�2�7�;�I��N�N�9�.�.�q�1�2���%�A����
� � ����(?�?��&�y�:�:��	"��������z�z�$�'����"�j�j��o��� �Y�Y�s�^�E�!�K�K�M�E��+�+�c�1�-�a�0�C��%�%�c�2�.�9�9�%���G�K�K�G�L�L�Y�,�%�)&�B�G� �,�,�.����j�j��H�H�	���8H�I�8H��g�'�'��,�8H�I�J��M�M����'���	)��N��A�.�*<�=�	��	��*�	"��M�M����a�!�
"�
"�	"��Js+�;H�-CH�; I�H�H�2I�Ic��[$r))�custom_supported_gpus_jsonr?rr�path_get_custom_supported_gpusr�
s��%�%rc��[5nSn[US5n[[R"U5S5nUHKnUSU:XdMUSRS5Sn[R"SU<S	US
<SU<S35  O SSS5 U$![a [R"S
5 N,f=f!,(df   U$=f![a [R"SU-5 U$f=f)zpGet nvidia allowing driver for specific devices.

did: 0x1234
Return the situable nvidia driver version for it.
N�r�chips�devid�branch�.rz#Found a specific nv driver version z for r%r�r�z;package_get_nv_allowing_driver(): unexpected json detected.z3package_get_nv_allowing_driver(): unable to read %s)
r�rN�list�json�loadrUr�info�	Exceptionr)�didrO�version�stream�gpus�gpus      r�package_get_nv_allowing_driverr�s���*�+�D��G�
�
�$��_��

��D�I�I�f�-�g�6�7���C��7�|�s�*�"%�h�-�"5�"5�c�":�1�"=�����&-�s�6�{�C�&A�B�� ���N��
�
��
�
�[�\��
���_��N���
��
�
�K�d�R�S���N�
�sc�C�C�.B�>B�C�
B�C�C� B=�:C�<B=�=C�
C�
C�C�#C9�8C9c���[5nUc[U5nURURSS5SS045upE[	U5upgSnSn	US:Xa�[SU-5nSU-n
SU-nURH;nUR5RS5SU
:XdM+[U
/5X['Sn	M= Ub U	(d[R"S	U
-5 U	(dUbURU5(d/$UHYn
[R"UR5U
R55(dM=X]HnURU5 M M[ UVs/sHo�UPM	 sn$s snf)
zWSearch packages which match the given modalias.

Return a list of apt.Package objects.
Nr�rr�10DE�0xznvidia-driver-%szpci:v000010DEd0000%s*z%s is not in the package pool.)r�r�rjrU�_get_vendor_model_from_aliasr�r��get_fullnamerrr!r��fnmatchcase�lowerr�)rorF�modalias_map�pkgsr��bus_map�vidr��nvamd�found�nvamdn�nvamda�pr�s              r�packages_for_modaliasr�)sW��
�5�D���-�i�8���#�#�H�N�N�3��$:�1�$=��b�z�J�L�C�+�H�5�H�C��E�
�E�
�f�}�.�t�c�z�:��#�e�+��(�3�.���#�#�A��~�~��%�%�c�*�1�-��7�"%�v�h�-�����$���U��M�M�:�V�C�D���;�c�i�i��1�1��I������x�~�~�/�����?�?��^�������$��
#'�'�$�Q�a�L�$�'�'��'s�$E5c���[R"U5nURU5nUceURR	S5(ag[R
"U5nUR
URS5 URSRH5upVUR(d
USnUS;s $URS;dM5 g g![a  gf=f)NrFr�	Component)�
restricted�
multiverseT)rBrgrhr%rTr�r�r��version_list�	componentrf)ro�pkgrsrtr��pfile�_r�s        r�_is_package_freer�Ns������	�*�H��*�*�3�/�I�� � � ��x�x���8�$�$���$�$�Y�/�G��N�N�9�&�&�q�)�*��$�$�Q�'�1�1������
�#�K�0�	�!�)E�E�F����">�>��2����
��
�s�2	C�
C#�"C#c��[R"U5nURU5nUcgURSSRS:H$![
a gf=f)NFr�Ubuntu)rBrgrhr��originrf)ror�rsrts    r�_is_package_from_distror�ksc�����	�*�H��*�*�3�/�I������#�#�A�&�q�)�0�0�H�<�=������s�A�
A�Ac��[R"U5nURU5n[R"U5nUR	UR
S5 USnUS;a#[R"SURU5 gU$![[4a$ [R"SUR5 gf=f)z>Determine if -open package is prefered from apt Package objectrzPrefer-VariantzM_pkg_get_open_preference %s: package has Prefer-Open header, cannot determineF)�Open�Closedzb_pkg_get_open_preference %s: package has invalid Prefer-Open %sheader, cannot determine preferenceN�rBrgrhr�r�r�rfr�rrr%)ror�rsrtr��
preferences      r�_pkg_get_open_preferencer�ws������	�*�H��*�*�3�/�I��$�$�Y�/�G��N�N�9�&�&�q�)�*���-�.�
�
�+�+��
�
�<�=@�X�X�z�	S�����
�n�%���
�
�e�gj�go�go�p�����B
�
1C�Cc��[R"U5nURU5n[R"U5nUR	UR
S5 USnURS5nUS::a"[R"SUR5 gUSUnU$![[4a$ [R"SUR5 gf=f)z-Determine module name from apt Package objectrr�zM_pkg_get_module %s: package has no Modaliases header, cannot determine moduleNr�zR_pkg_get_module %s: package has invalid Modaliases header, cannot determine module)rBrgrhr�r�r�rfr�rrr%r$)ror�rsrtr�r��parenrKs        r�_pkg_get_moduler��s������	�*�H��*�*�3�/�I��$�$�Y�/�G��N�N�9�&�&�q�)�*���L�!��

�F�F�3�K�E���z��
�
�j�lo�lt�lt�u��
�v��Y�F��M��
�n�%���
�
�e�gj�go�go�p���s�B"�"1C�Cc��[R"U5nURU5n[R"U5nUR	UR
S5 USnUS;a#[R"SURU5 gU$![[4a$ [R"SUR5 gf=f)z/Determine support level from apt Package objectr�SupportzR_pkg_get_support %s: package has no Support header, cannot determine support levelN)�PB�NFB�LTSB�LegacyzY_pkg_get_support %s: package has invalid Support %sheader, cannot determine support levelr�)ror�rsrtr��supports      r�_pkg_get_supportr��s������	�*�H��*�*�3�/�I��$�$�Y�/�G��N�N�9�&�&�q�)�*���)�$��
�5�5��
�
�?�@C���'�	S���N��
�n�%���
�
�j�lo�lt�lt�u���r�c��[R"SU5nURS5nURS5nUS:wagSU-n[5n[	US5n[[R"U5S5nUH�nUS	U:XdMS
US;dMUSRS
5SU:wa=[R"SUSRS
5S<SU<35  SSS5 g[R"SU-5  SSS5 g SSS5 g![a [R"S5 N+f=f!,(df   g=f![a [R"SU-5 gf=f)zAalias: e.g. pci:v000010DEd000024BAsv0000103Csd000089C6bc03sc00i00zpci:v0000(.*)d0000(.*)sv(.*)rrr�Fz0x%sr�r�r��	runtimepm�featuresr�r�rz!Candidate version does not match z != NzFound runtimepm supports on %s.Tz?_is_nv_allowing_runtimepm_supported(): unexpected json detectedz8_is_nv_allowing_runtimepm_supported(): unable to read %s)
r�searchr#r�rNr�r�r�rUrrr�r�)	r��verr�r�r�rOr�r�r�s	         r�#_is_nv_allowing_runtimepm_supportedr��sg��
�Y�Y�5�u�
=�F�
�,�,�q�/�C�
�,�,�q�/�C�
�f�}��
�3�,�C�)�+�D�
�
�$��_��
��D�I�I�f�-�g�6�7���C��7�|�s�*�{�c�*�o�/M��x�=�.�.�s�3�A�6�#�=�#�M�M�+.�x�=�+>�+>�s�+C�A�+F��+M�N�#(��_� ���%F��%L�M�#��_� ��"��
�
��
�
�_�`��
���_�"���
��
�
�P�SW�W�X���
�ss�E�E�.D"�D"�AD"�+E�4D"�E�D"�E�" E�E�E�E�
E�E�E�#E?�>E?c�^^�[R"U5nURU5n[R"U5nUR	UR
S5 [R"UR5nURRS5SnUSnURS5S:wagX�RS5S-URS5n	U	RS	5n
[TU5(ag
[U4SjU
55$![[[4a gf=f)z>Check if the package supports runtimepm for the given modaliasrr��	PmAliasesznvidia(Fr�rr�r�Tc3�># �UH8n[R"TR5UR55v� M: g7fr))r�r�)�.0�regexr�s  �r�	<genexpr>�*_is_runtimepm_supported.<locals>.<genexpr>�s+����Y�j�U�7�?�?�5�;�;�=�%�+�+�-�@�@�j�s�AA)rBrgrhr�r�r��
TagSection�record�ver_strrUr$r��anyrfr�r�)ror�r�rsrtr��sectionr�r��n�
modaliasess  `        r�_is_runtimepm_supportedr�s���Z��#�#�I�.���.�.�s�3�	��(�(��3�����y�*�*�1�-�.��$�$�W�^�^�4�����%�%�c�*�1�-���K� ��
�6�6�)���!��
�f�f�S�k�!�m�Q�V�V�C�[�)���W�W�T�]�
�.�u�c�:�:���Y�j�Y�Y�Y��
�n�&8�9����s�BD�D,�+D,c�D�[RRS5SL$)z*Check if the current session in on Wayland�WAYLAND_DISPLAYN)rL�environrjr?rr�is_wayland_sessionr�s��
�:�:�>�>�+�,�D�8�8rc��UR(agURRS5(aSnO.URRS5(aSnO[X5nU(dg[R
"SU/[R[RS9nUR5 URS:Xa#[R"SURU5 g[R"SURU5 g![[[R4a*n[R"S	[U55 S
nAgS
nAff=f)zIDetermine if the kernel module from an apt.Package is manually installed.Fr�fglrx�modinfo)�stdout�stderrrzJ_is_manual_install %s: builds module %s which is available, manual installTz_is_manual_install failed: %sNzQ_is_manual_install %s: builds module %s which is not available, no manual install)�current_verr%rTr��
subprocess�Popen�PIPE�communicate�
returncoderr�OSError�FileNotFoundError�CalledProcessError�str)ror�rKrr]s     r�_is_manual_installr�s�������x�x���8�$�$���	���	�	�W�	%�	%��� ��0������"�"�I�v�#6�z���*4�/�/�;������
����"��M�M�f��(�(�F�
,��#�
�M�M�e��(�(�F�$���
�&�
�(E�(E�F���
�
�5�s�1�v�>����s�-AD�E�' E�Ec	��[R"SSU/SS9n[R
"SU5 SnSnUR5H)nURS	S
5upxSU;aUnSU;dM'UnM+ [R
"S
UXU5 XE4$![[R4a+n[R
"SX[
U55 SnAgSnAff=f)zLReturn (vendor, model) names for given device.

Values are None if unknown.
zsystemd-hwdb�queryT)�universal_newlinesz-_get_db_name(%s, %s): systemd-hwdb failed: %sN�NNz_get_db_name: output
%s
rIr�_VENDOR�_MODELz-_get_db_name(%s, %s): vendor "%s", model "%s")	r�check_outputrrrrr�
splitlinesrU)	�syspathr��outr]�vendor�modelr_�k�vs	         r�_get_db_namer#s���
��%�%�~�w��&F�9=�?���M�M�.��4�
�F��E���� �����C��#�����>��F��q�=��E�!��M�M�A�7���(��?���#
�Z�2�2�3���
�
�E�w�WZ�[\�W]�^����s�B�C�(!C�Cc��URRS5(dg[X5nUcL[UR5nUR	5S:�a"[
R"SUR5 gO(US:Xa"[
R"SUR5 g[
R"SUR5 g)N�nvidia-Fi0z_is_open_prefered(%s): TrueTr�z_is_open_prefered(%s): False)r%rTr�rr4rr)ror�r��nvidia_infos    r�_is_open_preferedr'1s����8�8���y�)�)��)�)�9�J���'����1���(�(�*�c�1��M�M�7����B��2�
�v�	��
�
�3�S�X�X�>���M�M�0�#�(�(�;�rc�l�SnSU-n[US5nURU5 UR5 g)zSet KMS on or off for NVIDIAz/lib/modprobe.d/nvidia-kms.confz�# This file was generated by ubuntu-drivers
# Set value to 1 to enable modesetting, 0 to disable it
options nvidia-drm modeset=%d
�wN)rN�write�close)�value�nvidia_kms_file�kms_text�kms_fds    r�set_nvidia_kmsr0Cs9��7�O�#�&+�-�H��/�3�
'�F�
�L�L���
�L�L�Nrc���[U5nU(d[R"S5n0n[
U5nUR5H�up�[XUS9H�n
U(a[X
5(dMU(d([R"U
RS5(aMKUU	[X
5[X
5[X
5[X
U5[X
5S.XjR'[!X�5up�UbX�U
RS'UcM�X�U
RS'M� M� UV
s/sHo�R#S5(dMU
PM n
n
U
(ayUR5H&up�UR#S5(dMU[$U'M( U
R'[(R*"[,5S9 U
S	nU
H
n
U
U:HXjS
'M [/U5R5H0unnUH$n
X
n[UU5[UU5US.Xj'M& M2 U$![a"n[R
"U5 0sSnA$SnAff=fs sn
f![0a [R2"SU
-5 M�f=f)
uqGet driver packages that are available for the system.

This calls system_modaliases() to determine the system's hardware and then
queries apt about which packages provide drivers for those. It also adds
available packages from detect_plugin_packages().

If you already have an apt_pkg.Cache() object, you should pass it as an
argument for efficiency. If not given, this function creates a temporary
one by itself.

If freeonly is set to True, only free packages (from main and universe) are
considered

Return a dictionary which maps package names to information about them:

  driver_package → {'modalias': 'pci:...', ...}

Available information keys are:
  'modalias':    Modalias for the device that needs this driver (not for
                 drivers from detect plugins)
  'syspath':     sysfs directory for the device that needs this driver
                 (not for drivers from detect plugins)
  'plugin':      Name of plugin that detected this package (only for
                 drivers from detect plugins)
  'free':        Boolean flag whether driver is free, i. e. in the "main"
                 or "universe" component.
  'from_distro': Boolean flag whether the driver is shipped by the distro;
                 if not, it comes from a (potentially less tested/trusted)
                 third party source.
  'vendor':      Human readable vendor name, if available.
  'model':       Human readable product name, if available.
  'recommended': Some drivers (nvidia, fglrx) come in multiple variants and
                 versions; these have this flag, where exactly one has
                 recommended == True, and all others False.
N�r��
oem-*-meta)rFr�free�from_distror�r��open_preferredrr r%��keyr
�recommended)r4r5�pluginz*Package %s plugin not available. Skipping.)rbrB�Cacher�rr�r�r�r�r�r�r%r�r�rr'r#rT�lookup_cache�sort�	functoolsr�_cmp_gfx_alternatives�detect_plugin_packagesrfr)rorW�freeonly�include_oemr��exr�r�r�rr�rr �nvidia_packagesr8r,r9r:r��apt_ps                    r�system_driver_packagesrFNsA��J#�8�,�J��	��
�
�d�+�I�
�H�)�)�4�L�$�*�*�,���&�y�l�S�A�� 0�� >� >���7�?�?�1�6�6�<�#H�#H�� %�&�,�Y�:�#:�9�#H�/�	�=�!8��u�!M�&7�	�&E� �H�V�V��+�7�:�O�V��!�-3���� ��*�� �,1���� ��)�%T�-�,#+�F�(�Q�l�l�9�.E�q�(�O�F��#�.�.�*�J�C��~�~�i�(�(�$)��S�!�+�	����!5�!5�6K�!L��M�%�b�)�� �A�*+�{�*:�H�K�
�&�!�/�y�9�?�?�A�����A�
P�!��� 0��E� B�'>�y�%�'P�"(�����B��O��k�	��M�M�"���I��	��8G��,�
P��
�
�J�Q�N�O�
P�s;�H�(I�I�2 I�
I�&I�=I�I�#I7�6I7c��[R"S5nURU5nU(a(URS5SSURS5SS4$g)Nz$(.+):v(.+)d(.+)sv(.+)sd(.+)bc(.+)i.*r��r)rr r!r#)r��modalias_pattern�detailss   rr�r��sS���z�z�"H�I���$�$�U�+�G���
�
�a� ���$�g�m�m�A�&6�q�r�&:�;�;�rc���UceSn[R"U5n[U5nUR(d[R
"SU-5 U$UR
5(a[R
"SU-5 U$UR5nSU-nXnURU5nU(aURS[54;aUnU$![a U$f=f)N�)Unsupported driver detected: %s. Skipping�%Legacy driver detected: %s. Skipping.znvidia-driver-lrm-%sr�)rBrgrrrrr+r7rh�archrDrf)	ror�metapackagersr&�candidate_flavourrtrp�package_candidates	         r�get_userspace_lrm_metarS�s��������K�����	�*�H�#�H�-�K�����
�
�A�H�L�M����+�+�-�-��
�
�=��H�I���#�/�/�1��&�*;�<�I�	
��&��%�6�6�w�?���!�&�&�5�,�.�*A�A�#�K�����
����
�s�8C�
C$�#C$c���UceSn[R"U5nURn[U5nUR(d[
R"SU-5 U$UR5(a[
R"SU-5 U$UR5nSU-nXnURU5n	U(aU	RS[54;aUnU$![a U$f=f)NrMrNznvidia-headless-no-dkms-%sr�)
rBrgr%rrrrr+r7rhrOrDrf)
r�rorPrsr%r&rQrtrprRs
          r�!_get_headless_no_dkms_metapackagerU�s����?��?��K��
���	�*�H��8�8�D�#�D�)�K�����
�
�A�D�H�I����+�+�-�-��
�
�=��D�E���#�/�/�1��,�0A�B�I�	
��&��%�6�6�w�?���!�&�&�5�,�.�*A�A�#�K�����
����
�s�(8C"�"
C0�/C0c��U(d0$[U5nU(d[R"S5n0n[
U5nUR5Hxupx[XUS9Hen	[R"U	RS5(dM+UU[X	5[X	5S[X	5[X	5S.XYR'Mg Mz U$![a"n[R
"U5 0sSnA$SnAff=f)uxGet device specific metapackages for this system

This calls system_modaliases() to determine the system's hardware and then
queries apt about which packages provide hardware enablement support for
those.

If you already have an apt_pkg.Cache() object, you should pass it as an
argument for efficiency. If not given, this function creates a temporary
one by itself.

Return a dictionary which maps package names to information about them:

  driver_package → {'modalias': 'pci:...', ...}

Available information keys are:
  'modalias':    Modalias for the device that needs this driver (not for
                 drivers from detect plugins)
  'syspath':     sysfs directory for the device that needs this driver
                 (not for drivers from detect plugins)
  'plugin':      Name of plugin that detected this package (only for
                 drivers from detect plugins)
  'free':        Boolean flag whether driver is free, i. e. in the "main"
                 or "universe" component.
  'from_distro': Boolean flag whether the driver is shipped by the distro;
                 if not, it comes from a (potentially less tested/trusted)
                 third party source.
  'vendor':      Human readable vendor name, if available.
  'model':       Human readable product name, if available.
  'recommended': Always True; we always recommend you install these
                 packages.
Nr2r3T)rFrr4r5r9r�r6)rbrBr;r�rr�r�r�r�r�r%r�r�r�r')
rorWrBr�rCr�r�r�rr�s
          r�#system_device_specific_metapackagesrWs���@��	�"�8�,�J��	��
�
�d�+�I�
�H�)�)�4�L�$�*�*�,���&�y�l�S�A��?�?�1�6�6�<�8�8�� %�&�,�Y�:�#:�9�#H�#'�/�	�=�&7�	�&E� �H�V�V��T�-��O��)�	��M�M�"���I��	�s�C�
C:�C5�/C:�5C:c��S/n[U5nU(d[R"S5n0n[
U5nUR5H�upx[XUS9H�n	[X�5up�[U5up�UcM"UR5U;dM8UU[X	5[X	5[X	5[X	5S.XYR 'U
bX�U	R S'UbX�U	R S'[#X�5nUcM�X�U	R S'M� M� UV	s/sHo�R%S5(dMU	PM nn	U(azUR5H'unnUR%S5(dMU[&U'M) UR)[*R,"[.5S	9 US
nUH
n	U	U:HXYS'M U$![a"n[R
"U5 0sSnA$SnAff=fs sn	f)uNGet driver packages, for gpgpu purposes, that are available for the system.

This calls system_modaliases() to determine the system's hardware and then
queries apt about which packages provide drivers for those. Finally, it looks
for the correct metapackage, by calling _get_headless_no_dkms_metapackage().

If you already have an apt_pkg.Cache() object, you should pass it as an
argument for efficiency. If not given, this function creates a temporary
one by itself.

Return a dictionary which maps package names to information about them:

  driver_package → {'modalias': 'pci:...', ...}

Available information keys are:
  'modalias':    Modalias for the device that needs this driver (not for
                 drivers from detect plugins)
  'syspath':     sysfs directory for the device that needs this driver
                 (not for drivers from detect plugins)
  'plugin':      Name of plugin that detected this package (only for
                 drivers from detect plugins)
  'free':        Boolean flag whether driver is free, i. e. in the "main"
                 or "universe" component.
  'from_distro': Boolean flag whether the driver is shipped by the distro;
                 if not, it comes from a (potentially less tested/trusted)
                 third party source.
  'vendor':      Human readable vendor name, if available.
  'model':       Human readable product name, if available.
  'recommended': Some drivers (nvidia, fglrx) come in multiple variants and
                 versions; these have this flag, where exactly one has
                 recommended == True, and all others False.
�10deNr2)rFrr4r5r�r6rr rPr%r7r
r9)rbrBr;r�rr�r�r�r�r#r�r�r�r�r�r'r%rUrTr<r=r>r�_cmp_gfx_alternatives_gpgpu)rorW�vendors_whitelistr�rCr�r�r�rr�rr �	vendor_id�model_idrPrDr8r,r9s                   r�system_gpgpu_driver_packagesr^Bs���D ���"�8�,�J��	��
�
�d�+�I�
�H�)�)�4�L�$�*�*�,���&�y�l�S�A�*�7�:�O�V�">�u�"E��I��%�I�O�O�,=�AR�,R�$)�#*� 0�� >�'>�y�'L�#3�I�#A�*;�I�*I�
$���� ��%�17�Q�V�V�$�X�.��$�05�Q�V�V�$�W�-�?��M���*�6A�Q�V�V�$�]�3�'T�-�.#+�F�(�Q�l�l�9�.E�q�(�O�F��#�.�.�*�J�C���~�~�i�(�(�$)��S�!�+�	����!5�!5�6Q�!R��S�%�b�)�� �A�*+�{�*:�H�K�
�&�!��O��S�	��M�M�"���I��	��:Gs)�G�G6�<G6�
G3�G.�(G3�.G3c�Z�0nU(d[R"S5n[XUS9R
5HtupVSU;aUSnOUSnURU05 SHnX�;dM
XhX7U'M X7RS05n	USUSS	.X�'S
U;dMjUS
X�S
'Mv UR
5H,up�USHn[XU5(aM M% SUS'M. [U5 U$![a"n[R"U5 0sSnA$SnAff=f)
um
Get by-device driver packages that are available for the system.

This calls system_modaliases() to determine the system's hardware and then
queries apt about which packages provide drivers for each of those. It also
adds available packages from detect_plugin_packages(), using the name of
the detction plugin as device name.

If you already have an apt_pkg.Cache() object, you should pass it as an
argument for efficiency. If not given, this function creates a temporary
one by itself.

If freeonly is set to True, only free packages (from main and universe) are
considered

Return a dictionary which maps devices to available drivers:

  device_name →  {'modalias': 'pci:...', <device info>,
                  'drivers': {'pkgname': {<driver package info>}}

A key (device name) is either the sysfs path (for drivers detected through
modaliases) or the detect plugin name (without the full path).

Available keys in <device info>:
  'modalias':    Modalias for the device that needs this driver (not for
                 drivers from detect plugins)
  'vendor':      Human readable vendor name, if available.
  'model':       Human readable product name, if available.
  'drivers':     Driver package map for this device, see below. Installing any
                 of the drivers in that map will make this particular
                 device work. The keys are the package names of the driver
                 packages; note that this can be an already installed
                 default package such as xserver-xorg-video-nouveau which
                 provides a free alternative to the proprietary NVidia
                 driver; these will have the 'builtin' flag set.
  'manual_install':
                 None of the driver packages are installed, but the kernel
                 module that it provides is available; this usually means
                 that the user manually installed the driver from upstream.

Aavailable keys in <driver package info>:
  'builtin':     The package is shipped by default in Ubuntu and MUST
                 NOT be uninstalled. This usually applies to free
                 drivers like xserver-xorg-video-nouveau.
  'free':        Boolean flag whether driver is free, i. e. in the "main"
                 or "universe" component.
  'from_distro': Boolean flag whether the driver is shipped by the distro;
                 if not, it comes from a (potentially less tested/trusted)
                 third party source.
  'recommended': Some drivers (nvidia, fglrx) come in multiple variants and
                 versions; these have this flag, where exactly one has
                 recommended == True, and all others False.
N)rArr:)rFrr �driversr4r5)r4r5r9T�manual_install)
rBr;r�rr�rFr�r�r�
_add_builtins)rorWrAr�rCr��pkginfo�device_name�opt_keyr`rJr�s            r�system_device_driversrf�sL��j�F��	��
�
�d�+�I�/�y�8@�B�BG�%�'�J������!�)�,�K�!�(�+�K����+�r�*�6�G��!�/6�/?��#�G�,�7��%�0�0��B�?�� '����
�@V�W����G�#�*1�-�*@�G�L��'�J�"�������	�?�C�%�i�3��@�@��#�&*�D�!�"�'��&���M��A�	��M�M�"���I��	�s�C>�>
D*�D%�D*�%D*c���[XUUS9n[XdSS9nU(d[R"S5 U$[R
"U5n[R"U5n/n	[UR5[S5SS9GH:up�X
nUR(aMURU5n
URU
RS5 U	RU
5 US	(a.[S
S5nUR!S5 UR#5 ['X
5nU(a�XR(d|U(dS
U;aU	R)U
5 M�U	RU5 [+X
5nU(a6UUR(d"U	RU5 U	R)U
5  U	$GM:GM= U	$![$a N�f=f![,a GM_f=f)z4Return the list of packages that should be installed)rArBF)�get_recommendedz"No drivers found for installation.c�&�[USUS5$)Nr)r?)�left�rights  r�<lambda>�*get_desktop_package_list.<locals>.<lambda>s��:O�PT�UV�PW�Y^�_`�Ya�:brT)r8�reverserr��/run/nvidia_runtimepm_supportedr)�
�dkms)rF�auto_install_filterrrrBrgr��sortedr�rr
rhr�r��appendrNr*r+�PermissionError�get_linux_modules_metapackage�removerSrf)rorW�	free_onlyrB�
driver_string�include_dkmsr�rsr��
to_installr�r��package_objrt�pm_fd�modules_package�lrm_metas                 r�get_desktop_package_listr��s���&��i��!�H�#�8�E�R�H���
�
�:�;������	�*�H��$�$�Y�/�G��J��x�~�~�'�%�&b�c�#�%��� �l���&�&�&� �2�2�;�?�I��N�N�9�.�.�q�1�2����a� ��{�#�� �!B�C�H�E��K�K��%��K�K�M�
�"?�	�"M��"�9�+E�+Q�+Q�'�F�o�,E�"�)�)�!�,� ��%�%�o�6�5�i�C�H��	�(�(;�(G�(G�"�)�)�(�3�"�)�)�!�,����,R�?�1%�N���-'�����&�
��
�s,�.-G�AG�!AG�
G�G�
G&�%G&c�n�UH/n[U5nUR5S:�dM$[S5  g g)zHApplies changes that need to happen before installing the NVIDIA driversi�rN)rr4r0)r{�package_namer&s   r�$nvidia_desktop_pre_installation_hookr�-s4��#��'��5���(�(�*�c�1��1���	#rc�:�[RRS5(aV[R"S5 [
R"SS/5 [SS5nURS5 SSS5 gg![a N4f=f!,(df   g=f)Nroz,Trying to select the on-demand PRIME profilez/usr/bin/prime-selectz	on-demandz$/etc/u-d-c-nvidia-runtimepm-overrider)z!# File created by ubuntu-drivers
)
rLrO�isfilerrr�callrrNr*)r\s r�%nvidia_desktop_post_installation_hookr�8s���
�w�w�~�~�7�8�8��
�
�D�E�	��O�O�4�k�B�C�
�8�#�
>�!�
�G�G�8�9�?�
>�9��!�	��	��?�
>�s�A<� B�<
B	�B	�
Bc�$�\rSrSrSSjrSrSrg)�_GpgpuDriveriGNc�*�SUlXlX lg)N)r)�_vendors_whitelistr�flavour)rrr�s   rr�_GpgpuDriver.__init__Is��"-������rc���UR(a1[R"URUR5(dgUR(+=(a UR(+(+$)NF)rr��filterr�r�r*s rr�_GpgpuDriver.is_validNsB���;�;��>�>�$�"9�"9�4�;�;�G�G�����O�8�D�L�L�(8�9�9r)r�r�rr)r9r:r;r<rrr>r?rrr�r�Gs���
:rr�c��[5n[R"S5n[R"S5n[R"S5nURU5nURU5nURU5nU(aCUR	S5UlUR	S5<UR	S5<3UlU$U(aXlU$U(a+UR	S5<UR	S5<3UlU$)zReturns a _GpgpuDriver objectz(.+):([0-9]+)(.*)z([a-z]+)z([0-9]+)(.*)rrrI)r�rr r!r#rr�)�stringrJ�full_pattern�vendor_only_pattern�series_only_pattern�
full_match�vendor_match�series_matchs        r�_process_driver_stringr�Vs���
�^�F��:�:�1�2�L��*�*�Z�0���*�*�^�4���#�#�F�+�J�&�,�,�V�4�L�&�,�,�V�4�L��"�(�(��+��
�#-�#3�#3�A�#6�
�8H�8H��8K�L����M�
��
��M�
�#/�#5�#5�a�#8�,�:L�:L�Q�:O�P����Mrc��/n/n0nU(dU$U(aUURS5H?n[U5nU(dMUR5(dM.URU5 MA O[	5nURU5 [U5S:aU$SnUH"nUR(d	SX8lUS-
nM$ Sn/n	UHUnURn
U	RU
5(a[R"S5 Us $U	RU
5 US-
nMW SnUH3nUR(dUR(d	SX8lUS-
nM5 UHfnUR(aUR<SUR<3nOSUR-nUR[R"X55 Mh UHsnUHjnURUR5(dM%UR(aXX\'O,U(aXRS5(aXX\'OXX\' Mq Mu U$)	Nr�rrrz0Multiple nvidia versions passed at the same time�*z%s*r9)rUr�rrtr��lenr�__contains__rrr��extendr�r�rj)
r��drivers_strrhr`�allowr��itemrJ�it�vendors_temprr&r�s
             r�gpgpu_install_filterr�ms����G��E�
�F��&��
�� �%�%�c�*�D�+�D�1�F��v�&�/�/�+�+����v�&�+�������v��
�7�|�a���
�
�B����}�}�!)�G�K��
�a����
�B��L��������$�$�V�,�,��M�M�L�M��M����F�#�
�a����
�B����~�~�f�m�m�!)�G�K��
�a�������>�>�!'������?�G��v�}�}�-�G�
���W�^�^�H�6�7�����F��~�~�f�m�m�,�,��>�>� (��F�I�'�#�;�?�?�=�9�9�(0��F�I��$,�K��	���� �Mrc��/SQnU(a
[X5nU$/nUH(nUR[R"X55 M* 0nUH.nU(aSX;dXS(aXXx'M&M(XXx'M0 U$)aqGet packages which are appropriate for automatic installation.

Return the subset of the given list of packages which are appropriate for
automatic installation by the installer. This applies to e. g. the Broadcom
Wifi driver (as there is no alternative), but not to the FGLRX proprietary
graphics driver (as the free driver works well and FGLRX does not provide
KMS).
)zbcmwl*z	pvr-omap*zvirtualbox-guest*znvidia-*zopen-vm-tools*z
hwe-*-metar3zbroadcom-sta-dkmsr9)r�r�r�r�)	r�r�rh�	whitelist�resultsr�r&r�r�s	         rrrrr�s���T�I��&�x�=�����E���
���W�^�^�H�6�7���F�
����H�K�/�8�;�}�3M�$�K��	�4N�!��F�I���Mrc	���0n[RRSS5n[RR	U5(d[
R"SU5 U$Uc[R"S5n[R"U5GHDnURS5(dM[RRX$5n[
R"SU5 0n[U5n[[!UR#5US5U5 US"U5n[
R"S	XX5 UcSSS5 M�['U5[([*4;a,[
R"SU['U55 SSS5 M�UH;n	X	n
[-X
5(a#UR/U/5R1U	5 M;M= SSS5 GMG U$![a"n[
R"U5 0sSnA$SnAff=f![a$ [
R$"S
U5 SSS5 GM�f=f![2a [
R"SX�5 M�f=f!,(df   GM�=f)
a9Get driver packages from custom detection plugins.

Some driver packages cannot be identified by modaliases, but need some
custom code for determining whether they apply to the system. Read all *.py
files in /usr/share/ubuntu-drivers-common/detect/ or
$UBUNTU_DRIVERS_DETECT_DIR and call detect(apt_cache) on them. Filter the
returned lists for packages which are available for installation, and
return the joined results.

If you already have an existing apt_pkg.Cache() object, you can pass it as an
argument for efficiency.

Return pluginname -> [package, ...] map.
�UBUNTU_DRIVERS_DETECT_DIRz(/usr/share/ubuntu-drivers-common/detect/z3Custom detection plugin directory %s does not existNz.pyz"Loading custom detection plugin %s�exec�detectzplugin %s return value: %szplugin %s failed:z6plugin %s returned a bad type %s (must be list or set)z.Ignoring unavailable package %s from plugin %s)rLrrjrO�isdirrrrBr;r�r��listdir�endswithrPrNr�r rQ�	exception�typer�r�r�r�rtrf)ror��	plugindirrC�fnamer:�symbr\r�r�rps           rr@r@�s���H��
�
���:�I�K�I�
�7�7�=�=��#�#��
�
�K�Y�W�����	��
�
�d�+�I�
���I�&���~�~�e�$�$�������i�/���
�
�:�F�C���
�&�\�Q�
��W�Q�V�V�X�v�v�6��=��h��	�2���
�
�:�F�K�
�~���\��F�|�D�#�;�.��
�
�V�X^�`d�ek�`l�m���\���a�'�n�G�.�y�B�B� �+�+�E�2�6�=�=�c�B�C���\�'�<�O��E�	��M�M�"���I��	�� �
��!�!�"5�v�>���\�

�� �a��M�M�"R�TW�`�a��)�\�s�$G�/I#�1AH
�8I#�;I#�I#�5H;�I#�
H�%H�<H�H�
!H8�+I#�7H8�8I#�;!I 	�I#�I 	� I#�#
I3	c��[RU5(a$[RU5RS5$g)z5Look up driver package and return their support levelr�N�r<rj�r�s r�_pkg_support_from_cacher�2s2������������"�&�&�y�1�1�rc��[RU5(a$[RU5RS5$g)z6Look up driver and return if open package is preferredr6Fr�r�s r�_pkg_open_preferred_from_cacher�9s3������������"�&�&�'7�8�8�rc��[U5(av[R"SU5(ag[R"SU5(ag[R"SU5(ag[R"SU5(agg[R"SU5(ag[R"SU5(ag[R"SU5(ag[R"SU5(agg)	z4decide how well the package fits desktop environment�
(\d{3})-open$rI�(\d{3})$r�(\d{3})-server-open$r�(\d{3})-server$r�r�rr�r�s r�_get_fit_levelr�@s���&�a�(�(�
�9�9�%�q�)�)��
�9�9�[�!�$�$��
�9�9�,�a�0�0��
�9�9�'��+�+��,�
��9�9�[�!�$�$��
�9�9�'��+�+��
�9�9�%�q�)�)��
�9�9�,�a�0�0��rc��[U5(av[R"SU5(ag[R"SU5(ag[R"SU5(ag[R"SU5(agg[R"SU5(ag[R"SU5(ag[R"SU5(ag[R"SU5(agg)	z3decide how well the package fits server environmentr�rIr�rr�rr�rr�r�s r�_get_fit_level_gpgpur�as���&�a�(�(�
�9�9�,�a�0�0��
�9�9�'��+�+��
�9�9�%�q�)�)��
�9�9�[�!�$�$��%�
��9�9�'��+�+��
�9�9�[�!�$�$��
�9�9�,�a�0�0��
�9�9�%�q�)�)��rc��URS5(Ga�URS5(Ga�[U5[U5:�ag[U5[U5:agSS/nSnSn[U5n[U5nXR;aUS-
nXb;aUS-
nX:�aUS-
nO
X:aUS-
nUS:�dUS:�aX4:�agX4:ag[U5S:Xa[U5S:wag[U5S:wa[U5S:Xag[U5S:Xa[U5S:wag[U5S:wa[U5S:Xag[U5S:Xa[U5S:wag[U5S:wa[U5S:Xag[U5S	:Xa[U5S	:wag[U5S	:wa[U5S	:Xag[U5S
:Xa[U5S
:wag[U5S
:wa[U5S
:XagX:agX:�agX:Xdeg)a(Compare two graphics driver names in terms of preference. (desktop)

-open by default sorts after non-open, unless a driver preferes open variant
-server always sorts after non-server.
LTSB (Long Term Support Branch) always sorts before NFB (New Feature Branch).
Legacy always sorts before Beta.
r%rr
r�r�r�dr�r��Beta)rTr�r�)r��y�preferred_support�x_score�y_score�	x_support�	y_supports       rr?r?�s��	�|�|�I���1�<�<�	�#:�#:��!��~�a�0�0���!��~�a�0�0��!�6�N������+�A�.�	�+�A�.�	��)��s�N�G��)��s�N�G��5��q�L�G�
�U��q�L�G�
��^��C��� ���"��"�1�%��-�2I�!�2L�PT�2T��"�1�%��-�2I�!�2L�PT�2T��"�1�%��/�4K�A�4N�RX�4X��"�1�%��/�4K�A�4N�RX�4X��"�1�%��.�3J�1�3M�QV�3V��"�1�%��.�3J�1�3M�QV�3V��"�1�%��1�6M�a�6P�T\�6\��"�1�%��1�6M�a�6P�T\�6\��"�1�%��/�4K�A�4N�RX�4X��"�1�%��/�4K�A�4N�RX�4X���u���u���6�M�6�rc�V�URS5(GaURS5(Gah[U5[U5:�ag[U5[U5:ag[U5S:Xa[U5S:wag[U5S:wa[U5S:Xag[U5S:Xa[U5S:wag[U5S:wa[U5S:Xag[U5S:Xa[U5S:wag[U5S:wa[U5S:Xag[U5S:Xa[U5S:wag[U5S:wa[U5S:Xag[U5S:Xa[U5S:wag[U5S:wa[U5S:XagX:agX:�agX:Xdeg	)
a]Compare two graphics driver names in terms of preference. (server)

-open by default sorts after non-open, unless a driver preferes open variant
-server always sorts before non-server.
non server package always sorts after server package
LTSB (Long Term Support Branch) always sorts before NFB (New Feature Branch).
Legacy always sorts before Beta.
r%rr
r�r�r�r�r�r)rTr�r�)r�r�s  rrZrZ�s���	�|�|�I���1�<�<�	�#:�#:���"�%9�!�%<�<����"�%9�!�%<�<��"�1�%��-�2I�!�2L�PT�2T��"�1�%��-�2I�!�2L�PT�2T��"�1�%��/�4K�A�4N�RX�4X��"�1�%��/�4K�A�4N�RX�4X��"�1�%��1�6M�a�6P�T\�6\��"�1�%��1�6M�a�6P�T\�6\��"�1�%��.�3J�1�3M�QV�3V��"�1�%��.�3J�1�3M�QV�3V��"�1�%��/�4K�A�4N�RX�4X��"�1�%��/�4K�A�4N�RX�4X���u���u���6�M�6�rc��UR5HtupUSHfnURS5(aSSSSS.USS' M3URS5(dMAUSHnSUSUS'M SSSSS.USS	' Mr Mv g
)zAdd builtin driver alternativesr`rTF)r4�builtinr5r9zxserver-xorg-video-nouveaurr9zxserver-xorg-video-atiN)r�rT)r`�devicer�r��ds     rrbrb�s��� �
�
�����	�?�C��~�~�h�'�'� �T�$�W\�A^��Y�� <�=���~�~�g�&�&��i��A�8=�D��O�A�&�}�5�)�!�T�$�W[�=]��Y�� 8�9��#�(rc�N�[R"U5nUR5$)z0Return the linux headers for the system's kernel)r�KernelDetection�get_linux_headers_metapackage�ro�kernel_detections  r�get_linux_headersr�
s"��&�6�6�y�A���9�9�;�;rc�N�[R"U5nUR5$�z.Return the linux image for the system's kernel)rr��get_linux_image_metapackager�s  r�get_linux_imager�s"��&�6�6�y�A���7�7�9�9rc�N�[R"U5nUR5$r�)rr��get_linux_versionr�s  rr�r�s"��&�6�6�y�A���-�-�/�/rc�N�[R"U5nUR5$)z4Return the linux metapackage for the system's kernel)rr��get_linux_metapackager�s  r�	get_linuxr�s"��&�6�6�y�A���1�1�3�3rc��[R"U5nURX5nURRS5H+nUH"upVnURS5(dMUs s $ M- g![a [R
"SU-5 gf=f![[4a [R
"SU-5 gf=f)NzNo candidate for %s foundrd�linux-image-z+Could not check dependencies for %s package)
rBrgrhrfrrrirjrTrk)ror�rsrtrvrwrxrys        r�get_linux_image_from_metar�"s������	�*�H���.�.�y�~�>�	�
M�!�2�2�6�6�y�A�H�-5�)��6��&�&�~�6�6�#�O�.6�B�&��1���
�
�1�C�7�8����
�i� �M��
�
�C�s�K�L��M�s.�A7�:B �*B �0B �7#B�B� )C�Cc�
�UceSnSnSn[R"U5n[U5nUR(d[R
"SU-5 U$UR
5(a[R
"SU-5 U$[U5n[X5nU(aURSS5nO[R
"SU-5 U$UR5n	SU	<SU<3n
X
nURU5nU(a�URS	[54;a[U5n
SU	<SU
<3n[R
"S
U-5 XnURU5nU(a5URS	[54;a[R
"SU-5 U
nU(a�XR Vs/sHEnUR"R$R'S5(dM/UR"R$PMG nnSn[U5RSS5nUS
:XaSnSU	<SU<3nUH
nUU:XdMUnM U(aUnU$SU	-n[R
"SU-5 UUnURU5nU(aURS	[54;aUnU$![a [R
"SU
5 GN0f=fs snf![a [R("SU5 U$f=f)zDReturn the linux-modules-$driver metapackage for the system's kernelNrzNNon NVIDIA linux-modules packages are not supported at this time: %s. SkippingrNr�z-No linux-image can be found for %s. Skipping.zlinux-modules-nvidia-�-r�zlinux_modules_abi_candidate: %szFound ABI compatible %szNo "%s" can be found.�virtual�genericznvidia-dkms-%szFalling back to %s)rBrgrrrrr+r�r�rer7rhrOrDr�rfrmrnr%rTr�)rortrP�
linux_flavour�linux_modules_matchrsr&�linux_image_meta�linux_imagerQ�linux_modules_candidaterprR�
linux_version�linux_modules_abi_candidate�abi_specific�abi_specific_candidater�reverse_deps�pick�candidate_suffix�modules_candidate�dkms_packages                       rrvrvBs���� � � ��K��M������	�*�H�#�I�.�K�����
�
�f�ir�r�s����+�+�-�-��
�
�=�	�I�J���&�y�1��+�I�H�K��#�+�+�N�B�?�
��
�
�E�	�Q�R���#�/�/�1��>O�Q^�_��
��4��$�6�6�w�?���"3�"8�"8�U�L�N�<S�"S�-�i�8�M�J[�]j�*k�'��M�M�;�?Z�[�\�%�A�L�%-�%?�%?��%M�"�&�*�/�/�E�<�>�3J�J��
�
�7�;V�W�X�&=�#��8A�7U�7f�7f�T�7f���>�>�.�.�9�9�:Q�R�,����+�+�7f��T���*�9�5�=�=�n�b�Q���y�(�(���<M�O_�`���C��'�'��� ���K���$�&7�7�L��M�M�&�,�7�8�

��L�)��$�6�6�w�?��
�!�&�&�5�,�.�*A�A�&�K�
���U�
��
�
�-�/F�G��
��T��:�
��
�
�-�|�<����	
�s1�/B5J0�;.K�-K�59K�0!K�K�!L�Lr))NNFT)NNTr)NNF)NFTrF)T)rT)@r=rLrr�rr>rr�rB�
UbuntuDriversrrrAr<r��objectrrDrbr�r�r�r�r�r�r�r�r�r�r�rrrr#r'r0rFr�rSrUrWr^rfr�r�r�r�r�r�rrr@r�r�r�r�r?rZrbr�r�r�r�r�rvr?rr�<module>r�s_��M�
�����	���)� �����>��C��C�L�,�^5�p5�p&��6"(�J�:	��*�,�,�<Z�.9�
 �F�8�$�_�D� �F"�J<�~Q�hY�z@D�',�8�v�:�:�6�:��.d�N�@;�|��
�B
�BB
�J*
�Z�,<�:�0�4��@\r

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 153 B 0644
detect.cpython-313.pyc File 66.93 KB 0644
kerneldetection.cpython-313.pyc File 7.51 KB 0644
Filemanager