+
    ˜qgj”!  ã                   ó  a € R& t!0 t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ]P                  ! ]4      tRtR	tR
tRRRRRR/tRtRtRtRtRtRRRR.R]R]./t] ^ k R R ltR R ltR  R! ltR" R# ltR$ R% lt R# )'é    N)ÚUnion)Úsubp)ÚCloud)ÚConfig)Ú
MetaSchema)ÚPER_INSTANCEÚrpiÚ
interfacesÚenable_usb_gadgetÚspiÚdo_spiÚi2cÚdo_i2cÚonewireÚ
do_onewireÚserialÚdo_serial_consÚdo_serial_hwz/usr/bin/rpi-usb-gadgetz(Rebooting to apply config.txt changes...ÚidÚcc_raspberry_piÚdistroszraspberry-pi-osÚ	frequencyÚactivate_by_schema_keysc                ó0   € V ^8„  d   QhR\         R\         /# )é   ÚenableÚreturn©Úbool)Úformats   "ÚB/usr/lib/python3/dist-packages/cloudinit/config/cc_raspberry_pi.pyÚ__annotate__r"   (   s   € ÷  ñ  ¤ð  ¬$ñ  ó    c                ó„  € \         P                  RV 4       \        P                  P	                  \
        4      '       g   \         P                  R\
        4       R#  \        P                  ! \
        V '       d   RMRR.R^R7       R#   \        P                   d"   p\         P                  R	T4        R
p?R# R
p?ii ; i)zsEnable / Disable Raspberry Pi USB gadget mode when
the script is present.

Returns True when a reboot is required.
zEnable rpi-usb-gadget mode: %sz#rpi-usb-gadget script not found: %sFÚonÚoffz-f)ÚcaptureÚtimeoutTz&Failed to configure rpi-usb-gadget: %sN)	ÚLOGÚdebugÚosÚpathÚexistsÚRPI_USB_GADGET_SCRIPTÚerrorr   ÚProcessExecutionError)r   Úes   & r!   Úconfigure_usb_gadgetr2   (   s”   € ô ‡I�IÐ.°Ô7ä�7‰7�>‰>Ô/×0Ò0Ü�	‰	Ð7Ô9NÔOÙðÜ�	Š	ä%ß‘ Eð ð
ð Øõ	
ñ  øÜ×%Ñ%ô Ü�	‰	Ð:¸AÔ>Ýûðús   ÁB	 Á:B	 Â	B?ÂB:Â:B?c                ó$   € V ^8„  d   QhR\         /# )r   r   r   )r    s   "r!   r"   r"   K   s   € ÷ ñ ”4ñ r#   c                  óp   €  \         P                   ! . RO4       R#   \         P                   d     R# i ; i)ú/usr/bin/raspi-configTF)r5   ÚnonintÚ	is_pifive)r   r0   © r#   r!   r7   r7   K   s/   € ðÜ�	Š	ÒBÔCÙøÜ×%Ñ%ô Úðús   ‚ œ5´5c                óR   € V ^8„  d   QhR\         \        \        3,          R\        /# )r   Úcfgr   )r   Údictr   )r    s   "r!   r"   r"   S   s'   € ÷ Kñ K¤E¬$´¨*Õ$5ð K¼$ñ Kr#   c                ó€  € RR R llpRpRp\        V \        4      '       d   V! V R4      pV! V R4      pM\        V \        4      '       d   T p\        4       '       g   V'       d   Rp \        P                  ! RR\
        \        V'       d   ^ M^4      .4        \        P                  ! RR\        \        T'       d   ^ M^4      .4       R#   \        P                   d"   p\        P                  R	T4        R
p?R# R
p?ii ; i  \        P                   d"   p\        P                  RT4        R
p?R# R
p?ii ; i)a=  Configure the serial (UART) interface on Raspberry Pi.

Depending on the configuration, this enables or disables
the serial console and the hardware UART by invoking
`raspi-config` non-interactively.

Args:
    cfg: Either a boolean or a dictionary:
        - If a bool, enables or disables the serial
          console and hardware UART together.
        - If a dict, may contain the keys `console`
          and `hardware` with boolean values controlling
          each individually.

Returns:
    True if the configuration was applied successfully,
    False otherwise.
Fc                ó0   € V ^8„  d   QhR\         R\        /# )r   Úcfg_dictÚname)r;   Ústr)r    s   "r!   r"   Ú0configure_serial_interface.<locals>.__annotate__g   s   € ÷ 
ñ 
¤ð 
¬Sñ 
r#   c                 ó�   € V P                  W4      p\        V\        4      '       g   \        P	                  R \
        VV4       V# V# )z"Invalid value for %s.serial.%s: %s)ÚgetÚ
isinstancer   r)   ÚwarningÚRPI_INTERFACES_KEY)r>   r?   ÚdefaultÚvals   &&& r!   Úget_bool_fieldÚ2configure_serial_interface.<locals>.get_bool_fieldg   sA   € Ø�l‰l˜4Ó)ˆÜ˜#œt×$Ò$Ü�K‰KØ4Ü"ØØô	ð ˆNØˆ
r#   ÚconsoleÚhardwareTr5   r6   z&Failed to configure serial console: %sNz'Failed to configure serial hardware: %s)F)rD   r;   r   r7   r   ÚRASPI_CONFIG_SERIAL_CONS_FNr@   r0   r)   r/   ÚRASPI_CONFIG_SERIAL_HW_FN)r:   rI   Úenable_consoleÚ	enable_hwr1   s   &    r!   Úconfigure_serial_interfacerQ   S   s
  € ÷(
ð €NØ€Iä�#”t×ÒÙ'¨¨YÓ7ˆÙ" 3¨
Ó3‰	ä	�Cœ×	Ò	ð ˆä�;Š;Ÿ>ð ˆ	ðÜ�	Š	à'ØÜ+ÜŸ‘A¨QÓ/ð	ô	
ðÜ�	Š	à'ØÜ)ÜŸ‘A¨Ó*ð	ô	
ñ øô ×%Ñ%ô Ü�	‰	Ð:¸AÔ>Ýûðûô ×%Ñ%ô Ü�	‰	Ð;¸QÔ?Ýûðús0   Á)1C Â1D ÃDÃ#C?Ã?DÄD=ÄD8Ä8D=c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   Úifacer   r   )r@   r   )r    s   "r!   r"   r"   ¡   s!   € ÷ ñ œsð ¬Dð ´Tñ r#   c                ó0  € V \         P                  4       9   g   Q RV  24       h \        P                  ! RR\         V ,          \        V'       d   ^ M^4      .4       R#   \        P                   d"   p\
        P                  RY4        Rp?R# Rp?ii ; i)aµ  Enable or disable a supported hardware interface.

Supported interfaces are defined in `SUPPORTED_INTERFACES` and
currently include SPI, I2C, and 1-Wire. The function applies
the change using `raspi-config` in non-interactive mode.

Args:
    iface: The interface name (e.g. `"spi"` or `"i2c"`).
    enable: True to enable the interface, False to disable it.

Returns:
    True if the interface configuration succeeded, False otherwise.
zUnsupported interface: r5   r6   TzFailed to configure %s: %sNF)ÚSUPPORTED_INTERFACESÚkeysr   r@   r0   r)   r/   )rS   r   r1   s   && r!   Úconfigure_interfacerW   ¡   sŠ   € ð 	Ô%×*Ñ*Ó,Ô,ð)à	   Ð(ó)Ø,ðÜ�	Š	à'ØÜ$ UÕ+ÜŸ‘A QÓ'ð	ô	
ñ øÜ×%Ñ%ô Ü�	‰	Ð.°Ô9Ýûðús   ¥8A ÁBÁ4BÂBc          
      óL   € V ^8„  d   QhR\         R\        R\        R\        RR/# )r   r?   r:   ÚcloudÚargsr   N)r@   r   r   Úlist)r    s   "r!   r"   r"   Ã   s6   € ÷ Tñ T”ð Tœ6ð T¬%ð T´tð TÀñ Tr#   c                 ó4  € \         V9  d   R # \        V\         ,          \        4      '       g)   \        P	                  R\         V\         ,          4       R # V\         ,          '       g   \        P                  R\         4       R # RpV\         ,           EF>  pV\        8X  dR   V\         ,          V,          p\        V\        4      '       d   V\        V4      ,          pM\        R\         24      hK`  V\        8X  Ed½   \        V\         ,          V,          \        4      '       g1   \        P	                  R\         V\         ,          V,          4        R # V\         ,          V,          '       g   \        P                  RV4        R # \        V\         ,          V,          P                  4       4      pV Fý  pV\        P                  4       9  d)   V\        8w  d   \        P	                  R\        V4       KD  V\         ,          V,          V,          pV\        8X  dN   \        V\        \        34      '       g   \        P	                  R\        VV4       MV\        V4      ,          pK·  \        V\        4      '       d   V\!        W†4      ,          pKá  \        P	                  R\        VV4       Kÿ  	  EK(  \        P	                  RV4       EKA  	  VRJ d;   VP"                  P%                  R	R
\&        R7      p	\(        P(                  ! V	4       R # R # )NzInvalid value for %s: %szEmpty value for %s. Skipping...FzInvalid value for zInvalid key for %s: %szInvalid value for %s.%s: %szUnsupported key: %sTÚrebootÚnow)ÚmodeÚdelayÚmessage)ÚRPI_BASE_KEYrD   r;   r)   rE   r*   ÚENABLE_USB_GADGET_KEYr   r2   Ú
ValueErrorrF   r[   rV   rU   ÚSERIAL_INTERFACErQ   rW   ÚdistroÚshutdown_commandÚ
REBOOT_MSGr   )
r?   r:   rY   rZ   Úwant_rebootÚkeyr   ÚsubkeysÚsubkeyÚcmds
   &&&&      r!   Úhandlern   Ã   sg  € Ü˜3ÔÙÜ˜œLÕ)¬4×0Ò0Ü�‰Ø&ÜØ”Õô	
ñ
 	Ø”×ÔÜ�	‰	Ð3´\ÔBÙà€Kà”<× Ñ ˆØÔ'Ô'ØœÕ& sÕ+ˆFä˜&¤$×'Ò'ØÔ3°FÓ;Õ;‘ä Ð#5Ô6KÐ5LÐ!MÓNÐNÙØÔ&Õ&Ü˜c¤,Õ/°Õ4´d×;Ò;Ü—‘Ø.Ü ØœÕ% cÕ*ôò
 ØœÕ& s×+Ô+Ü—	‘	Ð;¸SÔAÚä˜3œ|Õ,¨SÕ1×6Ñ6Ó8Ó9ˆGó "�àÔ"6×";Ñ";Ó"=Ô=ØÔ"2Ô2ä—K‘KØ0Ô2DÀfôñ àœ\Õ*¨3Õ/°Õ7�àÔ-Ô-Ü% f¬t´T¨l×;Ò;ÜŸ™Ø9Ü.Ø"Ø"õ	ð $Ô'AÀ&Ó'IÕI˜Ùä˜f¤d×+Ò+ØÔ#6°vÓ#FÕF’Kä—K‘KØ5Ü*ØØö	ô7 "ôD �K‰KÐ-¨sÔ3Úñw !ðz �dÓà�l‰l×+Ñ+ØØÜð ,ó 
ˆô
 	�	Š	�#Žñ r#   c                ó@   € V ^8„  d   Qh/ ^ \         9   d
   \        ;R&   # )r   Úmeta)Ú__conditional_annotations__r   )r    s   "r!   r"   r"      s   € ‡�÷2ò „jñ ò3 r#   )"rq   Úloggingr+   Útypingr   Ú	cloudinitr   Úcloudinit.cloudr   Úcloudinit.configr   Úcloudinit.config.schemar   Úcloudinit.settingsr   Ú	getLoggerÚ__name__r)   rb   rF   rc   rU   re   rM   rN   r.   rh   rp   r2   r7   rQ   rW   rn   r"   )rq   s   @r!   Ú<module>r{      sÀ   øð÷ €Û 	Ý å Ý !Ý #Ý .Ý +à×Ò˜Ó!€Ø€Ø!Ð Ø+Ð à	ˆ8Ø	ˆ8Øˆ|ðÐ ð
 Ð Ø.Ð Ø*Ð Ø1Ð Ø7€
ð 	Ð
ØÐ!Ð"Ø�Ø ˜~ð	€ó õ õFõKõ\÷DTr#   