%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/uaclient/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/uaclient/__pycache__/system.cpython-312.pyc

�

�Hcff���ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddlmZmZmZmZmZmZmZddlmZmZmZdZdZdZd	Zd
ZddiZ ejBejDe#��Z$d
Z%dZ&eddejNfdejNfg�Z(edde)fde)fdeejfdee)fdee*fdee*fdee*fdee)fdee)fg	�Z+edde)fde)fde)fd e)fg�Z,ed!d"e)fd#ee*fd$ee*fg�Z-ed%d&eee)fd'eee)fg�Z.d(Z/d)ej`d*eejfd+�Z1d)ej`d*eejfd,�Z2ed�-�d*e+fd.��Z3d/�Z4ed�-�d*e)fd0��Z5ed�-�d*e)fd1��Z6ed�-�d*e-fd2��Z7ed�-�d*e)fd3��Z8ed�-�d*e,fd4��Z9ed�-�de)d*e:fd5��Z;ed�-�d*e:fd6��Z<ed�-�de)d*e:fd7��Z=ed�-�de)d*e:fd8��Z>ed�-�d*e:fd9��Z?ed�-�d_d:e)d*e:fd;��Z@ed�-�d*e:fd<��ZAed�-�d*ee)e)ffd=��ZBed�-�de)d*e(fd>��ZCd?e)d*ee)fd@�ZD		d`dAeee)dBeee)d*e:fdC�ZEdDe)d*e:fdE�ZFdadFe)dGe:d*e)fdH�ZGdbdFe)dIe*d*dfdJ�ZH	dcdFe)dKe)dIee*d*dfdL�ZIdMe)d*dfdN�ZJ					dddOee)dPeee*dQe:dReeKdSeee)e)fdTe:d*ee)e)ffdU�ZL						dedOee)dPeee*dQe:dReeKdVeeeKdSeee)e)fdTe:d*ee)e)ffdW�ZMdXe)d*dfdY�ZNdZe)d*e:fd[�ZOdZe)d*ee)fd\�ZPd*e)fd]�ZQd*ee.fd^�ZRy)f�N)�	lru_cache)�rmtree)�Dict�List�
NamedTuple�Optional�Sequence�Set�Tuple)�defaults�
exceptions�utilz/var/run/reboot-requiredz/var/run/reboot-required.pkgsz/etc/machine-idz/var/lib/dbus/machine-idz!/usr/share/distro-info/ubuntu.csv�GenuineIntel�intelz5(?P<release>\d+\.\d+) (LTS\s*)?(\((?P<series>\w+))?.*zd^(?P<major>[\d]+)[.-](?P<minor>[\d]+)[.-](?P<patch>[\d]+)-(?P<abi>[\d]+)-(?P<flavor>[A-Za-z0-9_-]+)$�
DistroInfo�eol�eol_esm�
KernelInfo�uname_machine_arch�
uname_release�
build_date�proc_version_signature_version�major�minor�patch�abi�flavor�ReleaseInfo�distribution�release�series�pretty_version�CpuInfo�	vendor_id�model�stepping�RebootRequiredPkgs�standard_packages�kernel_packagesz(Mon|Tue|Wed|Thu|Fri|Sat|Sun).*�uname�returnc��t�rtjd�ytjd�	tjdj|j��}tjj|jtjj�S#t$rtjd�YywxYw)NzPNot attempting to use timestamp of kernel changelog because we're in a containerz3Falling back to using timestamp of kernel changelogz1/usr/share/doc/linux-image-{}/changelog.Debian.gzzUnable to stat kernel changelog)
�is_container�LOG�warning�os�stat�formatr �datetime�
fromtimestamp�st_mtime�timezone�utc�	Exception)r*�stat_results  �1/usr/lib/python3/dist-packages/uaclient/system.py�_get_kernel_changelog_timestampr;_s����~����^�	
���K�K�E�F���g�g�?�F�F��
�
�
�
��
� � �.�.�� � �(�"3�"3�"7�"7�
�	
�������5�6���s�A/B'�'C�Cc��tjt|j�}|� tjd�t
|�S|jd�}	tjj|d�}|j�*|jtjj��}|S#t$r#tjd�t
|�cYSwxYw)Nz*Unable to find build date in uname versionrz%a %b %d %H:%M:%S %Z %Yz-Unable to parse build date from uname version)�tzinfo)�re�search�RE_KERNEL_EXTRACT_BUILD_DATE�versionr.r/r;�groupr3�strptime�
ValueErrorr=�replacer6r7)r*�
date_match�date_str�dts    r:�_get_kernel_build_daterIxs������7����G�J������@�A�.�u�5�5�����"�H�6�
�
�
�
'�
'��2K�
L��
�y�y���Z�Z�x�0�0�4�4�Z�
5��
�I���6����C�D�.�u�5�5�6�s� B1�1)C�C)�maxsizec
��d}	td�}|j�d}tj�}|jj�}t|�}|jj�}tjt|�}|�*tj	d|�t||||ddddd��	St||||t|j!d��t|j!d��t|j!d��|j!d	�|j!d
���	S#t$rtj	d�Y��4wxYw)Nz/proc/version_signature�z*failed to process /proc/version_signature.zFailed to parse kernel: %s)	rrrrrrrrrrrrrr)�	load_file�splitr8r.r/r0r*�machine�striprIr r>�match�RE_KERNEL_UNAMEr�intrB)r�proc_version_signature_fullr*rrr�uname_matchs       r:�get_kernel_inforV�sG��%)�"�B�&/�0I�&J�#�)D�)J�)J�)L�Q�)O�&�
�H�H�J�E����,�,�.��'��.�J��M�M�'�'�)�M��(�(�?�M�:�K������0�-�@��1�'�!�+I������

�
	
��1�'�!�+I��k�'�'��0�1��k�'�'��0�1��k�'�'��0�1��!�!�%�(��$�$�X�.�

�
	
��/�B����@�A�B�s�D5�5E�Ec��ddlm}tj�st	d��|�D�cgc]}d|vr|��
}}tj
d�D�cgc]}dt
d|g�dvr|��}}|D�cgc]}|td�d��}}|D�cgc]}|td�d��}}|D�	cgc]}	|	|vr|	��
c}	Scc}wcc}wcc}wcc}wcc}	w)	Nr)�get_installed_packages_namesz9get_installed_ubuntu_kernels needs to be executed as rootzlinux-image-z/boot/vmlinu[x|z]-*zLinux kernel�filez/boot/vmlinu?-)�uaclient.aptrXr�we_are_currently_root�RuntimeError�glob�subp�len)
rX�package�linux_imagerY�vmlinux_kernel_files�package_name�linux_image_versions�	file_name�vmlinuz_versionsrAs
          r:�get_installed_ubuntu_kernelsrg�s$��9��%�%�'��G�
�	
�4�5����W�$�	��K���I�I�3�4����T�6�4�.�1�!�4�4�	
����AL��0<��S��(�*�+����
.���	�#�&�'�)�*����(����*�*�	����'��
������
s�
B<�C�6C�C�,
Cc�B�tddg�\}}|j�S)N�dpkgz--print-architecture)r^rP)�out�_errs  r:�
get_dpkg_archrl�s"���f�4�5�6�I�C���9�9�;��c���	tdg�\}}|j�S#tj$r/	t	d�}d|vsd|vrYyd|vrYyYy#t
$rYYywxYwwxYw)N�systemd-detect-virtz/proc/1/cgroup�docker�buildkit�buildah�podman�)r^rPr
�ProcessExecutionErrorrMr8)rj�_�
proc_1_cgroups   r:�
get_virt_typerx�s|����,�-�.���Q��y�y�{����+�+�
�		�%�&6�7�M��=�(�J�-�,G���m�+�����	��	��
�s,�!�A#�A�
A�	A�A#�A�A#c��td�}i}dD]O}tjdj|�|tj�}|s�:|jd�}|||<�Q|j
dd�}|j
d�}|j
d�}ttj
||�|rt|�nd|rt|���Sd��S)	Nz
/proc/cpuinfo)r$r%r&z^{}\s*:\s*(?P<info>\w*)�infor$rtr%r&)
rMr>r?r2�	MULTILINErB�getr#�CPU_VENDOR_MAPrS)�cpu_info_content�cpu_info_values�field�	cpu_match�value�vendor_id_baser%r&s        r:�get_cpu_infor��s��� ��1���O�3�+���I�I�&�-�-�e�4���L�L�
�	�
��O�O�F�+�E�%*�O�E�"�+�%�(�(��b�9�N�����(�E��"�"�:�.�H�� �$�$�^�^�D�!�c�%�j�t�"*��X����15��rmc��ddlm}|jr/|jjdi�jd�}|r|S|j	�}t
tfD]B}tjj|�s�#t|�jd�}|s�@|cS|r|Sttj��}|j|�|S)z�
    Get system's unique machine-id or create our own in data_dir.
    We first check for the machine-id in machine-token.json before
    looking at the system file.
    r)�machine_id_file�machineTokenInfo�	machineId�
)�uaclient.files.state_filesr��
machine_tokenr|�read�ETC_MACHINE_ID�DBUS_MACHINE_IDr0�path�existsrM�rstrip�str�uuid�uuid4�write)�cfgr��cfg_machine_id�fallback_machine_idr��content�
machine_ids       r:�get_machine_idr�s���;�
����*�*�.�.�/A�2�F�J�J��
���!�!�)�.�.�0����1���
�7�7�>�>�$����o�,�,�T�2�G����	��"�"��T�Z�Z�\�"�J����*�%��rmc�@�t�}|jdd�}tjdd|jdd��}|jdd�}|jdd�}|r|s�tjt
|�}|s't
j|jdd�|�	��|j�}|xs|jd
d�}|st
j|���|xs|jdd�}t|||j�|�
�S)N�NAME�UNKNOWNz\.\d LTSz LTS�VERSIONrt�VERSION_CODENAME�
VERSION_ID)�orig_ver�mod_verr!)rAr )rr r!r")�_parse_os_releaser|r>�subrQ�REGEX_OS_RELEASE_VERSIONr
�ParsingErrorOnOSReleaseFile�	groupdict�MissingSeriesOnOSReleaseFiler�lower)�
os_releaserr"r!r rQ�
match_dicts       r:�get_release_infor�.s��"�$�J��>�>�&�)�4�L��V�V�K�����	�2�1N�O�N�
�^�^�.��
3�F��n�n�\�2�.�G������1�>�B����8�8�#���	�2�6���
��_�_�&�
��7�:�>�>�(�B�7����9�9�&��
��:�Z�^�^�I�r�:���!���|�|�~�%�	�rmc�*�tddg�\}}||vS)N�/usr/bin/ubuntu-distro-infoz--supported-esm�r^�r!rjrks   r:�is_ltsr�Ns!���3�5F�G�H�I�C���S�=�rmc�<�tt�j�S�N)r�r�r!�rmr:�is_current_series_ltsr�Ts���"�$�+�+�,�,rmc�*�tddg�\}}||vS)Nr�z--supportedr�r�s   r:�is_supportedr�Ys ���3�]�C�D�I�C���S�=�rmc�Z�t|�sytdd|dg�\}}t|�dkS)zCReturn True when Ubuntu series supports ESM and is actively in ESM.Fr�z--seriesz-yeolr)r�r^rSr�s   r:�
is_active_esmr�_s8���&�>���	&�
�F�G�D��I�C���s�8�q�=�rmc�<�tt�j�Sr�)r�r�r!r�rmr:�is_current_series_active_esmr�js���)�+�2�2�3�3rm�run_pathc�*�	tdg�y#tj$rYnwxYw	tgd��y#ttf$rYnwxYwdD]C}t
jj||�}t
jj|�s�Cyy)z>Checks to see if this code running in a container of some sort�ischrootF)ro�--quietz--containerT)�container_typezsystemd/container)	r^r
ru�IOError�OSErrorr0r��joinr�)r��filenamer�s   r:r-r-os���
��j�\�����+�+�
��
��
��
>�?����W��
��
��<����w�w�|�|�H�h�/��
�7�7�>�>�$����s��%�%�
7�A	�A	c�Z�ddlm}|j�D]}d|jvs�yy)z�Returns True if any package installed has "ubuntu-desktop" in the name.

    This includes ubuntu-desktop, ubuntu-desktop-minimal, kubuntu-desktop, etc.
    r)�aptzubuntu-desktopTF)�uaclientr��get_installed_packages�name)r�r`s  r:�
is_desktopr��s3����-�-�/����w�|�|�+���rmc���	td�}i}|j�D]<}|jdd�\}}|s�|j	�j	d�||<�>|S#t$rtd�}Y�iwxYw)Nz/etc/os-releasez/usr/lib/os-release�=rL�")rM�FileNotFoundError�
splitlinesrNrP)�
file_contents�data�line�keyr�s     r:r�r��s���9�!�"3�4�
��D��(�(�*�1���Z�Z��Q�'�
��U�����
�+�+�C�0�D��I�1��K���9�!�"7�8�
�9�s�A � A7�6A7c���	tt�j�}|D]�}|j
d�}|d|k(s�|dk(rd}nd|dvr|dn|d}ttjj|dd	�j�tjj|d	�j��
�cSt	j|���#t$rt	j
��wxYw)N�,��xenialz
2026-04-23�LTSr��z%Y-%m-%d)rr)r!)rM�DISTRO_INFO_CSVr�r�r
�MissingDistroInfoFilerNrr3rC�date�MissingSeriesInDistroInfoFile)r!�linesr��valuesrs     r:�get_distro_infor��s���1��/�*�5�5�7���
�����C����!�9�����!�&��',��q�	�'9�&��)�v�a�y����%�%�.�.�v�a�y�*�E�J�J�L� �)�)�2�2�7�J�G�L�L�N��
�
��
2�
2�&�
A�A���1��.�.�0�0�1�s�C�C6�programc���tjj|vr
t|�r|Stjjdd�j
tj�D�cgc]}|jd���}}|D�cgc]!}tjj|���#}}|D]1}tjj||�}t|�s�/|cSycc}wcc}w)z;Find whether the provided program is executable in our PATH�PATHrtr�N)r0r��sep�is_exe�environr|rN�pathseprP�abspathr�)r��p�paths�normalized_pathsr��program_paths      r:�whichr��s���	�w�w�{�{�g���'�?��N� �j�j�n�n�V�R�8�>�>�r�z�z�J�
�������
�E�
�5:�:�q�������*�:��:� � ���w�w�|�|�D�'�2���,���� ���
��;s�)C&�&C+�installed_pkgs�installed_pkgs_regexc�V�tjjt�sy|�|�y	t	tt�jd��}|�t|j|��dk7ry|�'|D]"}|D]}tj||�s�y�$y#t$rYywxYw)a�Check if the system needs to be rebooted.

    :param installed_pkgs: If provided, verify if the any packages in
        the list are present on /var/run/reboot-required.pkgs. If that
        param is provided, we will only return true if we have the
        reboot-required marker file and any package in reboot-required.pkgs
        file. When both installed_pkgs and installed_pkgs_regex are
        provided, they act as an OR, so only one of the two lists must have
        a match to return True.
    :param installed_pkgs_regex: If provided, verify if the any regex in
        the list matches any line in /var/run/reboot-required.pkgs. If that
        param is provided, we will only return true if we have the
        reboot-required marker file and any match in reboot-required.pkgs
        file. When both installed_pkgs and installed_pkgs_regex are
        provided, they act as an OR, so only one of the two lists must have
        a match to return True.
    FTr�r)
r0r�r��REBOOT_FILE_CHECK_PATH�setrM�REBOOT_PKGS_FILE_PATHrNr�r_�intersectionr>r?)r�r��reboot_required_pkgs�pkg_name�	pkg_regexs     r:�
should_rebootr��s���0�7�7�>�>�0�1����"6�">���"��+�,�2�2�4�8� 
���!��~�*�*�+?�@�A�Q�F���'�,�	 �H�1�
 �	��9�9�Y��1��
 �	 �
������s�'B�	B(�'B(r�c��tjj|�xr$tj|tj�Sr�)r0r��isfile�access�X_OK)r�s r:r�r�s)��
�7�7�>�>�$��<�B�I�I�d�B�G�G�$<�<rmr��decodec��t|d�5}tjd|�|j�}ddd�j	d�S#1swY�xYw)z!Read filename and decode content.�rbzReading file: %sN�utf-8)�openr.�debugr�r�)r�r��streamr�s    r:rMrMsN��	
�h��	� ���	�	�$�h�/��+�+�-�� ��>�>�'�"�"� � �s�'A
�
A�modec�
�tjd|�tjtjj|�d��t
j|�j�tj||�y)NzCreating file: %sT��exist_ok)
r.rr0�makedirsr��dirname�pathlib�Path�touch�chmod)r�rs  r:�create_filersO���I�I�!�8�,��K�K�������)�D�9��L�L��� � �"��H�H�X�t�rmr�c���d}tjj|�}|rGtj|�j�}tj|j�}|�|}n|�d}	tjtjj|�d��tjddtjj|���}tjd||j�|j|j!d	��|j#�|j%�tj&|j|�|r5tj(|jj*|j,�tj.|j|�y#t0$r(}|�tj2|j�|�d}~wwxYw)
a_Write content to the provided filename encoding it if necessary.

    We preserve the file ownership and permissions if the file is present
    and no mode argument is provided.

    @param filename: The full path of the file to write.
    @param content: The content to write to the file.
    @param mode: The filesystem mode to set on the file.
    N�Tr�wbF)r�delete�dirz*Writing file %s atomically via tempfile %sr)r0r�r�rr
r1�S_IMODE�st_moder
r�tempfile�NamedTemporaryFiler.rr�r��encode�flush�closer�chown�st_uid�st_gid�renamer8�unlink)r�r�r�tmpf�is_file_present�	file_stat�f_mode�es        r:�
write_filer'sU���D��g�g�n�n�X�.�O���L�L��*�/�/�1�	����i�/�/�0���<��D�	
�����
���B�G�G�O�O�H�-��=��*�*��e�������)B�
��	�	�	�8�(�D�I�I�	
�	
�
�
�7�>�>�'�*�+��
�
���
�
��
������D�!���H�H�T�Y�Y�	� 0� 0�)�2B�2B�C�
�	�	�$�)�)�X�&�������I�I�d�i�i� �����s�0EF2�2	G#�;#G�G#�	file_pathc��	tj|�tjd|�y#t$rtjd|�YywxYw)z<Remove a file if it exists, logging a message about removal.zRemoved file: %sz*Tried to remove %s but file does not existN)r0r!r.rr�)r(s r:�ensure_file_absentr*AsC��K�
�	�	�)���	�	�$�i�0���K��	�	�>�	�J�K�s�+.�A�A�args�rcs�capture�timeout�override_env_vars�pipe_stdouterrc��|D�cgc]%}t|t�r|n|jd���'}}d}d}	|r tj}tj}	d}
|rit
j�|�}
|�dg}tjdj|��}	tj|||	|
��}|j|��\}
}|
r|
jd�nd}|r|jd�nd}|j |vr#tj||j ||���|r"t$j'd
||j |�||fScc}w#t$rr	
r|
jd�nd}r|jd�nd}tj|j ||���#t"$rtj|�	��wxYwwxYw)a�Run a command and return a tuple of decoded stdout, stderr.

    @param args: A list of arguments to feed to subprocess.Popen
    @param rcs: A list of allowed return_codes. If returncode not in rcs
        raise a ProcessExecutionError.
    @param capture: Boolean set True to log the command and response.
    @param timeout: Optional float indicating number of seconds to wait for
        subp to return.
    @param override_env_vars: Optional dictionary of environment variables.
        If None, the current os.environ is used for the subprocess.
        If defined, these env vars get merged with the current process'
        os.environ for the subprocess, overriding any values that already
        existed in os.environ.

    @return: Tuple of utf-8 decoded stdout, stderr
    @raises ProcessExecutionError on invalid command or returncode not in rcs.
    @raises subprocess.TimeoutError when timeout specified and the command
        exceeds that number of seconds.
    rNr� )�stdout�stderr�env)r.rt)�cmd�	exit_coder3r4)r6zRan cmd: %s, rc: %s stderr: %s)�
isinstance�bytesr�
subprocess�PIPEr0r�r�redact_sensitive_logsr��Popen�communicater�r�r
ru�
returncode�UnboundLocalErrorr.r)r+r,r-r.r/r0�x�
bytes_argsr3r4�
merged_env�redacted_cmd�procrj�err�
out_result�
err_results                 r:�_subprIJs���8CG��=>�Z��5�
!��q�x�x��'8�8��J���F�
�F����������
�J��8��
�
�8�&7�8�
�
�{��c���-�-�c�h�h�t�n�=�L�E��������	
���%�%�g�%�6�
��c�),����G�$��J�(+����G�$��J����c�!��.�.���o�o���	
�	
���	�	�,���O�O��		
��z�!�!��s��8�E�
	E�03����G�,��J�03����G�,��J��2�2� ��/�/�!�!�	�
��!�	E��2�2�|�D�D�	E��E�s$�*E
�.E�	G
�A
F&�& G�G
�retry_sleepsc��|�|j�nd}		t||||||��\}}	||fS#tj$r�}	|rItjt
|	��tjd|	j|	j�|s�tjt
|	��tjdt|��tj|jd��Yd}	~	nd}	~	wwxYw��)a�Run a command and return a tuple of decoded stdout, stderr.

     @param subp: A list of arguments to feed to subprocess.Popen
     @param rcs: A list of allowed return_codes. If returncode not in rcs
         raise a ProcessExecutionError.
     @param capture: Boolean set True to log the command and response.
     @param timeout: Optional float indicating number of seconds to wait for a
         subp call to return.
     @param retry_sleeps: Optional list of sleep lengths to apply between
        retries. Specifying a list of [0.5, 1] instructs subp to retry twice
        on failure; sleeping half a second before the first retry and 1 second
        before the next retry.
     @param override_env_vars: Optional dictionary of environment variables.
        If None, the current os.environ is used for the subprocess.
        If defined, these env vars get merged with the current process'
        os.environ for the subprocess, overriding any values that already
        existed in os.environ.

    @return: Tuple of utf-8 decoded stdout, stderr
    @raises ProcessExecutionError on invalid command or returncode not in rcs.
    @raises subprocess.TimeoutError when timeout specified and the command
        exceeds that number of seconds.
    N)r/r0zStderr: %s
Stdout: %szRetrying %d more times.r)�copyrIr
rur.rr�r/r4r3r_�time�sleep�pop)
r+r,r-r.rJr/r0rjrFr&s
          r:r^r^�s���@+7�*B�<�$�$�&��L�
�	,������"3�-�
�H�C��
���8�O���/�/�	,���	�	�#�a�&�!����4�a�h�h����I����I�I�c�!�f���I�I�/��\�1B�C��J�J�|�'�'��*�+�+��	,��s�0�C<�B/C7�7C<�folder_pathc��	t|�tjd|�y#t$rtjd|�YywxYw)NzRemoved folder: %sz,Tried to remove %s but folder does not exist)rr.rr�)rPs r:�ensure_folder_absentrR�s?��O��{���	�	�&��4���O��	�	�@�+�N�O�s�!$�A�A�service_namec�V�	tddd|g�y#tj$rYywxYw)a^
    Get if the systemd job is active in the system. Note that any status
    different from "active" will make this function return False.
    Additionally, if the system doesn't exist we will also return False
    here.

    @param service_name: Name of the systemd job to look at

    @return: A Boolean specifying if the job is active or not
    �	systemctlz	is-activer�FT)r^r
ru)rSs r:�is_systemd_unit_activerV�s7����k�;�	�<�
@�A����+�+����s��(�(c�4�	tdddd|g�\}}|r3|jd�r"|jd�dj�Stjd|�	y#tj$r"}tjd	||�
�Yd}~yd}~wwxYw)NrU�showz--property=ActiveStatez
--no-pagerzActiveState=r�rLz9Couldn't find ActiveState in systemctl show output for %sz-Failed to get ActiveState for systemd unit %s)�exc_info)r^�
startswithrNrPr.r/r
ru)rSrjrvr&s    r:�get_systemd_unit_active_stater[�s���
����(���
�
���Q��3�>�>�.�1��9�9�S�>�!�$�*�*�,�,��K�K�K��
���
�+�+�
����;���	�	
�	
�
��

�s�AA"�
A"�"B�5B�Bc��tj�rtjStj
j
d�}|r.tjj|tj�Stjjtjjd�dtj�S)N�XDG_CACHE_HOME�~z.cache)rr[r�UAC_RUN_PATHr0r�r|r�r��USER_CACHE_SUBDIR�
expanduser)�xdg_cache_homes r:�get_user_cache_dirrcs|���!�!�#��$�$�$��Z�Z�^�^�$4�5�N���w�w�|�|�N�H�,F�,F�G�G�
�7�7�<�<�
�����3���8�+E�+E��rmc�&�	tt�}g}g}d}|j�D];}t	j
||�r|j
|��+|j
|��=tt|�t|���S#t$rYywxYw)Nz^(linux-image|linux-base).*)r(r))	rMr�r�rNr>rQ�appendr'�sorted)�pkg_list_strr(r)�kernel_regex�pkgs     r:�get_reboot_required_pkgsrjs���� �!6�7�����O�0�L��!�!�#�*��
�8�8�L�#�&��"�"�3�'��$�$�S�)�	*�� �!2�3���/��������s�B�	B�B)z/run)NN)T)rr�)NFNNT)NFNNNT)Sr3r]�loggingr0rr>r1r:rrMr��	functoolsr�shutilr�typingrrrrr	r
rr�rr
rr�r�r�r�r�r}�	getLogger�replace_top_level_logger_name�__name__r.r�rRr�rr�rSrrr#r'r@�uname_resultr;rIrVrgrlrxr�r�r��boolr�r�r�r�r�r-r�r�r�r�r�r�rMrr'r*�floatrIr^rRrVr[rcrjr�rmr:�<module>rus������	��	��������I�I�I�/�/�3��7��"��,��5�� �'�*���g���:��:�:�8�D�E��=��

	����E�8�=�=�)�I�x�}�}�+E�F��
���	�s�#�	�#��	�x�� 1� 1�2�3�	)�8�C�=�9�	�(�3�-� �	�(�3�-� �	�(�3�-� �	���
��	�8�C�=�!�
�
�
���	���	�C��	�3��	�3��	����
�	�c��	�(�3�-� �	�X�c�]�#���� ��	�h�t�C�y�1�2�	�H�T�#�Y�/�0���� B���
�?�?��
�h��� ��2�
�?�?��
�h��� ��(�4��&
��&
��&
�V �F�4���s����
�4���s����(�4���g����.�4���3����>�4���+����>�4���3��4����
�4��-�t�-��-��4���������
�4���#��$�����4��4�d�4��4��4���3��D����4�4��
�D�
��
��4��
�4��S��>�
��
��4��B�C�B�J�B��B�(�3��8�C�=��$*.�/3�3��S��X�&�3�"�3�s�8�,�3�
�3�l=��=��=�
#��#�T�#�S�#��#��S��T��8<�(��(��(�'/��}�(�	�(�VK�#�K�$�K� $��#�26��
T"�
�3�-�T"�	�$�s�)�	�T"��T"��e�_�	T"�
 ��S�#�X��/�T"��
T"��3��8�_�T"�r $��#�*.�26��5�
�3�-�5�	�$�s�)�	�5��5��e�_�	5�
�4��;�'�5� ��S�#�X��/�
5��5��3��8�_�5�pO�c�O�d�O������$�����
��6
�C�
��(�+=�">�rm

Zerion Mini Shell 1.0