o
    *b
                     @   s*   d dl mZmZmZ G dd deeZdS )    )PluginIndependentPluginSoSPredicatec                   @   s,   e Zd ZdZdZdZdZdd Zdd Zd	S )
Grub2zGRUB2 bootloadergrub2)Zboot)r   z	grub2-efizgrub2-commonc                 C   s~   |  ddd | g d | jddd d}d	| d
d}| j| t| |ddr.|d7 }| j|ddit| dgdd d S )NZ	grub2_cfgZgrub2_efi_cfg)/boot/grub2/grub.cfgz/boot/efi/.*/grub.cfg)z/boot/efi/EFI/*/grub.cfgr   z/boot/grub2/grubenvz/boot/grub/grub.cfgz/boot/loader/entriesz/etc/default/grubz/etc/grub2.cfgz/etc/grub.dzls -lanR /bootZls_boot)Ztagsgrub2-mkconfigz	%s --helpz--no-grubenv-update)cmdoutput)Zcmd_outputs)predz --no-grubenv-updateZGRUB_DISABLE_OS_PROBERtrueZdm_mod)Zkmods)envr   )Zadd_file_tagsZadd_copy_specZadd_cmd_outputZtest_predicater   )selfZgrub_cmdco r   :/usr/lib/python3/dist-packages/sos/report/plugins/grub2.pysetup   s   
zGrub2.setupc                 C   sL   d}d}d}d}|  d|| |  d|| | d|| | d|| d S )Nz(password )\s*(\S*)\s*(\S*)z!(password_pbkdf2)\s*(\S*)\s*(\S*)z\1 \2 ********z\1 \2 grub.pbkdf2.********r   z
.*\/grub\.)Zdo_cmd_output_subZdo_path_regex_sub)r   Z
passwd_expZpasswd_pbkdf2_expZ
passwd_subZpasswd_pbkdf2_subr   r   r   postproc3   s0   zGrub2.postprocN)	__name__
__module____qualname__Z
short_descZplugin_nameZprofilesZpackagesr   r   r   r   r   r   r      s    r   N)Zsos.report.pluginsr   r   r   r   r   r   r   r   <module>   s   