📂 FileMgr
📍
/
usr
/
lib
/
python3
/
dist-packages
/
cloudinit
/
distros
/
__pycache__
✏️ /usr/lib/python3/dist-packages/cloudinit/distros/__pycache__/raspberry_pi_os.cpython-312.pyc
✕ Tutup
� ��i� � �v � d dl Z d dlmZmZ d dlmZ e j e� Z G d� dej � Z y)� N)�net�subp)�debianc �N � � e Zd Zdedededef� fd�Zd d�Zdef� fd�Zd � Z� xZ S )�Distro�layout�model�variant�optionsc � �� t �| � ||||� t j g d�� t j g d�� | j dd� t j d� rt j g d�� y y )N)�/usr/bin/raspi-config�nonint�update_labwc_keyboard)r r �update_squeekboard�restartr zkeyboard-setup�udevadm)r �triggerz--subsystem-match=inputz--action=change)�super� set_keymapr �manage_service�which)�selfr r r r � __class__s ��C/usr/lib/python3/dist-packages/cloudinit/distros/raspberry_pi_os.pyr zDistro.set_keymap so �� � ���6�5�'�7�;�� � � � � � � � � � ���I�'7�8��:�:�i� ��I�I�� � !� c �" � t j ddd|� g� y # t j $ r^ |j d� s4t j d|� t j ddd|� d�g� Y y t j d|� Y y w xY w)Nr r �do_change_localez.UTF-8zTrying to set locale %s.UTF-8zFailed to set locale %s)r �ProcessExecutionError�endswith�LOG�info�error)r �locale�out_fn�keynames r �apply_localezDistro.apply_locale. s� � � =��I�I�+��&��h� � �� �)�)� =��?�?�8�,����8�&�A�� � �/� �*�!�(�&�)� �� � � �3�V�<� =�s � �AB�5B� B�returnc �� �� t �| � |fi |��}|s|S t j g d�d|i�� y# t j $ r }t j d|� Y d}~yd}~ww xY w)z� Add a user to the system using standard GNU tools This should be overridden on distros where useradd is not desirable or not available. Returns False if user already exists, otherwise True. )z/usr/bin/rename-userz-fz-s� SUDO_USER)� update_envzFailed to setup user: %sNFT)r �add_userr r r r"